This is the backend for the SMSE project. It is a RESTful API that provides endpoints for the frontend to interact with the database and the models.
- Clone the repository
- Run
poetry install
to install the dependencies - Run
poetry shell
to activate the virtual environment - Run
flask db upgrade
to create the database - Run
smse-backend
to start the server
If you made changes to the models, you need to run flask db migrate
to generate a new migration file. After that, you need to run flask db upgrade
to apply the changes to the database.
- User Sends Credentials → Login Endpoint
- Server Validates Credentials
- Server Generates JWT Token
- Client Stores Token (usually in localStorage)
- Client Sends Token with Subsequent Requests
- Server Validates Token on Protected Routes
Find the API documentation here as well as usage examples.