/migrations # Migration files
/apis # Routes
/base.py # Where all the routes are grouped
/routes # Routes
/config # Main configuration
/config.py # configurations
/core
/entity # entity
/protocol # abstract of repository
/services # services
/exceptions # Custom exceptions
/infrastructure
/models # Database table models
/repository # All database related operations/functions
/session.py # Database session
/base_class.py # Base Class for table models
/base_mixin.py # Base Mixin for timestamp and created by
/base_repo.py # Base Class for repository with basic CRUD features
/base.py # Where all table models are grouped
/schemas # Request and response models
/utils # Services
/hashing.py # Hashing
/JWTtoken.py # JWTtoken
/oauth2.py # Oauth2
main.py # App Entry Point
.env.example # Example for ".env"
First create a directory then create a virtual environment in it (PLEASE USE VIRTUAL ENVIRONMENT).
python3 -m venv <your-env-name>
To activate your virtual environment go to
<your-env-name>\Scripts\activate.bat
source <your-env-name>/bin/activate
Finally git clone the repository.
git clone https://github.com/thamardaw/magix-support-lab-management-api.git
Then go into the cloned folder and install requirements (we will be continue working on this directory). While installing setup the ".env" file.
pip install -r requirements.txt
Migrate your models into database.
# to create or update the models to database
alembic upgrade head
Now let's start your server.
uvicorn main:app --reload
if you installed new packages during development, don't forget to update the requirement.
pip freeze > requirements.txt
This command is for auto generating the migration files if you add new models or make changes to your existing model. Then don't forget to mirgrate the changes.
alembic revision --autogenerate -m "init"