A Complete Backend Evaluation Project Covering All Syllabus Topics
This project implements ALL topics from your backend course syllabus:
- Understanding request-response cycle
- Client-side (HTML/JS) and Server-side (Node.js) implementation
- HTTP communication basics
- Node.js installation and setup
- File system operations (
fsmodule) - File dependency management
- JSON file-based storage
- Advantages: JavaScript everywhere, non-blocking I/O, NPM ecosystem
- Disadvantages: CPU-intensive tasks, callback management
- Real-world application examples
- Native HTTP module server (
basic-http-server.js) - Creating endpoints without frameworks
- Request handling and body parsing
- Module imports and NPM usage
- Express.js setup and configuration
- Middleware implementation
- Simplified routing
- Framework advantages
- All HTTP methods (GET, POST, PUT, DELETE, PATCH)
- Route parameters and query strings
- Static file serving
- File streaming implementation
- Global exception handling
A full-stack disaster management platform demonstrating practical backend concepts through a real-world crisis response system.
Key Features:
- 📝 Submit disaster reports
- 🎯 Predict high-risk zones
- 🚨 Generate emergency alerts
- 🆘 Suggest resource allocation
- 🎮 Run disaster simulations
- Node.js v18 or higher
- npm (comes with Node.js)
# Install dependencies
npm install
# Start Express server (Port 3000)
npm start
# OR start HTTP module server (Port 4000)
npm run start:http- Frontend: http://localhost:3000
- API: http://localhost:3000/api/health
- HTTP Server: http://localhost:4000
Crisis/
├── 📄 server.js # Express Framework Server (Lectures 17-24)
├── 📄 basic-http-server.js # HTTP Module Server (Lectures 13-16)
├── 📄 package.json # NPM Configuration
│
├── 📁 data/
│ └── reports.json # File-based Database (Lectures 5-8)
│
├── 📁 public/ # Static Files (Lectures 21-24)
│ ├── index.html # Frontend Interface
│ ├── app.js # Client JavaScript
│ ├── style.css # Modern UI Styling
│ └── report-guide.html # Documentation Page
│
├── 📁 src/modules/ # Custom Modules (Lectures 13-16)
│ ├── dataStore.js # CRUD Operations & File Handling
│ ├── riskEngine.js # Risk Prediction Logic
│ ├── alertEngine.js # Alert Generation
│ └── logger.js # Request Logging Middleware
│
└── 📁 Documentation/
├── BACKEND_GUIDE.md # Complete Technical Documentation
├── BACKEND_GUIDE_HINGLISH.md # Hinglish Explanation
└── API_TESTING_GUIDE.md # API Testing Reference
GET /api/health # Server health checkGET /api/disasters # Get all reports
GET /api/disasters/:id # Get single report
POST /api/reports # Create new report
PUT /api/reports/:id # Update entire report
PATCH /api/reports/:id # Partial update
DELETE /api/reports/:id # Delete reportGET /api/risk-zones # Predict high-risk zones
POST /api/alerts/test # Generate alert
POST /api/resources/suggest # Resource allocation
POST /api/simulate # Run emergency drillGET /report-guide # Stream HTML file👉 Full API documentation: See API_TESTING_GUIDE.md
Complete technical documentation covering:
- All syllabus topics explained
- Code examples with explanations
- Module structure breakdown
- Interview Q&A
Easy-to-understand explanation in Hinglish:
- Har topic ka simple explanation
- Code examples with Hindi comments
- Testing guide
- Exam preparation tips
Comprehensive API testing reference:
- All endpoints with examples
- Postman/Thunder Client usage
- cURL commands
- PowerShell testing
- Error handling examples
http://localhost:3000/api/health
http://localhost:3000/api/disasters
Create Report:
POST http://localhost:3000/api/reports
Content-Type: application/json
{
"zone": "Coastal-East",
"severity": "high",
"issueType": "flood",
"population": 5000,
"notes": "Rising water levels"
}Update Report:
PUT http://localhost:3000/api/reports/1234567890
Content-Type: application/json
{
"zone": "Updated Zone",
"severity": "critical",
"issueType": "flood",
"population": 8000
}Delete Report:
DELETE http://localhost:3000/api/reports/1234567890# Health check
curl http://localhost:3000/api/health
# Create report
curl -X POST http://localhost:3000/api/reports \
-H "Content-Type: application/json" \
-d '{"zone":"Test","severity":"high","issueType":"flood","population":2000}'// Export
module.exports = { functionName };
// Import
const { functionName } = require("./module");// Read JSON file
const data = await fs.readFile(path, "utf-8");
const object = JSON.parse(data);
// Write JSON file
await fs.writeFile(path, JSON.stringify(object, null, 2));// Logger middleware
app.use((req, res, next) => {
console.log(`${req.method} ${req.url}`);
next();
});app.get("/api/data", handler); // Read
app.post("/api/data", handler); // Create
app.put("/api/data/:id", handler); // Update
app.delete("/api/data/:id", handler); // Deleteconst stream = fs.createReadStream(filePath);
stream.pipe(res); // Efficient file transfer// Try-catch in routes
try {
const data = await getData();
res.json(data);
} catch (error) {
next(error); // Pass to error handler
}
// Global error handler
app.use((err, req, res, next) => {
res.status(500).json({ error: err.message });
});Read BACKEND_GUIDE_HINGLISH.md for easy explanation of each topic
basic-http-server.js→ HTTP module conceptsserver.js→ Express frameworksrc/modules/dataStore.js→ File handling
Use API_TESTING_GUIDE.md to test all endpoints
Be able to explain:
User submits form →
POST request →
Express route →
Middleware →
Controller function →
Data saved to JSON →
Response sent back
- Client-Server Architecture
- File handling in Node.js
- Module system (require/exports)
- HTTP module vs Express
- Middleware concept
- Routing methods (GET/POST/PUT/DELETE/PATCH)
- Route parameters vs Query parameters
- File streaming
- Exception handling
- Async/await in Node.js
Detailed answers: See BACKEND_GUIDE.md
- ✅ Native HTTP server (no framework)
- ✅ Express framework server
- ✅ File-based CRUD operations
- ✅ All HTTP methods (GET, POST, PUT, PATCH, DELETE)
- ✅ Route parameters and query strings
- ✅ Static file serving
- ✅ File streaming
- ✅ Custom middleware
- ✅ Global error handling
- ✅ Request logging
- ✅ Modern UI with animations
- ✅ Complete API documentation
| Code | Meaning | When Used |
|---|---|---|
| 200 | OK | Successful GET, PUT, DELETE |
| 201 | Created | Successful POST |
| 400 | Bad Request | Missing required fields |
| 404 | Not Found | Resource not found |
| 500 | Server Error | Internal error |
- Runtime: Node.js v18+
- Framework: Express.js v5.2
- Storage: File-based JSON
- Frontend: Vanilla JavaScript
- Styling: Modern CSS with animations
npm start # Start Express server (port 3000)
npm run start:http # Start HTTP module server (port 4000)This is an educational project for backend evaluation. Feel free to:
- Add more features
- Improve documentation
- Add test cases
- Enhance UI/UX
If you have questions about any concept:
- Check
BACKEND_GUIDE.mdfor technical details - Check
BACKEND_GUIDE_HINGLISH.mdfor easy explanation - Check
API_TESTING_GUIDE.mdfor testing help - Look at code comments in each file
Built for backend course evaluation demonstrating:
- Professional code structure
- Industry best practices
- Complete syllabus coverage
- Real-world application design
Educational Use Only
Made with ❤️ for Backend Students
Star ⭐ this repo if it helped you understand backend concepts!