Notes API is a fully asynchronous REST backend that lets users create, read, update and delete notes. Built with FastAPI and async SQLAlchemy 2.0, it ships with automatic interactive documentation (Swagger UI) and is deployed live on Render.
This is Day 1 of my daily AI-engineering project challenge β the foundation that later days (PostgreSQL, JWT auth, RAG) build on.
β¨ Built by Abdullah Javid | AI Developer & Backend Builder
β³ Hosted on Render's free tier β the first request after inactivity can take 30β60 seconds to wake the server.
| # | Method | Path | Description | Success Code |
|---|---|---|---|---|
| 1 | GET |
/ |
Health check | 200 |
| 2 | POST |
/notes |
Create a note | 201 |
| 3 | GET |
/notes |
List all notes (newest first) | 200 |
| 4 | GET |
/notes/{id} |
Get a single note | 200 |
| 5 | PUT |
/notes/{id} |
Update a note | 200 |
| 6 | DELETE |
/notes/{id} |
Delete a note | 204 |
Missing notes return 404 {"detail": "Note not found"}; invalid bodies return 422.
curl -X POST https://fastapi-notes-api-6rpc.onrender.com/notes \
-H "Content-Type: application/json" \
-d '{"title": "My first note", "content": "FastAPI is working!"}'{
"title": "My first note",
"content": "FastAPI is working!",
"id": 1,
"created_at": "2026-11-15T06:45:09.826520"
}Client (Swagger UI / curl / frontend)
β
FastAPI Router (async endpoints)
β
Pydantic v2 (request / response validation)
β
Dependency Injection β AsyncSession
β
SQLAlchemy 2.0 (async ORM)
β
aiosqlite β SQLite (notes.db)
Key design choices:
- Fully async β endpoints, DB sessions and queries all use
async/await - Dependency injection β
get_db()yields one session per request - Lifespan handler β tables are created automatically at startup
- Schema separation β
NoteInfor input,NoteOutfor output (addsid,created_at)
fastapi-notes-api/
β
βββ main.py # FastAPI app, models, schemas, endpoints
βββ requirements.txt # Python dependencies
βββ .python-version # Python version for Render
βββ .gitignore # Ignores venv, notes.db, caches
βββ README.md # Project documentation
| Tool | Purpose |
|---|---|
| Web framework | |
| Async ORM | |
| Database | |
| Data validation | |
| ASGI server | |
| Deployment | |
| Language | |
| Version control |
# 1. Clone
git clone https://github.com/mabdullahab614-alt/fastapi-notes-api.git
cd fastapi-notes-api
# 2. Virtual environment
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS / Linux
# 3. Install & run
pip install -r requirements.txt
uvicorn main:app --reloadOpen http://127.0.0.1:8000/docs for the interactive Swagger UI.
- β‘ Async end-to-end β non-blocking database access
- π Auto-generated docs β Swagger UI at
/docs - β Input validation β Pydantic v2 with clear 422 errors
- π§― Proper error handling β 404 for missing notes
- βοΈ Deployed live β free hosting on Render
- π§© Extensible base β ready for PostgreSQL and JWT auth
| Day | Upgrade | Status |
|---|---|---|
| 1 | Async CRUD API + deploy | β Done |
| 2 | PostgreSQL (Neon) + JWT authentication | π Next |
| 3 | Document Q&A with RAG | β³ Planned |
| 7 | Docker + GitHub Actions CI | β³ Planned |
β οΈ Note: Render's free tier has an ephemeral filesystem, so the SQLite file resets on restart. Day 2 moves to PostgreSQL to fix this.
All Rights Reserved Β© 2026 Abdullah Javid
This repository and its contents β including source code and documentation β are made publicly visible for portfolio and demonstration purposes only.
No part of this repository may be copied, modified, distributed, sublicensed, or used β in whole or in part, for personal, educational, or commercial purposes β without explicit prior written permission from the author.
Forking or cloning this repository does not grant any rights to use, reproduce, or redistribute its contents.
If you are interested in using any part of this project, please contact me directly for permission:
π§ Email: mabdullah.ab614@gmail.com π GitHub: github.com/mabdullahab614-alt πΌ LinkedIn: linkedin.com/in/abdullah-javid-b217a2384