This repo consists of a RESTful api developed for a Smart Education System based on the requirements provided.
This api was written in Flask-Restx and the database is PostgreSQL. If you want to change the database please change the connection string SQLALCHEMY_DATABASE_URI
accordingly
All the endpoints are jwt protected except for login.
Swagger documentation is available for API testing. For the Postman
users, please find the postman collection here.
Admin user is automatically created and instructors can be created using admin.
Students and classes can be created by instructors.
Unit tests and integration tests should be written in the ideal scenario (using pytest). However, due to time restriction they weren't written
The API can be deployed in a platform like Heroku.
There are some more validations can be implemented based on the requirement. This implementation consists only the basic validations.
Database design can be further improved to make APIs more dynamic.
This api was written in Flask. Python should be installed before setting up the project.
- Clone the git repository
- go to the folder
cd flask-rest-api
- install virtualenv
pip install virtualenv
- create a virtual environment
virtualenv venv
- Activate the virtual environment
source venv/bin/activate
- Install requirements from
requirements.txt
pip install -r requirements.txt
- Export the environment path variable
export FLASK_APP=src/
echo $FLASK_APP
- Create .env file using
.env.sample
- Run
runserver.py
file
python runserver.py
Development server will start and Swagger documentation will be available on
http://127.0.0.1:5000/