A RESTful Student Management API built with FastAPI, PostgreSQL, and SQLAlchemy. This project demonstrates CRUD (Create, Read, Update, Delete) operations and serves as a beginner-friendly backend application.
- ✅ Create a new student
- ✅ Get all students
- ✅ Get a student by ID
- ✅ Update student information
- ✅ Delete a student
- ✅ PostgreSQL database integration
- ✅ SQLAlchemy ORM
- ✅ Pydantic data validation
- ✅ Interactive Swagger UI documentation
- ✅ RESTful API design
- Python 3.x
- FastAPI
- PostgreSQL
- SQLAlchemy
- Pydantic
- Uvicorn
- Postman (API Testing)
FastAPI-Student-Management/
│
├── app/
│ ├── main.py
│ ├── database.py
│ ├── models.py
│ ├── schemas.py
│ ├── crud.py
│ └── config.py
│
├── .gitignore
├── requirements.txt
├── README.md
└── image.png
| Method | Endpoint | Description |
|---|---|---|
| POST | /students |
Create a new student |
| GET | /students |
Retrieve all students |
| GET | /students/{id} |
Retrieve a student by ID |
| PUT | /students/{id} |
Update student information |
| DELETE | /students/{id} |
Delete a student |
git clone https://github.com/Abdulwasaytahir/FastAPI-Student-Management.gitcd FastAPI-Student-Managementpython -m venv venvWindows
venv\Scripts\activateLinux/macOS
source venv/bin/activatepip install -r requirements.txtUpdate your database connection in app/config.py or app/database.py.
Example:
DATABASE_URL = "postgresql://username:password@localhost/student_db"uvicorn app.main:app --reloadAfter running the project:
Swagger UI
http://127.0.0.1:8000/docs
ReDoc
http://127.0.0.1:8000/redoc
Add your Swagger UI screenshot below.
During this project, I learned:
- Building REST APIs with FastAPI
- Working with PostgreSQL databases
- Using SQLAlchemy ORM
- Request validation using Pydantic
- Testing APIs with Swagger UI and Postman
- Implementing CRUD operations
- Organizing a FastAPI project
- JWT Authentication
- User Registration & Login
- Search Functionality
- Pagination
- Filtering & Sorting
- Docker Support
- Unit Testing
- Deployment
Abdul Wasay Tahir
BS Computer Science Student
- GitHub: https://github.com/Abdulwasaytahir
- LinkedIn: https://linkedin.com/in/Abdul Wasay Tahir
If you found this project helpful, consider giving it a ⭐ on GitHub.
