Loading repository data…
Loading repository data…
enesduru96 / repository
High-performance Async Note Taking API template featuring Encryption at Rest, Redis Caching, and Advanced JWT Security.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
High-performance REST API for secure note-taking and social sharing, built with FastAPI, PostgreSQL, Redis, and Docker.
The project implements JWT Authentication (Access + Refresh Token Rotation), Argon2 password hashing, Encryption at Rest, Async Architecture, and Redis Caching for scalability.
docker-compose.This project uses a Hybrid Encryption Strategy to balance security and performance:
Public Notes - stored as-is to allow Full-Text Search and high-performance indexing.
Private Notes - Both Title and Content are encrypted with Fernet before saving. Only the owner can decrypt and read them.
Passwords - Hashed (Argon2)
Follow these steps to run the project from scratch.
git clone https://github.com/YOUR_USERNAME/fastapi-docker-secure-note.git
cd fastapi-docker-secure-note
For security reasons, secrets are not stored in the repository. You need to create a .env file. You have two options:
Run the included Python script to generate a secure .env file with cryptographically strong keys:
python generate_env.py
Create a file named .env in the root directory and paste the content below. (Note: You must generate your own secure values for SECRET_KEY and ENCRYPTION_KEY).
POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
POSTGRES_DB=securenote_db
REDIS_HOST=redis
REDIS_PORT=6379
# Replace these with strong, random keys!
SECRET_KEY=change_this_to_a_very_long_random_secret_string
ENCRYPTION_KEY=change_this_to_a_valid_fernet_key
Build and start the services in detached mode:
docker-compose up -d --build
docker-compose exec web alembic upgrade head
You can use the included Python script to test the API interactively:
# Install requests if not already installed: pip install requests
python client_test_app.py
The client saves your login tokens to a local session.json file, so you don't have to login every time.
docker-compose exec web alembic revision --autogenerate -m "description_of_changes"
docker-compose exec web alembic upgrade head
If you want to wipe everything (including data) and start fresh:
docker-compose down -vdocker-compose up -d --builddocker-compose exec web alembic revision --autogenerate -m "initial"docker-compose exec web alembic upgrade head
├── alembic/ # Database migration scripts
├── app/
│ ├── routers/ # API Endpoints (Auth, Notes)
│ ├── models.py # Database Models (User, Note, Token)
│ ├── crud.py # Database Operations (Create, Read...)
│ ├── auth.py # JWT, Hashing, and Security Logic
│ ├── redis_client.py # Redis Connection Manager
│ ├── config.py # Settings Management (.env reading)
│ └── main.py # Application Entry Point
├── client_test_app.py # Terminal Testing Client
├── docker-compose.yml # Docker Services Configuration
└── Dockerfile # Python Environment Definition
This project is actively being developed. Here are the planned features for upcoming releases: