This is the Hostel Management project (warden & student interfaces). It includes a Node.js/Express backend and a static frontend (plus a React frontend under hostel-frontend/).
server.js- Node/Express server and API endpoints.public/- static HTML pages used by the app (warden pages, student pages, etc.).hostel-frontend/- React frontend (Vite) for an alternate UI.package.json- root npm scripts & server dependencies.
- Node.js (14+ recommended)
- npm (or yarn)
- MySQL server (or compatible) and credentials
- Install dependencies (root and frontend):
npm install
cd hostel-frontend
npm install
cd ..- Create an environment file for DB credentials and any secrets. Do NOT commit this file.
Create a .env file in the project root with values like:
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your-db-password
DB_NAME=hostel_db
PORT=3000
- Start the server (from project root):
# run server
node server.js
# or if you use npm script
npm start- Open the static pages in the browser (server serves them):
For the React frontend (if used):
cd hostel-frontend
npm run dev
# then open the Vite URL printed in console- The server expects a MySQL database. Ensure the DB and required tables are created. Check
server.jsfor SQL table names and sample queries. - If you need, I can help generate SQL
CREATE TABLEscripts based onserver.jsqueries.