A full-stack web application for CafΓ© Fausse, an elegant fine-dining establishment. This project was developed for the Quantic MSSE Cohort 66 Web Application & Interface Design course.
- Overview
- Features
- Technology Stack
- Getting Started
- Project Structure
- API Documentation
- UI/UX Design
- Development Process
- Future Enhancements
- Contributors
- License
CafΓ© Fausse is a fine dining restaurant that needed a modern website to showcase their menu, allow customers to make reservations, and highlight their awards and customer testimonials. This web application provides a seamless user experience across desktop and mobile devices, with an intuitive interface that matches the elegant atmosphere of the restaurant.
- Responsive Design: Optimized for desktop, tablet, and mobile devices using CSS Grid
- Interactive Menu: Categorized menu items with descriptions, prices, and dietary information
- Reservation System: Allows customers to check availability and book tables in real time
- Newsletter Signup: Email subscription form with backend integration and validation
- Photo Gallery: Lightbox gallery showcasing restaurant ambiance and dishes
- Awards & Reviews: Display of restaurant accolades and customer testimonials
- Notification System: Real-time feedback for user actions throughout the site
- React: UI library with JSX for component-based development
- TypeScript: Type-safe JavaScript for improved developer experience
- React Router: Navigation and routing between pages
- CSS Grid: Responsive layout system for consistent design across devices
- Context API: State management for sharing data across components
- Flask: Python web framework for building the API
- PostgreSQL: Relational database for storing reservation and customer data
- SQLAlchemy: ORM for database interactions
- Flask-Migrate: Database migration management
- Flask-CORS: Cross-Origin Resource Sharing support
- The front-end must be built using React and JSX
- Styling employs CSS Grid for responsive design
- The back-end utilizes Flask with a PostgreSQL database
- The website functions consistently across major browsers and mobile devices
- Node.js (v16+) and npm
- Python (v3.8+) and pip
- PostgreSQL (v13+)
-
Navigate to the parent directory of the
backendfolder:cd /path/to/your/project -
Create a virtual environment (optional but recommended):
python3 -m venv backend/env source backend/env/bin/activate # On Windows: backend\env\Scripts\activate
-
Install dependencies:
pip install -r backend/requirements.txt
-
Create a
.envfile in thebackenddirectory (see Environment Variables section for details). -
Create the PostgreSQL database:
createdb cafe_fausse_dev
-
Initialize the database with sample data:
python3 -m backend.init_db
-
Start the Flask development server: To run the backend development server, navigate to the parent directory of the
backendfolder and execute the following command:# Development mode
python3 -m backend.run_dev
python -m backend.run_prod
This ensures that Python treats the `backend` directory as a package, resolving any relative imports correctly.
8. The backend API will be available at [http://localhost:5001](http://localhost:5001)
### Frontend Setup
1. Navigate to the frontend directory:
```bash
cd frontend
-
Install dependencies:
npm install
-
Create a .env file in the frontend directory with the following content:
REACT_APP_API_URL=http://localhost:5001/api -
Start the development server:
npm start
For production build:
npm run build
-
The frontend will be available at http://localhost:3000
REACT_APP_API_URL=http://localhost:5001/api
FLASK_APP=app.py
FLASK_ENV=development
DATABASE_URL=postgresql://localhost/cafe_fausse_dev
SECRET_KEY=your_secret_key_here
cafe-fausse/
βββ frontend/ # React frontend application
β βββ public/ # Static files
β βββ src/ # Source code
β βββ assets/ # Images and resources
β βββ components/ # Reusable UI components
β βββ context/ # React Context API providers
β βββ pages/ # Page components
β βββ css/ # CSS styles
β βββ utils/ # Utility functions and API clients
β
βββ backend/ # Flask backend application
β βββ api/ # API endpoints
β β βββ menu.py # Menu-related endpoints
β β βββ newsletter.py # Newsletter subscription endpoints
β β βββ reservations.py # Reservation endpoints
β βββ config/ # Configuration settings
β βββ models/ # Database models
β β βββ base.py # Base model class
β β βββ category.py # Menu category model
β β βββ customer.py # Customer model
β β βββ menu_item.py # Menu item model
β β βββ newsletter.py # Newsletter subscription model
β β βββ reservation.py # Reservation model
β βββ services/ # Business logic
β βββ tests/ # Unit and integration tests
β βββ utils/ # Helper functions
β
βββ README.md # This file
-
POST
/api/reservations- Create a new reservation- Request:
{ "name": "John Doe", "email": "john@example.com", "date": "2025-04-15", "time": "19:00", "guests": 4, "phone": "202-555-1234", "special_requests": "Window seat preferred" } - Response:
{ "success": true, "message": "Reservation confirmed", "reservation_id": 123, "table_number": 5 }
- Request:
-
POST
/api/reservations/check-availability- Check table availability- Request:
{ "date": "2025-04-15", "time": "19:00", "guests": 4 } - Response:
{ "available": true, "tables_remaining": 12 }
- Request:
-
POST
/api/newsletter/subscribe- Subscribe to newsletter- Request:
{ "email": "customer@example.com" } - Response:
{ "success": true, "message": "Successfully subscribed to the newsletter" }
- Request:
-
POST
/api/newsletter/unsubscribe- Unsubscribe from newsletter- Request:
{ "email": "customer@example.com" } - Response:
{ "success": true, "message": "Successfully unsubscribed from the newsletter" }
- Request:
-
GET
/api/menu/categories- Get all menu categories- Response:
{ "success": true, "categories": [ { "id": 1, "name": "Starters", "description": "Perfect beginnings to your meal" }, {...} ] }
- Response:
-
GET
/api/menu/items- Get all menu items- Response:
{ "success": true, "items": [ { "id": 1, "name": "Bruschetta", "description": "Fresh tomatoes, basil, olive oil, and toasted baguette slices", "price": 8.50, "category_id": 1, "is_vegetarian": true, "is_vegan": false, "is_gluten_free": false, "image_url": "/images/bruschetta.jpg" }, {...} ] }
- Response:
-
GET
/api/menu/categories/:id/items- Get items for a specific category- Response: Same format as the items endpoint but filtered by category
The website features a clean, elegant design that matches the fine dining experience of CafΓ© Fausse. Key design elements include:
- Color Scheme: Rich, warm colors that evoke a sophisticated dining atmosphere
- Typography: Classic, readable fonts that maintain elegance across devices
- Navigation: Intuitive menu with clear pathways to all sections
- Responsive Design: CSS Grid layout that adapts beautifully to all screen sizes
- Form Design: Clean, user-friendly forms with real-time validation feedback
- Notification System: Non-intrusive notifications that provide feedback on user actions
The application was developed using a component-based approach with React:
-
Planning Phase:
- Analyzed the Software Requirements Specification (SRS)
- Created wireframes for all pages
- Designed the database schema
- Planned API endpoints
-
Frontend Development:
- Set up React with TypeScript
- Created reusable components
- Implemented responsive CSS Grid layouts
- Set up Context API for state management
- Built forms with validation
- Created API utility functions
-
Backend Development:
- Set up Flask application structure
- Defined SQLAlchemy models
- Implemented API endpoints
- Created database management scripts
- Added authentication and security measures
-
Integration:
- Connected frontend forms to backend API
- Implemented error handling
- Added loading states
- Ensured cross-browser compatibility
-
Testing:
- Tested API endpoints
- Verified form validation
- Confirmed responsive design across devices
- Validated data persistence
To test the login functionality, use the following credentials:
- Username:
admin - Password:
password123
These credentials provide access to the admin account for testing purposes.
- Seth McKnight - MSSE Cohort 66
- Toby Pasquale - MSSE Cohort 66
This project is licensed under the MIT License - see the LICENSE file for details.
