A student management system using Node.js+express+mysql for backend and
A full-stack student management application built with Node.js, Express, MySQL, and React.
TSA/
├── backend/ # Node.js + Express API
│ ├── config/ # Database configuration
│ ├── controllers/ # Route controllers
│ ├── database/ # SQL schema
│ ├── routes/ # API routes
│ ├── server.js # Entry point
│ └── package.json
│
├── frontend/ # React Application
│ ├── public/ # Static files
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API service
│ │ ├── App.js # Main component
│ │ └── index.js # Entry point
│ └── package.json
│
└── README.md
# Login to MySQL
mysql -u root -p
# Run the schema (creates database and table)
source /path/to/TSA/backend/database/schema.sql
Or manually run:
CREATE DATABASE IF NOT EXISTS student_management;
USE student_management;
CREATE TABLE IF NOT EXISTS students (
id INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL UNIQUE,
age INT,
course VARCHAR(100),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
cd backend
# Install dependencies
npm install
# Update .env file with your MySQL credentials
# Edit .env and set DB_PASSWORD to your MySQL password
# Start the server
npm run dev
Backend runs on: http://localhost:5000
cd frontend
# Install dependencies
npm install
# Start React app
npm start
Frontend runs on: http://localhost:3000
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/students |
Get all students |
| GET | /api/students/:id |
Get single student |
| POST | /api/students |
Create new student |
| PUT | /api/students/:id |
Update student |
| DELETE | /api/students/:id |
Delete student |
Once running, the application provides:
Tanzanite Skills Academy - Full-Stack JavaScript Developer Task