Simple full stack project for backend + frontend evaluation.
npm install
npm startOpen http://localhost:3000
npm run start:httpOpen http://localhost:4000/api/info
- Public report submission (
POST /api/reports) - Fetch reports (
GET /api/disasters,GET /api/disasters/:id) - Risk prediction scoring (
GET /api/risk-zones) - Real-time alert demo (
POST /api/alerts/test) - Auto resource suggestion (
POST /api/resources/suggest) - Emergency simulation mode (
POST /api/simulate)
- Node.js setup and modules (
require, local modules) - File handling and dependencies (
fs/promises, JSON store) - HTTP module endpoint demo (
basic-http-server.js) - Express framework usage (
server.js) - Routing methods and route parameters (
GET,POST,:id) - Route handlers and response methods (
res.json,res.status) - Static files serving (
public/withexpress.static) - Static page with file stream (
GET /report-guide) - Exception handling (404 middleware + global error handler)
| Syllabus Topic | Project Implementation | Kaha Use Ho Raha Hai (Demo) |
|---|---|---|
| Node.js + setup + modules | server.js, src/modules/*.js with require(...) |
Backend startup npm start; modules split karke clean structure dikhaya gaya |
| File handling + dependencies | src/modules/dataStore.js uses fs/promises; data in data/reports.json |
POST /api/reports new report save karta hai; GET /api/disasters file se read karta hai |
| HTTP module basics | basic-http-server.js with http.createServer(...) |
npm run start:http and open http://localhost:4000/api/info |
| Express framework | server.js with const app = express() |
Main backend APIs Express se run ho rahi hain |
| Routing methods | GET + POST routes in server.js |
Frontend buttons/forms in public/app.js inhi routes ko call karte hain |
| Route parameters | GET /api/disasters/:id |
Specific report by id fetch karne ka demo endpoint |
| Route handlers + response methods | res.json(...), res.status(...) in server.js |
Har API response JSON me return hota hai, 201/400/404/500 statuses ke saath |
| Static files | app.use(express.static("public")) in server.js |
Browser par http://localhost:3000 open karte hi public/index.html load hoti hai |
| Static page with file stream | GET /report-guide + fs.createReadStream(...) |
Frontend header me "Open Streamed Static Guide" link se dikhaya ja sakta hai |
| Exception handling | 404 middleware + global error middleware in server.js |
Wrong route par 404; internal issue par 500 JSON response |
public/app.js->loadReports()callsGET /api/disastersand table render karta hai.public/app.js-> form submit callsPOST /api/reportsand new report store ho jata hai.public/app.js->loadRiskPrediction()callsGET /api/risk-zones.public/app.js->generateAlert()callsPOST /api/alerts/test.public/app.js->loadResourcePlan()callsPOST /api/resources/suggest.public/app.js->runSimulation()callsPOST /api/simulate.
- "Backend Node.js + Express me hai, routes
server.jsme defined hain." - "Data DB me nahi, file store me hai (
data/reports.json) throughdataStore.js." - "Form se report submit hoti hai via
POST /api/reports, aur listGET /api/disastersse aati hai." - "Prediction, alert, resource suggestion, simulation ke separate APIs banaye hain."
- "Syllabus cover karne ke liye native HTTP module demo
basic-http-server.jsbhi add kiya hai." - "Static files + stream page + exception middleware sab implemented hai."
- Single-page dashboard in plain HTML/CSS/JS
- API integration using
fetch - Mobile-friendly layout