- Node.js v22.x or higher
- npm
- FastApi (Python)
- Docker Desktop
- Open a terminal and navigate to the project directory.
- Run the server.
node server\src\server.js - Open a second terminal and navigate to the client folder in the project directory.
- Install packages with npm and run the client.
npm install
npm start
- Open command prompt in the server directory of the project.
- Install the modules listed in the requirements.txt.
pip3 install -r requirements.txt
- Open Command Prompt
- Run pip install
"fastapi[standard]"
- Navigate to FastApi directory
cd server - (Optional) Configure extra CORS origins via environment variable (comma-separated).
CORS_ORIGINS="https://example.com,https://another.example.com" - Run the server
fastapi dev main.py - Go to http://127.0.0.1:8000/docs to interact with API
- Have Docker running in the background.
- Navigate to the root directory.
- Create the container with:
docker compose up -d - To update your database to the latest version, run the following command:
alembic upgrade head
ADDITIONAL NOTES:
Run the following command to downgrade the database:
Warning: This command will drop ALL existing tables and their associated data
alembic downgrade base
Auto-generated migrations
- Navigate to
/server/models/dbmodels.pyand modify/create tables as necessary. - Navigate to the server directory.
- Run the following command to ensure you are on the current version:
alembic upgrade head - Run the following command to create the migration:
alembic revision --autogenerate -m "Description of migration"
Manual migrations
- Navigate to the server directory.
- Run the following command to add a new version:
alembic revision -m "Description of migration" - Navigate to
/server/alembic/versions/nameOfNewVersion.pyand locate the created version file. - Refer to https://alembic.sqlalchemy.org/en/latest/ops.html for detail on creating/dropping tables.
The script will generate random data directly into the database.
The amount of data generated can be modified at the head of the script.
- Open a terminal and navigate to the root directory of the project.
- Run the following command to generate data:
python -m server.tools.generate_dummy_data
- If not already installed, run the command:
npx playwright install - Open a terminal and navigate to the Client directory.
- run the command:
npx playwright test - Tests will now begin running and the terminal will log the status of completed tests. Proceeding this it will open a window in your browser with a more detailed overview. This can also be accessed directly on http://localhost:9323/.