A modern, ready-to-use frontend template for restaurant web applications.
π Live Demo β Β |Β π Backend Repository β
- Overview
- Features
- Tech Stack
- Live Demo
- Getting Started
- Environment Variables
- Available Scripts
- Project Structure
- Pages & Components
- API Service
- Contributing
- License
Templete Dinner is a complete starting point for building restaurant web applications. Comes with authentication screens, restaurant listing and management pages, reusable components, and a centralized API service layer β all wired up with React Router and ready to connect to a RESTful backend.
Status: β Ready for local development and production deployment
- π± Fully responsive layout built with Tailwind CSS
- π Client-side routing with React Router v6
- π Authentication pages β Login and Register screens
- π΄ Restaurant pages β List, details, create, and edit
- π€ User pages β Profile and admin/user management views
- π§© Reusable components β
Navbar,RestaurantCardand more - π Centralized API layer β all HTTP calls in
services/api.js
| Technology | Purpose |
|---|---|
| React | UI framework |
| Vite | Build tool & dev server |
| Tailwind CSS | Utility-first styling |
| React Router | Client-side routing |
| ESLint | Code linting |
| dotenv / Vite env | Environment variable management |
| Link | |
|---|---|
| π Live Application | https://templete-dinner.onrender.com |
| π» Frontend Repository | github.com/your-username/templete-dinner |
| π Backend Repository | github.com/kayqueagape/DineExplore |
- Node.js 18+ (LTS recommended)
- npm or yarn
1. Clone the repository:
git clone https://github.com/your-username/templete-dinner.git
cd templete-dinner2. Install dependencies:
npm install3. Configure environment variables (see section below)
4. Start the development server:
npm run devOpen http://localhost:5173 in your browser.
Create a .env file in the project root. All variables must be prefixed with VITE_ to be exposed to the client by Vite.
# Base URL of the backend API
VITE_API_URL=http://localhost:3000| Variable | Description | Example |
|---|---|---|
VITE_API_URL |
Base URL for the backend REST API | http://localhost:3000 |
π‘ For production, point
VITE_API_URLto your deployed backend URL.
| Script | Description |
|---|---|
npm run dev |
Start the Vite development server |
npm run build |
Generate an optimized production build |
npm run preview |
Serve the production build locally |
npm run lint |
Run ESLint across the project |
templete-dinner/
β
βββ index.html # HTML entry point
βββ public/ # Static assets
βββ .env # Environment variables (not committed)
βββ vite.config.js
βββ tailwind.config.js
βββ postcss.config.js
β
βββ src/
βββ main.jsx # Application bootstrap
βββ App.jsx # Routing & base layout
βββ index.css # Global styles (Tailwind directives)
β
βββ components/
β βββ Navbar.jsx # Top navigation bar
β βββ RestaurantCard.jsx # Restaurant summary card
β
βββ pages/
β βββ Home.jsx # Restaurant listing
β βββ Login.jsx # Login screen
β βββ Register.jsx # Registration screen
β βββ Profile.jsx # Logged-in user profile
β βββ Users.jsx # User management / admin view
β βββ CreateRestaurant.jsx # Add new restaurant form
β βββ EditRestaurant.jsx # Edit existing restaurant form
β βββ RestaurantDetails.jsx # Full restaurant detail view
β
βββ services/
βββ api.js # Centralized API client (uses VITE_API_URL)
| Component | Description |
|---|---|
Navbar.jsx |
Top navigation bar with links for login, profile, and main sections |
RestaurantCard.jsx |
Reusable card displaying a restaurant's summary info |
| Page | Route | Description |
|---|---|---|
Home.jsx |
/ |
Lists all restaurants using RestaurantCard |
RestaurantDetails.jsx |
/restaurants/:id |
Full details view for a single restaurant |
CreateRestaurant.jsx |
/restaurants/new |
Form for adding a new restaurant |
EditRestaurant.jsx |
/restaurants/:id/edit |
Form for updating an existing restaurant |
Login.jsx |
/login |
Authentication screen |
Register.jsx |
/register |
New user registration screen |
Profile.jsx |
/profile |
Logged-in user profile page |
Users.jsx |
/users |
User management / admin view |
All HTTP calls are centralized in src/services/api.js, which uses VITE_API_URL as the base URL.
Integration tips:
- Store authentication tokens in
localStorageor a React context (e.g.AuthContext) - Add request/response interceptors in
api.jsfor centralized error handling and token refresh - Keep all API calls inside the service layer β avoid direct
fetch/axioscalls from pages or components - Use the DineExplore backend as the API β it's already built to match this frontend
This project includes a LICENSE file in the root directory. Please review it before using or distributing this template.