- Install poetry:
pip install poetry
, then clone the repository - Change directory to the cloned repository
- Make a copy of the file
.env.example
, rename it to.env
, and set environment variables. Or don't change content of file to use default values for development. See.env.example
file for reference - Activate virtual environment using the command
poetry shell
- Make sure the virtual environment is activated before running the next commands within the project folder
- Install project dependencies:
poetry install
- Initialize database:
python main.py initial-data
- If there is an error when generating using realistic data, simply retry the command. Should the error persist, please open an issue.
- Run the app:
uvicorn main:app --reload
Username | Password |
---|---|
admin | superadmin |
teacher | superteacher |
<dummy-teacher> | testteacher |
student | superstudent |
<dummy-student> | teststudent |
- Reset database:
python main.py initial-data
- Run tests:
pytest
- Create an account:
python main.py create-account [OPTIONS] EMAIL LAST_NAME FIRST_NAME
- where
[OPTIONS]
include username, password, is-student, is-teacher, is-admin - example:
python main.py create-account --is-teacher=True [email protected] jose rizal
- where
- Create accounts from CSV file:
python main.py create-accounts FILEPATH
- example:
python main.py create-accounts inquizitor\data\accounts.csv
- example:
- Use Black Playground to check if code snippet conforms to PEP8
- View SQLite database using sqlitebrowser , otherwise use pgadmin
- if using SQLite, run the installed sqlitebrowser
- on the main white space upon running the app, drag&drop the
data.db
file (found within app module after running initial-data) - under the Tables(n) tab, right-click the table you want to view and select 'Browse'
If you want to use Docker, it is recommended to have a free diskspace of 2 GB. Running docker-compose will eventually download 1.2 GB at the minimum.
- Install Docker: Ubuntu Linux - Windows
- Change directory to the cloned repository
- Make a copy of the file
.env.example
, rename it to.env
, and set environment variables. Or don't change content of file to use default values for development. See.env.example
file for reference - Run the entire app (backend and db):
docker-compose up -d
- Remove
-d
to enable the logs
- Remove
- Initialize/ reset the database:
docker exec inquizitor_backend_1 python main.py initial-data
Usage | App | Creator |
---|---|---|
Realistic Quiz Data (inquizitor\inquizitor\db\init_db.py ) |
Open Trivia DB | PIXELTAIL GAMES LLC |
Frontend | Inquizitor Frontend | xtian18 |
Cheating Detection | Cheating Detection Model | ralf-t |
- If you made changes to the
Dockerfile
, rebuild the image for the service backend:docker-compose up --build
- If you made changes to the
docker-compose.yml
file, re-run the app:docker-compose up
- If you made changes to the backend code, restart the backend container:
docker-compose restart backend
- Run backend tests using:
docker exec inquizitor_backend_1 pytest
to access the interactive API documentation, go to http://127.0.0.1:8000/docs