The goal of this project was to develop one of the randomly assigned subject from a list (available here).
My subject was to create an Online Take-Away System, following these rules :
- Restaurant owners can register their restaurants and create an account
- They can add a menu of items for sale from their takeaway with corresponding description and prices
- Anonymous users can search for takeaways and browse their menus and place an order (payment process not required)
- The application had to be using the DCU Oracle database and be deployed as a WAR on a the DCU Tomcat server
The rest was up to me.
The project was developed using :
- Java 8
- JSTL (JavaServer Pages Standard Tag Library)
- IntelliJ IDEA 2018.3.4 (Ultimate Edition)
- No Javascript library
- HTML5 and CSS3
- Github and MarkDown (report)
The system is structured in such a way :
Route | Description | Login Required | Account Creation |
---|---|---|---|
/ | Home page | No | - |
/application | Anonymous ordering page | No | - |
/application/professional | Restaurant managing page | Yes | Yes |
/application/admin | Database administration page | Yes | No |
/report | Report page | No | - |
A complete Javadoc documentation for the project is available here
The administration system is used to manage the application:
- Reset the database
- Populate the database
In the accessed with a single account, that cannot be removed nor changed:
Password | |
---|---|
[email protected] | adminpass |
The application is separated in two parts
The anonymous ordering page is where the user will be able to order his food. The ordering path is quite simple :
- A list of available restaurants that the user can select is presented, if none exists, a message notifies him.
- A list of available menus that the user can select (from the chosen restaurant) is presented, if none exists, a message notifies him.
- An order finalization page is presented to the user where he can set his name and order.
- An order confirmation page is presented.
Sample login details (generated from the administration page populate):
Password | |
---|---|
[email protected] | password |
The restaurant managing page is where any restaurateur can register and manage his restaurants for customers to order. This is what he can do:
- Create and modify restaurants.
- Create and modify menus.
- See the last orders in each of his restaurants.
If you wish to manually build the database tables instead of using the administration system, here are queries :
The queries must be perform in this exact order because of constraint rules
CREATE TABLE mouraua2_users (
id INTEGER GENERATED ALWAYS as IDENTITY(START with 1 INCREMENT by 1),
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
firstname VARCHAR(255) NOT NULL,
lastname VARCHAR(255) NOT NULL,
gender INTEGER,
salt VARCHAR(255),
PRIMARY KEY(id)
)
CREATE TABLE mouraua2_restaurants (
id INTEGER GENERATED ALWAYS as IDENTITY(START with 1 INCREMENT by 1),
name VARCHAR(255),
location VARCHAR(255),
owner INTEGER,
description VARCHAR(255),
phoneNumber VARCHAR(255),
PRIMARY KEY(id),
CONSTRAINT FK_RESTAURANTS_USERS_owner FOREIGN KEY (owner) REFERENCES MOURAUA2_USERS(ID) ON DELETE SET NULL
)
CREATE TABLE mouraua2_menus (
id INTEGER GENERATED ALWAYS as IDENTITY(START with 1 INCREMENT by 1),
name VARCHAR(255),
description VARCHAR(255),
restaurant INTEGER,
price BINARY_DOUBLE,
PRIMARY KEY(id),
CONSTRAINT FK_MENUS_RESTAURANTS_id FOREIGN KEY (restaurant) REFERENCES MOURAUA2_RESTAURANTS(ID) ON DELETE SET NULL
)
CREATE TABLE mouraua2_orders (
id INTEGER GENERATED ALWAYS as IDENTITY(START with 1 INCREMENT by 1),
restaurant INTEGER,
menu INTEGER,
customer VARCHAR(255),
time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(id),
CONSTRAINT FK_ORDERS_RESTAURANT_id FOREIGN KEY (restaurant) REFERENCES MOURAUA2_RESTAURANTS(ID) ON DELETE SET NULL,
CONSTRAINT FK_ORDERS_MENU_id FOREIGN KEY (menu) REFERENCES MOURAUA2_MENUS(ID) ON DELETE SET NULL
)
- Design
- Administration page : Automated database reset and populate
- SHA256 Password hashing with SecureRandom generated salt
- Field validation (Regex)
- MVC Architecture
- Session tracking and logout
- Complete Javadoc documentation
- MarkDown report (Turned to HTML scraping Github, allowed by teacher)
- Field modification