A RESTful API using FastAPI, SqlAlchemy, Postgresql, Redis, Pytest, etc.
NOTE: project is developing and explanations is not completed yet. the README will be completed more and more along with adding new features!
- Asynchronous routing and crud operations (check at: routes/ - crud/ - services/)
- Authentication (JWT), Authorization and different permission levels (check at: auth/ - services/authentication.py - `routes/ - routes/admin/)
- Revoking (blacklisting) used but unexpired tokens until they expire (using Redis) (check at: auth/token_revocation.py - services/authentication.py)
- Custom exceptions and custom exception handling (check at: core/exception.py - utils/exception_handler.py - main.py)
- ...
- etc... (just explore project's source code and discover other features!)
├── docs
├── src
│ ├── auth/ # JWT Authentication Logic (+ TokenRevocation)
│ │
│ ├── core/ # Configurations and Core Utils (db & redis setup,
│ │ # settings, custom-exception, middlewares, etc.)
│ │
│ ├── crud/ # Database Raw CRUD Logic (NO business logic)
│ ├── migrations/ # Database Table's Migrations (managed by alembic)
│ ├── models/ # SQLAlchemy Models (User, Post, Tag, Comment, etc.)
│ ├── routes/ # API Endpoints
│ ├── schemas/ # Pydantic Models for API Endpoints
│ ├── services/ # Layer Between CRUD & Routes (includes business logic)
│ ├── tests/
│ ├── utils/
│ │ ├── dependencies.py # Endpoint's Dependencies (db, redis, current-user & admin)
│ │ ├── exception_handler.py # Custom Handler for Custom Exceptions
│ │ └── utils.py # ...
│ │
│ └── main.py # FastAPI Entry Point
│
├── .env.example # ...
├── .gitignore
├── alembic.ini # ...
├── LICENSE
├── README.md
└── requirements.txt...
- ...
- ...
This project is licensed under the MIT License. See the LICENSE file for more details.
Developed by hamidgh01
