You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alviro is a modern, full-stack restaurant web application that delivers a premium dining experience β online. Customers can explore the menu, make table reservations, subscribe to newsletters, and interact with an AI chatbot. Restaurant admins can manage menu items and reservations behind authenticated routes.
π οΈ Tech Stack
Frontend
Technology
Version
Purpose
React
19
UI Framework
Vite
7
Build Tool & Dev Server
TailwindCSS
3
Utility-First Styling
Framer Motion
12
Animations & Transitions
React Router DOM
7
Client-Side Routing
Lucide React
0.5
Icons
Clerk React
5
Authentication UI
Axios
1
HTTP Client
Backend
Technology
Version
Purpose
Node.js + Express
5
REST API Server
MongoDB + Mongoose
9
Database & ODM
Clerk SDK
4
Authentication Middleware
JSON Web Token
9
Route Protection
bcryptjs
3
Password Hashing
dotenv
17
Environment Variables
CORS
2
Cross-Origin Requests
ποΈ System Architecture
graph TB
subgraph CLIENT["π₯οΈ Client β React + Vite (Port 5173)"]
direction TB
A["π Home Page"]
B["π Menu Page"]
C["π Contact Page"]
NAV["π Navbar"]
FOOT["π¦Ά Footer"]
BOT["π€ Chatbot"]
CTX["π¨ Theme Context"]
end
subgraph SERVER["βοΈ Server β Express (Port 5000)"]
direction TB
AUTH_R["/api/auth"]
MENU_R["/api/menu"]
RES_R["/api/reservations"]
NEWS_R["/api/newsletter"]
PROT["/api/protected π"]
end
subgraph DB["ποΈ MongoDB Atlas"]
direction TB
U[("π€ Users")]
M[("π MenuItems")]
R[("π Reservations")]
N[("π§ Newsletters")]
end
CLIENT -->|"REST API calls via Axios"| SERVER
SERVER --> DB
CLERK["π Clerk Auth"] -->|"JWT Tokens"| SERVER
CLIENT -->|"Authentication"| CLERK
flowchart LR
A([π€ User visits /menu]) --> B[Fetch GET /api/menu]
B --> C{Items found?}
C -- Yes --> D[Render Menu Cards\nwith Framer Motion]
C -- No --> E[Show empty state]
D --> F([π½οΈ User browses items])
Loading
2. π Table Reservation Flow
flowchart TD
A([User opens Contact/Reservation form]) --> B[Fill in: Name, Email,\nPhone, Date, Time, Guests]
B --> C[Submit Form]
C --> D[POST /api/reservations]
D --> E{Validation OK?}
E -- β Yes --> F[Save to MongoDB\nStatus: Pending]
E -- β No --> G[Return Error to User]
F --> H[Confirmation response]
H --> I([β User gets confirmation])
subgraph ADMIN["π Admin Actions"]
J[GET /api/reservations] --> K[View all reservations]
K --> L[PATCH /api/reservations/:id]
L --> M{Update status}
M --> N([Confirmed β ])
M --> O([Cancelled β])
end
Loading
3. π Authentication Flow
sequenceDiagram
participant U as π€ User
participant C as π₯οΈ Client
participant CLK as π Clerk
participant S as βοΈ Server
U->>C: Sign In / Sign Up
C->>CLK: Redirect to Clerk Auth
CLK-->>C: Return JWT Token
C->>S: API Request + JWT in Header
S->>CLK: Verify Token
CLK-->>S: Token Valid β
S-->>C: Protected Data
C-->>U: Render Response
Loading
4. π§ Newsletter Subscription
flowchart LR
A([User enters email]) --> B[POST /api/newsletter]
B --> C{Email exists?}
C -- No --> D[Save subscriber\nto MongoDB]
C -- Yes --> E[Return: Already subscribed]
D --> F([β Subscribed successfully])
Loading
π‘ API Reference
π Public Routes
Method
Endpoint
Description
GET
/api/menu
Fetch all menu items
POST
/api/reservations
Create a new reservation
POST
/api/newsletter
Subscribe to newsletter
POST
/api/auth/login
User login
POST
/api/auth/register
User registration
π Protected Routes (Auth Required)
Method
Endpoint
Description
POST
/api/menu
Add a new menu item
PATCH
/api/menu/:id
Update a menu item
DELETE
/api/menu/:id
Delete a menu item
GET
/api/reservations
Get all reservations
PATCH
/api/reservations/:id
Update reservation status
GET
/api/protected
Test Clerk auth route
ποΈ Database Models
erDiagram
USER {
string _id PK
string email
string name
string passwordHash
date createdAt
}
MENU_ITEM {
string _id PK
string name
string description
number price
string category
string imageUrl
date createdAt
}
RESERVATION {
string _id PK
string name
string email
string phone
date date
string time
number guests
string status
string specialRequest
date createdAt
}
NEWSLETTER_SUBSCRIBER {
string _id PK
string email
date subscribedAt
}
USER ||--o{ RESERVATION : "makes"