Backend API for the Eather platform
- Python
- FastAPI
- Passlib
- MySql (Maria DB)
- Docker
- Appointment works (created in rogue dev mode) refactor and handle errors properly
- Results are a one-to-one relationship to Appointments
- Implement error handling properly
python -m venv venvFor UNIX and Unix-Like systems run:
source venv/bin/activateFor windows run:
venv\Scripts\activatepip install -r requirements.txtchmod u+x scripts/create_env.sh && ./scripts/create_env.sh- Ensure that database in the env file is already created. If not create it now.
- Run database migrations
#!/bin/python3
from models.base import Base
from config.db import engine
def init_db():
Base.metadata.create_all(bind=engine)
if __name__ == "__main__":
print("Creating tables...")
init_db()
print("DONE :)")Uncomment all and run the create_tables script as shown above in the root of the project directory.
python create_tables.pyAt the end of this (with the exception of the .env file and env/ directories) your project should look like this: project-structure
fastapi dev app.py├── api
│ ├── appointment.py
│ ├── auth.py
│ ├── __init__.py
│ ├── result.py
│ └── test.py
├── app.py
├── config
│ ├── db.py
│ ├── __init__.py
│ └── settings.py
├── create_tables.py
├── Dockerfile
├── middlewares
│ └── auth.py
├── models
│ ├── appointment.py
│ ├── association.py
│ ├── base.py
│ ├── __init__.py
│ ├── result.py
│ ├── test.py
│ └── user.py
├── README.md
├── requirements.txt
├── schemas
│ ├── appointment.py
│ ├── __init__.py
│ ├── test.py
│ └── user.py
├── scripts
│ └── create_env.sh
└── utils
├── auth_helpers.py
├── __init__.py
└── user_roles.py
8 directories, 29 files