https://github.com/kreipikc/fastapi-book-async
A simple API with 19 endpoints written in FastAPI (works asynchronously), using PostgreSQL, Redis, SMTP, Docker, JWT
https://github.com/kreipikc/fastapi-book-async
alembic api async docker fastapi jwt-auth postgresql pydantic python redis smtp sqlalchemy-orm
Last synced: about 2 months ago
JSON representation
A simple API with 19 endpoints written in FastAPI (works asynchronously), using PostgreSQL, Redis, SMTP, Docker, JWT
- Host: GitHub
- URL: https://github.com/kreipikc/fastapi-book-async
- Owner: kreipikc
- Created: 2024-11-28T16:06:07.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-02-12T20:29:44.000Z (3 months ago)
- Last Synced: 2025-02-12T21:31:25.597Z (3 months ago)
- Topics: alembic, api, async, docker, fastapi, jwt-auth, postgresql, pydantic, python, redis, smtp, sqlalchemy-orm
- Language: Python
- Homepage:
- Size: 95.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## What kind of project is this?
This is an API with 19 endpoints. Realistic AAA (Authentication Authorization and Accounting) server.## What technologies have I used?
- Python
- FastAPI
- SQLAlchemy
- Pydantic
- Alembic
- JWT
- PostgreSQL
- Redis
- SMTP
- Docker## Why did I even start creating this project?
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.## How usage?
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
## How usage Docker?
1. Download git and docker to your server
2. Clone the entire project from the github - `git clone `
3. Create a ".env" file in the root directory and copy everything from "example.env.txt " and adjust the parameters as needed
4. Then use docker-compose to run the project - `docker-compose up`