This full-stack website, utilizing the MVC approach, is built using MongoDB, Node.js, Express, HTML, and Bootstrap, with integrated email functionality through Nodemailer and Mailtrap. The platform allows customers to schedule services and request quotes through simple, user-friendly forms. The data submitted is securely stored in a database, and customers receive a confirmation email upon successful form submission. The system ensures an efficient and professional interaction, guiding users to a thank you page after completion.
- MongoDB
- Mongoose
- Express
- Node.js
- HTML
- Bootstrap
- Mailtrap
👉 Customer Database: Each service request is added to a database that is viewed by the company.
👉 Automated Emails: Integrates mailtrap and nodemailer to send schedule and quote confirmations.
Follow these steps to set up the project locally on your machine.
Prerequisites
The following will need to be installed:
Cloning the Repository
git clone https://github.com/AvionShea/HVAC.git
cd HVAC
Installation
Install the project dependencies using npm:
npm i dotenv express mailtrap mongoose nodemailer
Set Up Environment Variables
Create a new file named .env
in the root of your project and add the following content:
DB_CONNECTION =
MAIL_TOKEN =
Running the Project
npm start
Terminate running Project (batch job)
Ctrl C
Navigate to http://localhost:PORT_NUMBER/
Server File
const express = require("express");
const mongoose = require("mongoose");
const dotenv = require("dotenv");
const apiRoutes = require("./routes/router");
dotenv.config();
const app = express();
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
app.use(express.static("views"));
app.use("/api", apiRoutes);
mongoose
.connect(process.env.DB_CONNECTION)
.then(() => console.log("MongoDB connected successfully!"))
.catch((err) => console.log(err));
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => console.log(`Server running on port ${PORT}...`));
- LinkedIn - @avion-cobb
- Twitter - @Blvck_Lotus003