A REST API for managing chapter members built with Node.js and Express.
- Add, view, update, and delete chapter members
- Track member info: name, email, major, role, and points
- Data persists to a local JSON file between server restarts
- Input validation with proper HTTP error codes
- Node.js — runtime
- Express — web framework
- JSON file storage — no database, pure file persistence
- crypto.randomUUID() — built-in unique ID generation
npm install
node server.jsServer runs on http://localhost:3000
| Method | Route | Description |
|---|---|---|
| GET | /health |
Check server is running |
| GET | /members |
Get all members |
| POST | /members |
Add a new member |
| GET | /members/:id |
Get one member by ID |
| PUT | /members/:id |
Update a member |
| DELETE | /members/:id |
Remove a member |
{
"id": "auto-generated UUID",
"name": "Caleb Mpungu",
"email": "caleb@test.com",
"major": "Computer Science",
"role": "President",
"points": 0
}Add a member
POST /members
Content-Type: application/json
{
"name": "Caleb Mpungu",
"email": "caleb@test.com",
"major": "Computer Science",
"role": "President"
}Update points
PUT /members/:id
Content-Type: application/json
{
"points": 50
}Project1API/
server.js # entry point, Express setup
router.js # all 5 routes
store.js # reads/writes members.json
validate.js # input validation
members.json # data file
README.md # this file
- REST API design — structuring routes around resources, not actions
- Express.js — routing, middleware, req/res cycle
- Data modeling — designing a member object before writing any code
- CRUD operations — the backbone of every backend system
- Input validation — handling missing/bad data with proper HTTP status codes (400, 404)
- File persistence — reading and writing JSON with Node's
fsmodule - Project organization — splitting logic across multiple files (router, store, validate)
- HTTP status codes — 200, 201, 400, 404 and when to use each
- UUID generation — using
crypto.randomUUID()for unique IDs without a database
Saidi "Caleb" Mpungu — CS Student, University of Kentucky