ochiengsydney's picture
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Executive Detailing Limited</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="https://cdn.tailwindcss.com"></script> </head> <body class="bg-gray-100 text-gray-800 font-sans"> <!-- Header --> <header class="bg-blue-700 text-white py-6 text-center"> <h1 class="text-3xl font-bold">Executive Detailing Limited</h1> <p class="text-sm">Mobile Vehicle Detailing | Mombasa, Kenya</p> </header> <!-- About --> <section class="py-10 px-4 text-center bg-white"> <h2 class="text-2xl font-bold mb-2">About Us</h2> <p>Founded in 2024 by Engineer Sydney Ochieng, we offer premium mobile vehicle detailing services across Mombasa.</p> </section> <!-- Services --> <section class="py-10 px-4"> <h2 class="text-2xl font-bold text-center mb-6">Our Services</h2> <div class="grid md:grid-cols-3 gap-6"> <div class="bg-white p-6 rounded shadow"> <h3 class="text-xl font-semibold mb-2">Exterior Detailing</h3> <p class="mb-2">Hand wash, waxing, and paint protection.</p> <p class="font-bold text-blue-600 mb-2">KES 5,000</p> </div> <div class="bg-white p-6 rounded shadow"> <h3 class="text-xl font-semibold mb-2">Interior Detailing</h3> <p class="mb-2">Deep cleaning of seats, carpets, dashboard.</p> <p class="font-bold text-blue-600 mb-2">KES 4,000</p> </div> <div class="bg-white p-6 rounded shadow"> <h3 class="text-xl font-semibold mb-2">Engine Bay Cleaning</h3> <p class="mb-2">Degreasing and dressing of engine area.</p> <p class="font-bold text-blue-600 mb-2">KES 3,000</p> </div> </div> </section> <!-- Booking --> <section class="py-10 px-4 bg-white" id="booking"> <h2 class="text-2xl font-bold text-center mb-6">Book a Service</h2> <form class="max-w-xl mx-auto space-y-4" method="POST" action="/api/book"> <input type="text" name="name" placeholder="Your Name" required class="w-full border p-3 rounded" /> <input type="email" name="email" placeholder="Your Email" required class="w-full border p-3 rounded" /> <input type="tel" name="phone" placeholder="Phone Number" required class="w-full border p-3 rounded" /> <label class="block font-semibold">Select Services:</label> <div class="space-y-2"> <label><input type="checkbox" name="services" value="Exterior Detailing" /> Exterior Detailing</label><br> <label><input type="checkbox" name="services" value="Interior Detailing" /> Interior Detailing</label><br> <label><input type="checkbox" name="services" value="Engine Bay Cleaning" /> Engine Bay Cleaning</label> </div> <textarea name="message" rows="4" placeholder="Additional notes (optional)" class="w-full border p-3 rounded"></textarea> <button type="submit" class="bg-blue-700 text-white py-3 px-6 rounded w-full hover:bg-blue-800">Submit Booking</button> </form> </section> <!-- Contact --> <footer class="bg-blue-700 text-white py-6 mt-10 text-center"> <p>Contact us: <a href="mailto:ecleaning40@gmail.com">ecleaning40@gmail.com</a> | +254 769 306 819</p> <p class="text-sm mt-2">Β© 2024 Executive Detailing Limited</p> </footer> </body> </html> executive-detailing/ β”œβ”€β”€ public/ β”‚ └── index.html β”œβ”€β”€ server.js β”œβ”€β”€ .env β”œβ”€β”€ package.json └── README.md // server.js const express = require("express"); const bodyParser = require("body-parser"); const nodemailer = require("nodemailer"); const cors = require("cors"); require("dotenv").config(); const app = express(); const PORT = process.env.PORT || 3000; app.use(cors()); app.use(express.static("public")); app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json()); app.post("/api/book", async (req, res) => { const { name, email, phone, services, message } = req.body; const serviceList = Array.isArray(services) ? services.join(", ") : services; // Send email try { const transporter = nodemailer.createTransport({ service: "gmail", auth: { user: process.env.ADMIN_EMAIL, pass: process.env.ADMIN_EMAIL_PASSWORD, }, }); const mailOptionsClient = { from: process.env.ADMIN_EMAIL, to: email, subject: "Booking Confirmation - Executive Detailing Limited", html: `<p>Dear ${name},</p> <p>Thank you for booking with Executive Detailing Limited. Here are your details:</p> <ul> <li><strong>Phone:</strong> ${phone}</li> <li><strong>Services:</strong> ${serviceList}</li> <li><strong>Message:</strong> ${message || "N/A"}</li> </ul> <p>We’ll reach out shortly to confirm the appointment. God bless!</p> <p>– Executive Detailing Team</p>`, }; const mailOptionsAdmin = { from: process.env.ADMIN_EMAIL, to: process.env.ADMIN_EMAIL, subject: `New Booking from ${name}`, text: `Name: ${name}\nEmail: ${email}\nPhone: ${phone}\nServices: ${serviceList}\nMessage: ${message}`, }; await transporter.sendMail(mailOptionsClient); await transporter.sendMail(mailOptionsAdmin); res.status(200).json({ message: "Booking confirmed and email sent!" }); } catch (error) { console.error("Error sending email:", error); res.status(500).json({ error: "Failed to send confirmation." }); } }); app.listen(PORT, () => { console.log(`Server running on port ${PORT}`); }); ADMIN_EMAIL=ecleaning40@gmail.com ADMIN_EMAIL_PASSWORD=your_app_password_here { "name": "executive-detailing", "version": "1.0.0", "description": "Executive Detailing Limited booking app", "main": "server.js", "scripts": { "start": "node server.js" }, "dependencies": { "body-parser": "^1.20.2", "cors": "^2.8.5", "dotenv": "^16.3.1", "express": "^4.18.2", "nodemailer": "^6.9.8" } } - Initial Deployment
2979486 verified