Skip to content

About

πŸ“ Blazing-fast async CRUD API ⚑ FastAPI + SQLAlchemy 2.0 | Live Swagger docs πŸš€ Deployed on Render ☁️

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


🌍 About

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


πŸš€ Live Demo

Try Live

⏳ Hosted on Render's free tier β€” the first request after inactivity can take 30–60 seconds to wake the server.


πŸ”Œ API Endpoints

# 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.

Example

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"
}

🧠 Architecture

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 β€” NoteIn for input, NoteOut for output (adds id, created_at)

πŸ“ Project Structure

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

πŸ› οΈ Tech Stack

Tool Purpose
FastAPI Web framework
SQLAlchemy Async ORM
SQLite Database
Pydantic Data validation
Uvicorn ASGI server
Render Deployment
Python Language
Git Version control

⚑ Run Locally

# 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 --reload

Open http://127.0.0.1:8000/docs for the interactive Swagger UI.


🌟 Key Features

  • ⚑ 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

πŸ—ΊοΈ Roadmap

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.


πŸ“œ License

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


πŸ‘¨β€πŸ’» Developer

Abdullah Javid AI Developer Β· ML Engineer Β· Backend Builder

GitHub Email LinkedIn HuggingFace


⭐ Star this repo if you found it useful!

πŸ“ Notes API | Built by Abdullah Javid | FastAPI + Async SQLAlchemy

About

πŸ“ Blazing-fast async CRUD API ⚑ FastAPI + SQLAlchemy 2.0 | Live Swagger docs πŸš€ Deployed on Render ☁️

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages