A robust, production-ready REST API built with FastAPI, containerized with Docker, and deployed on Render Cloud.
- Framework: FastAPI
- Database: PostgreSQL (SQLAlchemy ORM)
- Validation: Pydantic
- Security: Bcrypt (Password Hashing)
- Deployment: Docker & Render
main.py: Application entry point and routes.models.py: Database tables (User, Task).schemas.py: Pydantic models for data validation.database.py: Database connection logic (Cloud + Local support).
POST /users/- Create a new account.GET /users/- View all users.DELETE /users/{id}- Delete a user.
POST /tasks/- Create a task.GET /tasks/- View my tasks.DELETE /tasks/{id}- Delete a task.
- Clone the repo.
- Run:
docker-compose up --build
- Open browser at http://localhost:8000/docs.
- Create a virtual environment and install dependencies:
pip install -r requirements.txt
- Set up your local PostgreSQL database (learning_db).
- Create a .env file with your DB credentials.
- Run:
uvicorn main:app --reload