Skip to content

WebDevAbdou/Bistro-Elegance-website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bistro Elegance Restaurant Web Application

A full-stack restaurant web application with online ordering, admin portal, and feedback system.

Features

  • User Authentication: Login, registration, and profile management
  • Online Ordering System: Browse menu, add to cart, checkout, and order tracking
  • Feedback System: Submit feedback, complaints, and suggestions
  • Admin Portal: Manage orders, menu items, feedback, and users
  • Responsive Design: Works on mobile and desktop devices

Technology Stack

  • Frontend: HTML, CSS, JavaScript
  • Backend: Java Servlets, JSP
  • Database: PostgreSQL
  • Build Tool: Maven
  • Server: Apache Tomcat

Prerequisites

Before you begin, ensure you have the following installed:

  • Java Development Kit (JDK) 22 (the project is configured for Java 22)
  • Apache Maven (or use the included Maven wrapper)
  • PostgreSQL
  • Apache Tomcat 9.x or higher
  • Git (optional)

Note: If you're using a different Java version, you may need to update the Java version in the pom.xml file.

Setup Instructions

1. Clone the Repository

git clone <repository-url>
cd myFirstWebsite

2. Set Up the Database

Run the database setup script:

chmod +x setup_database.sh
./setup_database.sh

This script will:

  • Create a PostgreSQL database named bistro_elegance
  • Create all necessary tables
  • Insert sample data
  • Update the database configuration in the Java code

3. Build and Deploy the Backend

Run the deployment script:

chmod +x deploy_backend.sh
./deploy_backend.sh

This script will:

  • Build the Java application using Maven
  • Deploy the WAR file to Tomcat
  • Start the Tomcat server

Alternatively, you can use the Maven wrapper:

# On Linux/macOS
./mvnw clean package

# On Windows
mvnw.cmd clean package

Then manually deploy the WAR file to your Tomcat server.

4. Access the Application

Once deployed, you can access the application at:

Default Admin Credentials

  • Username: admin
  • Password: admin123

Project Structure

myFirstWebsite/
├── css/                      # CSS stylesheets
├── js/                       # JavaScript files
├── images/                   # Image assets
├── admin/                    # Admin portal pages
├── database/                 # Database scripts
├── src/                      # Java backend code
│   └── main/
│       ├── java/
│       │   └── com/
│       │       └── bistroelegance/
│       │           ├── model/       # Data models
│       │           ├── dao/         # Database access
│       │           ├── service/     # Business logic
│       │           ├── controller/  # Servlets
│       │           └── util/        # Utility classes
│       ├── resources/        # Configuration files
│       └── webapp/           # Web application files
│           └── WEB-INF/      # Web configuration
├── pom.xml                   # Maven configuration
├── setup_database.sh         # Database setup script
└── deploy_backend.sh         # Deployment script

Development Guide

Frontend Development

The frontend is built using HTML, CSS, and JavaScript. The main files are:

  • HTML: Located in the root directory and admin/ folder
  • CSS: Located in the css/ folder
  • JavaScript: Located in the js/ folder

To modify the frontend:

  1. Edit the HTML, CSS, or JavaScript files
  2. Refresh the browser to see your changes

Backend Development

The backend is built using Java Servlets. The main components are:

  • Models: Define the data structures
  • DAOs: Handle database operations
  • Services: Implement business logic
  • Controllers: Handle HTTP requests and responses

To modify the backend:

  1. Edit the Java files in the src/ directory
  2. Rebuild and redeploy the application using the deploy_backend.sh script

Database Development

The database schema is defined in the database/schema.sql file. To modify the database:

  1. Edit the schema.sql file
  2. Run the setup_database.sh script to recreate the database

Testing

Frontend Testing

You can test the frontend by accessing the application in your browser and interacting with it.

Backend Testing

To test the backend API endpoints, you can use tools like Postman or curl.

Example API endpoints:

  • GET /api/menu - Get all menu items
  • POST /api/auth/login - Login
  • GET /api/orders - Get all orders (requires authentication)

Troubleshooting

Database Connection Issues

If you encounter database connection issues:

  1. Check that PostgreSQL is running
  2. Verify the database credentials in src/main/java/com/bistroelegance/util/DatabaseUtil.java
  3. Ensure the database and tables exist

Deployment Issues

If you encounter deployment issues:

  1. Check that Tomcat is running
  2. Verify the WAR file was copied to the Tomcat webapps directory
  3. Check the Tomcat logs for errors

Java Version Issues

If you encounter Java version issues:

  1. Check your Java version with java -version
  2. If you're not using Java 22, you have two options:
    • Install Java 22 (recommended)
    • Update the Java version in the pom.xml file to match your installed version
  3. If you see compiler compliance warnings in your IDE:
    • Update your IDE's Java settings to use Java 22
    • Or update the project settings to match your installed Java version
  4. If you're using Eclipse or VS Code, the project includes configuration files (.classpath, .project, .settings) that should help with Java version configuration

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • Images from Unsplash
  • Icons from Font Awesome
  • Fonts from Google Fonts

About

A full-stack restaurant web application with online ordering, admin portal, and feedback system.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors