A web application designed to facilitate client and driver interactions for booking and updating truck transportation services. Built with Node.js, Express, and MongoDB, the app provides features for user registration, login, and managing transportation details.
- Client and Driver Registration: Users can register as clients or drivers.
- Login System: Secure login for clients and drivers.
- Truck Booking: Clients can search for and book available trucks based on criteria like capacity and route.
- Driver Management: Drivers can update their truck availability and other details.
- Dynamic Views: Rendering of various pages using EJS templates.
Follow these steps to set up the application:
- Clone the repository:
git clone https://github.com/purneshsv/StackTruck.git cd StackTruck
npm install
mongoose.connect("your-mongodb-connection-string", { useNewUrlParser: true, useUnifiedTopology: true, });
npm start
app.js: Main application file defining routes and logic.connect.js: MongoDB connection setup.db.js: Mongoose schemas for:client: Client registration and details.driver: Driver registration and details.display: Truck availability and route information.
views/: Contains EJS template files for rendering pages.public/: Static files like CSS and images.package.json: Manages project dependencies and metadata.
The project uses the following Node.js packages:
- Express: Web framework for Node.js.
- Mongoose: MongoDB object modeling tool.
- EJS: Template engine for rendering dynamic HTML.
- Body-Parser: Middleware to parse incoming request bodies.
- Nodemon: Automatically restarts the server during development.
- Register: Create a client account with details like name, email, and phone number.
- Login: Access your profile and manage bookings.
- Book Trucks: Search for trucks based on route and capacity and confirm bookings.
- Register: Create a driver account with details like license number, truck type, and insurance policy.
- Login: Update truck availability, routes, and capacity details.
/: Render the homepage./client: Render the client registration page./driver: Render the driver registration page./book: Render the booking page.
/client: Handle client registration./driver: Handle driver registration./booked: Confirm a booking./update: Update truck availability details.