/flask-rest-api

Flask REST api for student management system

Primary LanguagePython

Flask Rest API for Education System

This repo consists of a RESTful api developed for a Smart Education System based on the requirements provided.

General Details

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.

Future Improvements

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.

Setup Instructions

This api was written in Flask. Python should be installed before setting up the project.

Steps:

  1. Clone the git repository
  2. go to the folder
cd flask-rest-api
  1. install virtualenv
pip install virtualenv
  1. create a virtual environment
virtualenv venv
  1. Activate the virtual environment
source venv/bin/activate
  1. Install requirements from requirements.txt
pip install -r requirements.txt
  1. Export the environment path variable
export FLASK_APP=src/
echo $FLASK_APP
  1. Create .env file using .env.sample
  2. Run runserver.py file
python runserver.py

Development server will start and Swagger documentation will be available on http://127.0.0.1:5000/

Database Design

Database Design