This is a microservice that is part of a larger project. It is responsible for handling the user taking assessments and grading them. It is written in Python and uses FastAPI as the web framework. It uses a Postgres database to store the user's answers and the results of the assessment.
- Python 3.8 or higher
- All other dependencies are listed in the requirements.txt file.
- A Postgres database or credentials to a Postgres database
- Clone the repository
- Create a virtual environment
-
For Linux and MacOS
-
For virtualenv
make -v name_of_virtual_environment
-
For pipenv
make -V
-
-
For Windows
-
For virtualenv
make.bat v name_of_virtual_environment
-
For pipenv
make.bat V
-
- Install the dependencies
- For Linux and MacOS
make install
- For Windows
make.bat install
- Create a
.env
file in the root directory of the project and add the following environment variables in settings.py to the file:
DATABASE_URL=postgres://user:password@localhost:5432/database
To run the application, run the following command:
make
or
make run
To run the tests, run the following command:
make.bat test
make test
Documentation of the API is available at http://localhost:8000/api
You can deploy this application on serivces like render.com, Heroku, or AWS. You can also deploy it on your own server.
To deploy it on your own server, you can use gunicorn to run the application. You can also use nginx as a reverse proxy to the application.
To deploy it on Heroku, you can follow the instructions here.
To deploy it on AWS, you can follow the instructions here.
To deploy it on render.com, you can follow the instructions here.