DevByRico/project-final
Β
Β
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Repository files navigation
# π Barber Booking β Final Project A modern full-stack barber appointment app with real-time slot availability, email confirmations (ICS calendar invite), and a protected admin dashboard. Built with a focus on clean code, accessibility, and responsive design. **Live site:** [https://barber-rico.netlify.app](https://barber-rico.netlify.app) **API (Render):** [https://project-final-it0v.onrender.com](https://project-final-it0v.onrender.com) --- ## π Project Update (Refactor Summary) This version includes a full refactor and code cleanup based on feedback: - Converted all components to **functional React** with hooks - Simplified and reorganized file structure for readability - Improved responsive design and dark/light theme consistency - Ensured `.env` and `node_modules` are properly ignored in Git - Verified all Technigo requirements are met --- ## β¨ Features - Fast frontend (Vite + React + Tailwind) - Dark/Light theme toggle (saved in localStorage) - Calendar with selectable time slots (30-min increments) - Smooth booking flow with confirmation screen - Email confirmation + downloadable `.ics` calendar invite - Admin dashboard (JWT-protected): list, mark as done, delete bookings - Security middleware: rate limiting, Helmet, CORS - SEO & PWA optimized (favicons, manifest, Open Graph tags) --- ## π§± Tech Stack **Frontend** - React (functional components) - React Router - Tailwind CSS - Vite **Backend** - Node.js + Express - MongoDB (Mongoose) - Nodemailer (Mailtrap for dev) - JWT authentication **Hosting** - Frontend β **Netlify** - Backend β **Render** --- ## π Project Structure ```bash project-final/ ββ client/ # React app (Vite) β ββ public/ # Favicon, manifest, logo, SEO assets β ββ src/ β β ββ components/ # Header, ThemeToggle, ProtectedRoute, etc. β β ββ pages/ # SelectTime, DetailsPage, ConfirmPage, Admin β β ββ store/ # Contexts (Auth, Booking) β β ββ App.jsx, main.jsx, index.css, ... β ββ index.html ββ server/ # Express API ββ index.js # Routes, email, DB connection ββ package.json ββ .env # π private config (not committed) ``` **Booking schema:** ```js // Unique index prevents double-booking bookingSchema.index({ date: 1, time: 1 }, { unique: true }); ``` --- ## π Security - Admin JWT stored in **sessionStorage** (auto-clears when tab closes) - Uses `helmet`, `cors`, and rate limiting - MongoDB unique index on date+time - `.env` is excluded from Git (with `.env.example` provided) --- ## π SEO & UX - Semantic, accessible structure (WCAG friendly) - `<title>` + meta descriptions and Open Graph tags - Light/dark contrast verified - Responsive across all breakpoints (320px β 1920px) - Smooth transitions and animations for better UX --- ## π Troubleshooting - **Admin login not working** - Ensure `JWT_SECRET` exists in `.env` and restart server. - **CORS error** - Check that `CLIENT_URL` in `.env` matches your frontend URL. - **Email not received** - Use Mailtrap sandbox credentials in dev; check spam folder. - **Duplicate booking** - MongoDB unique index on date+time prevents double-booking (returns 409). --- ## β Status β Functional React Components β Responsive and accessible UI β Code cleaned and organized after feedback β Meets all Technigo project requirements --- ## π§© Author Built by **DevByRico** π¨π» _Refactored & improved based on Technigo feedback 2025._
Releases
No releases published
Languages
- JavaScript 83.4%
- CSS 13.1%
- HTML 3.5%