A polished full-stack restaurant reservation demo with a public dining website, protected admin dashboard, menu management, email hooks, and a lightweight SQLite database powered by sql.js.
- Public restaurant landing page with reservation form
- Express API for reservations, menu items, authentication, and health checks
- JWT-protected admin panel for reservations and menu management
- Reservation status workflow: pending, confirmed, cancelled, completed
- Email service integration with graceful mock mode when SMTP is not configured
- Local SQLite-style persistence using
sql.js - Security basics: Helmet, CORS allowlist, JSON body limits, and rate limiting
- Node.js
- Express
- sql.js
- JWT authentication
- bcryptjs
- Nodemailer
- HTML, CSS, and vanilla JavaScript
Install dependencies:
npm installCreate your local environment file:
cp .env.example .envOn Windows PowerShell:
Copy-Item .env.example .envStart the app:
npm startOpen the website:
http://localhost:3000
Live demo:
https://project-restaurant-tn.netlify.app/
Open the admin dashboard:
http://localhost:3000/index.html
Default demo admin credentials from .env.example:
Email: admin@projectrestaurant.local
Password: ProjectRestaurantAdmin2024!
Change these values before deploying.
| Method | Route | Description |
|---|---|---|
GET |
/api/health |
Service health check |
POST |
/api/reservations |
Create a public reservation |
GET |
/api/menu |
List available menu items |
POST |
/api/auth/login |
Admin login |
GET |
/api/auth/me |
Current admin profile |
GET |
/api/reservations |
Admin reservation list |
PATCH |
/api/reservations/:id/status |
Update reservation status |
GET |
/api/menu/admin/all |
Admin menu list |
POST |
/api/menu |
Create menu item |
PUT |
/api/menu/:id |
Update menu item |
PATCH |
/api/menu/:id/toggle |
Toggle menu availability |
admin/ Static customer and admin pages
routes/ Express route handlers
middleware/ JWT auth middleware
data/ Local database directory
docs/screenshots/ README screenshots
db.js Database initialization and persistence
email.js Nodemailer templates and send helpers
server.js Express app entrypoint
.envand local database files are intentionally ignored by Git..env.exampledocuments the required configuration.- If SMTP credentials are not configured, email sending falls back to mock log messages.


