A full-stack restaurant web application with online ordering, admin portal, and feedback system.
- 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
- Frontend: HTML, CSS, JavaScript
- Backend: Java Servlets, JSP
- Database: PostgreSQL
- Build Tool: Maven
- Server: Apache Tomcat
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.
git clone <repository-url>
cd myFirstWebsiteRun the database setup script:
chmod +x setup_database.sh
./setup_database.shThis script will:
- Create a PostgreSQL database named
bistro_elegance - Create all necessary tables
- Insert sample data
- Update the database configuration in the Java code
Run the deployment script:
chmod +x deploy_backend.sh
./deploy_backend.shThis 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 packageThen manually deploy the WAR file to your Tomcat server.
Once deployed, you can access the application at:
- Frontend: http://localhost:8080/bistro-elegance/
- Admin Portal: http://localhost:8080/bistro-elegance/admin/dashboard.html
- Username: admin
- Password: admin123
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
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:
- Edit the HTML, CSS, or JavaScript files
- Refresh the browser to see your changes
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:
- Edit the Java files in the src/ directory
- Rebuild and redeploy the application using the deploy_backend.sh script
The database schema is defined in the database/schema.sql file. To modify the database:
- Edit the schema.sql file
- Run the setup_database.sh script to recreate the database
You can test the frontend by accessing the application in your browser and interacting with it.
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)
If you encounter database connection issues:
- Check that PostgreSQL is running
- Verify the database credentials in src/main/java/com/bistroelegance/util/DatabaseUtil.java
- Ensure the database and tables exist
If you encounter deployment issues:
- Check that Tomcat is running
- Verify the WAR file was copied to the Tomcat webapps directory
- Check the Tomcat logs for errors
If you encounter Java version issues:
- Check your Java version with
java -version - 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
- 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
- If you're using Eclipse or VS Code, the project includes configuration files (.classpath, .project, .settings) that should help with Java version configuration
This project is licensed under the MIT License - see the LICENSE file for details.
- Images from Unsplash
- Icons from Font Awesome
- Fonts from Google Fonts