Welcome to the National Highway Management System (NHMS)! This project provides a robust, real-time web application to assist highway travelers and streamline highway administrative tasks. It's built with modern web development practices to ensure a fast, secure, and beautiful user experience.
NHMS is designed to enhance safety and convenience on national highways. Whether you are a traveler looking for the best route, or an administrator monitoring highway systems, NHMS has you covered. The project features a beautifully designed UI, interactive maps, and a complete secure backend architecture.
- 🗺️ Smart Route Planner: Interactively select your source and destination, and preview routes on a map. Powered by
leaflet. - ⏱️ Speed Monitor: Track and maintain optimal driving speeds.
- 🚨 Emergency Services: Quick access to SOS reporting and immediate emergency assistance dispatch.
- 📱 Traveler Dashboard: A personalized space for users to manage profiles, vehicles, and history.
- 🛡️ Admin Panel: Comprehensive oversight dashboard for system administrators.
- 🔐 Secure Authentication: JWT-based login and registration with Bcrypt password hashing and OTP-based email verification.
Frontend 🎨
- Framework: React 18 powered by Vite
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: shadcn/ui & Radix UI primitives
- Icons: Lucide React
- Maps: Leaflet & React-Leaflet
- State Management & Data Fetching: TanStack React Query
Backend ⚙️
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB (with Mongoose ORM)
- Security: JSON Web Tokens (JWT), Bcrypt
NHMS/
├── backend/ # Node.js + Express backend server
│ ├── models/ # Mongoose schemas (User, Report, etc.)
│ ├── routes/ # API route definitions
│ ├── server.ts # Main server entrypoint
│ └── package.json # Backend dependencies
├── src/ # React frontend application
│ ├── components/ # Reusable UI components (shadcn/ui)
│ ├── contexts/ # React Context (AuthContext)
│ ├── pages/ # Application pages (Dashboard, Admin, RoutePlanner, etc.)
│ ├── App.tsx # Main React component and Router setup
│ └── index.css # Global styles and Tailwind directives
├── public/ # Static assets
└── package.json # Frontend dependencies and scripts
Follow these instructions to set up the project locally on your machine.
- Node.js (v18 or higher)
- npm (v9 or higher)
- MongoDB: A running MongoDB instance (Local or MongoDB Atlas)
git clone <repository-url>
cd NHMSOpen a terminal and navigate to the backend directory:
cd backend
npm installCreate a .env file in the backend/ directory with the following variables:
PORT=3000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_super_secret_jwt_key
EMAIL_USER=your_smtp_email
EMAIL_PASS=your_smtp_passwordStart the backend server:
npm start
# The backend will run on http://localhost:3000Open a new terminal window and navigate to the root directory:
npm installStart the Vite development server:
npm run dev
# The frontend will run on http://localhost:8080Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.