This is an API with 19 endpoints. Realistic AAA (Authentication Authorization and Accounting) server.
- Python
- FastAPI
- SQLAlchemy
- Pydantic
- Alembic
- JWT
- PostgreSQL
- Redis
- SMTP
- Docker
This is a project created to study FastAPI. Also, with the help of this project, I studied (and am still studying): Docker, JWT token, AAA server.
For start project uvicorn app.main:app --reload
You can send requests for book:
- GET
/books/
- all info; - POST
/books/
- add new book; - GET
/books/id_book
- info about a specific book; - PUT
/books/id_book
- update info about a specific book; - DELETE
/books/id_book
- delete info about a specific book.
Requests for auth:
- POST
/auth/register
- user registrator; - POST
/auth/login
- login for user; - POST
/auth/refresh
- refresh access token; - POST
/auth/logout
- logout account; - GET
/auth/me
- information about you; - POST
/auth/forgot_password
- request a reset password procedure; - POST
/auth/reset_password
- reset a password by recovery code in email.
Requests for admin:
- GET
/admin/all_users
- information about all users; - PUT
/admin/update_user_role
- update role for user; - DELETE
/admin/delete_user
- delete user.
Requests for roles:
- GET
/roles/all_roles
- information about all roles; - POST
/roles/add_role
- add new role; - PUT
/roles/update_role
- update info about a specific role; - DELETE
/roles/delete_role
- delete info about a specific role.
You can also use /docs
to check the sending of requests, where all the endpoints will be
- Download git and docker to your server
- Clone the entire project from the github -
git clone <link>
- Create a ".env" file in the root directory and copy everything from "example.env.txt " and adjust the parameters as needed
- Then use docker-compose to run the project -
docker-compose up