Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gitkodev/fastapi-notes-service

Notes microservice REST API created with Python and FastAPI
https://github.com/gitkodev/fastapi-notes-service

fastapi fastapi-template python repository-pattern

Last synced: 19 days ago
JSON representation

Notes microservice REST API created with Python and FastAPI

Awesome Lists containing this project

README

        

# FastAPI Notes Microservice
Python + `FastAPI` asynchronous REST API. Authentication is implemented using JWT. Each user can add, modify and access their own notes ONLY using a valid JSON Web Token

## Tools used

- `Database`   **=>**   Postgres + [asyncpg](https://github.com/MagicStack/asyncpg)
- `Database migrations`   **=>**   [Alembic](https://github.com/sqlalchemy/alembic)
- `Data validation`   **=>**   [Pydantic](https://github.com/pydantic/pydantic)
- `ORM`   **=>**   [SQLAlchemy](https://github.com/sqlalchemy/sqlalchemy)
- `Authentication and authorization`   **=>**   [Python Jose](https://github.com/mpdavis/python-jose)

## Startup

Run `make run` or `docker compose up --build `in root folder to apply all necessary migrations and start the project.

## Endpoints

### *Swagger documentation with request/response body examples available at `http://127.0.0.1:8000/docs` after project startup*
### Authorization
- ```0.0.0.0:8080/auth ```   `=>`   **POST**   `=>`   Create new user
- ```0.0.0.0:8080/auth/token```   `=>`   **POST**   `=>`   Log in to get access token

### API
- ```0.0.0.0:8080/api/v1```   `=>`   **POST**   `=>`   Add note to user
- ```0.0.0.0:8080/api/v1```   `=>`   **GET**   `=>`   Get all notes for user
- ```0.0.0.0:8080/api/v1/{note_id}```   `=>`   **GET**   `=>`   Get user's note by note id
- ```0.0.0.0:8080/api/v1/{note_id}```   `=>`   **PUT**   `=>`   Update user's note by node id
- ```0.0.0.0:8080/api/v1/{note_id}```   `=>`   **DELETE**   `=>`   Delete user's note by note id