## PLEASE READ ALL SETUP INSTRUCTIONS CAREFULLY AND IN FULL ## IMPORTANT, PLEASE READ THE BELOW BEFORE USING THE PROJECT ## Important Notice **Please be aware that this repository is intended for viewing purposes only. Any direct copying or reproduction of the code, layout, or any other part of this project is strictly prohibited.** This repository is solely provided to help aid in how a flask site can be set out and how more complex flask functionality can be used. If you are a student, copying or reproducing this work in your own assignments or projects will likely be considered academic dishonesty by UWE and I will not accept any fault for your failure to ensure your own work is unique. ## License This repository is for viewing purposes only. Unauthorized copying, reproduction, or distribution of any part of this project is strictly prohibited. By continuing to view this repository you accept these terms. ## Contact If you have any questions or would like to discuss this project further, please feel free to reach out. ## Updates and planned changes All updates and planned changes are made via a public Trello which tracks what tasks are done and are a work in progress https://trello.com/b/WILg5Qio/flask-website ## Getting setup If you wish to try out the site locally you are able to do so using Docker, using docker will automatically create a Flask and database instance with test data. Alternatively you can use the provided commands to load the site components but this may result in troubleshooting to get setup on your machine depending on installed dependancies. I will NOT assist in getting it running locally (I have only tested all instructions on Windows 10 and unsure if Mac or Linux will work as expected). ########################################## # Docker Commands # ########################################## # Before running any commands you will need to copy the .env-example file and rename the copy to .env . Once done change the # environment variables to whatever you would like. You can use these details to connect to your own database at localhost:{PORT} # Install Docker desktop https://www.docker.com/products/docker-desktop/ # Once done the above steps. Navigate to the app directory within your terminal. # Simply run `docker compose up -d` (The -d means you can continue to use the terminal after the command has executed) # Running this command will also create a database schema, use the details below to login to the site, and then use the .env variables for the database connection # Super admin user # Email: ethan@email.com # Password: 1234 ########################################## # Run Manually # ########################################## # The below are optional steps to run the application manually, you can alternatively install and run docker which will create the environment ########################################## # Flask Commands # ########################################## # To run Flask you will need to be in the virtual environment, to get started enter the following command while within the flask-backend folder # For the first time running manually you will also need to run the below additional commands # Linux python3 -m venv .venv # Windows py -3 -m venv .venv # Both Windows and Mac Once done you will need to run pip install on each line of requirements.txt . Once done restart your command line and carry on from the below commands to be fully setup. # Linux . .venv/bin/activate # Windows .venv\Scripts\activate # Then run the following, if you are not on port 5000 you will need to force it with the '--port 5000' arg flask run (Will run on 127.0.0.1:5000) # Creating new migration file (for development) flask db migrate -m "Add age column to User model" # To apply database changes/run migrations flask db upgrade ########################################## # Database Commands # ########################################## # Within the PR a MySQL dump is provided and loaded upon building of the docker container. If you are running the site outside a docker container # you will either need to follow one of the below options: # It is advised to use the dockerised containers as this will mount a SQL volume automatically. # Login to CSCT cloud and connect to ethan2clay_prj # Manually import the mysql dump provided within the sql folder # Add your own connector which can be done by changing .env
Ethan2.Clay@live.uwe.ac.uk
authored
Name | Last commit | Last update |
---|---|---|
.idea | ||
.vscode | ||
app | ||
migrations | ||
sql-setup | ||
.dockerignore | ||
.env-example | ||
.gitignore | ||
Dockerfile | ||
README | ||
config.py | ||
docker-compose.debug.yml | ||
docker-compose.yml | ||
package-lock.json | ||
requirements.txt |