A dynamic website built with Pug templates, powered by a Node.js (Express.js) backend. It features user authorization, email notifications, user roles, a review system, and a booking system with Stripe payment integration.
Requirements
Ensure you have the following installed and setup:
- Node.js
- MongoDB
- Mailtrap account for development email testing.
- Sendgrid account for production email services.
- Stripe account for handling payments.
-
Clone the following repository.
git clone https://github.com/grahil-24/TourWebsite_NodeExp.JS.git
-
Create a Configuration File Create a config.env file in the root directory and add the following environment variables:
NODE_ENV=development PORT=3000 DATABASE={mongodb connection string} DATABASE_LOCAL=mongodb://localhost:27017/database DATABASE_PASSWORD={database connection password} JWT_SECTET={Secret JWT private key} JWT_EXPIRES_IN=90d JWT_COOKIE_EXPIRES_IN=90 STRIPE_SECRET_KEY={Stripe secret key} STRIPE_WEBHOOK_SECRET={Stripe secret key for webhooks} EMAIL_USERNAME={Mailtrap username} EMAIL_PASSWORD={Mailtrap password} EMAIL_HOST=smtp.mailtrap.io EMAIL_PORT=25 EMAIL_FROM={Your email} SENDGRID_USERNAME=apikey SENDGRID_PASSWORD={Sendgrid password}
-
Install Dependencies
Open the project directory in your terminal and run:
npm install
-
Run the Development Server Start the development server with:
npm run dev
-
Build Frontend JavaScript Bundles
To compile the frontend JavaScript files, run one of the following commands:
npm run watch:js OR npm run build:js
-
Access the Application
Visit http://localhost:3000 in your web browser.