This is an in-development website aimed to provide the ability for users to track, analyse and share their study sessions with one another.
- Make sure you have python3 installed, and if using windows to use WSL
- Set up a venv virtual environment to keep things nicely packaged
python3 -m venv venvsource venv/bin/activate
- Install packages required with
pip install -r requirements.txt - Install tailwind cli (optional, only for developing css - not needed for running server)
- Place exe in directory, and rename to
tailwindcss- Should look like the following:
CITS3403-PROJECT/tailwindcssNote: there is no filetype/suffix
- Should look like the following:
- Place exe in directory, and rename to
- Activate the venv virtual environment with
source venv/bin/activate - Initialise the database with the following commands (if there is no
app/app.db):flask db init- to create migrations versioning folder + .dbflask db migrate -m "Initial Models"- to automatically create scripts to update tables to latest model definitionsflask db upgrade- to push the latest tables to your .db
- Run flask application with
flask run --debug - Run the Tailwind CSS compiler (in a separate terminal)
./tailwindcss -i app/templates/input.css -o app/static/tailwind.css --watch- This isn't only necessary for updating CSS updates. Not required for simple set-up.
Exception: If the database really doesn't seem to be working, hard reset it by deleting the migrations folder and the app/app.db file.
- Unit Tests:
python -m unittest tests/unit_test.py - Selenium Tests:
python -m unittest tests/selenium_test.py
Note: Selenium requires firefox to be installed in your linux subsystem - sudo apt install firefox
- Flask
- Our web app backend
- Integrates Jinja templates
- python-dotenv
- Saves environment variables between venv sessions
- Tailwind (CLI)
- A CSS formatter
- Typically depends on Node Package Manager - but because our backend is currently only python, we've opted for an independent cli
- SQLAlchemy
- Backbone of interacting with an SQL database
- Flask-Login
- Handles user sessions + authentication
- werkzeug-security
- Password hashing/salting
- Flask-Migrate
- Database migrations
- Flask-WTF
- Webforms
- Prevents CRSF attacks by including a secret key to authenticate it
- unittests
- Included within python
- Used for unit testing
- flask-moment
- Timezone Rendering
- Stored as UTC server-side: should adjust to client timezone.
- selenium
- Used for testing via emulating a browser page
- As close as you can get to testing a user experience