This is a Backend CRUD REST API for managing student records. It demonstrates real-world backend fundamentals including routing, validation, database integration, and clean architecture.
The API allows clients to:
- Create students
- Retrieve students
- Update student details
- Delete students
- Python
- Flask
- MySQL
- Postman (for API testing)
student-management-system/
│
├── app.py # Application entry point
├── db.py # MySQL database connection
├── models/
│ └── student.py # Database operations (CRUD)
├── routes/
│ └── student_routes.py # API routes and validation
├── requirements.txt
├── README.md
└── screenshots/ # API testing screenshots (Postman)
git clone https://github.com/iamajaykr06/Student-Management-System-API.git
cd Student-Management-System-API
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
Run the SQL script provided in schema.sql to create the database and tables.
CREATE DATABASE student_db;
CREATE TABLE students (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
department VARCHAR(100) NOT NULL,
course VARCHAR(100) NOT NULL,
academic_session VARCHAR(50) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Edit db.py with your MySQL username and password.
python app.py
Server runs at:
http://127.0.0.1:5000
POST /students
Request Body (JSON):
{
"name": "Rahul",
"department": "CS",
"course": "B.Tech",
"academic_session": "2024-2028"
}
Response:
201 created400 Bad Request(Validation error)
GET /students
Response:
{
"data": []
}
GET /students/{id}
Responses:
200 OK404 Not Found
PUT /students/{id}
Request Body (JSON):
{
"name": "Rahul Kumar",
"department": "CS",
"course": "B.Tech",
"academic_session": "2024-2028"
}
Responses:
200 OK400 Bad Request404 Not Found
DELETE /students/{id}
Responses:
200 OK404 Not Found
- RESTful CRUD operations
- Input validation
- MySQL database integration
- Proper HTTP status codes
- Clean separation of concerns (routes, models, DB)
Screenshots of API testing using Postman are available in the screenshots/ folder.
- Pagination
- Authentication (Admin login)
- Logging
- Unit testing
This project demonstrates:
- Backend API design
- Flask Blueprints
- Database CRUD using MySQL
- Error handling and validation
- Professional project structure
Ajay Kumar