Cupcake mini project

This assignment is to be carried out in groups. (If you work together in pairs on one computer, you have to take turns at the keyboard distributing time evenly). You must use github for your shared code repository and deploy the application on all of your linux servers (So that each member has a working application on their own server.)

Web shop

Image of cupcakes

You are to develop a simple web-shop using MySql database, java servlets and jsp pages on the backend and html, css and javascript on the frontend.

The web shop sells cupcakes, but only as pick-up. Customers can use the web shop to place an order and then show up in person to pick up the cupcakes. Sending cupcakes in the mail has shown to be a bad idea as they turn up with bite marks if at all.

The bakery has a very fast cupcake-machine, so the instant the order is placed the cup cakes are ready for pickup.

The cupcakes have a bottom and a topping which can be combined in many ways, but a cup cake must always have both a bottom and a topping. Bottoms and toppings can be found in appendix A - The cupcakes.

Costumers each have an account with the shop and orders can only be placed if the account hold enough money to cover the price. Payment is handled by another system and as of now deposits will have to be handled manually in the database, but withdrawals happen when cupcakes are ordered.

In order to pay with their account the customers will have to use a username and a password to login before placing an order.

Let’s break the project down into steps:

1 Connect to database

Create a web application with a class which is responsible for the database connection. This class holds all the information needed to make a connection. You can use MySql server on your droplet on Digital Ocean to make the connection to. This will make it easier when you need to deploy the project and it means that all members of the group can connect to the same database.

2 Login

3 Registration and login pages

4 The shop

The shop shows who is logged in and the account balance of this user. It also displays a list of all the cupcakes (bottoms and toppings) their prices and a button to order the cupcake and maybe an input where the user can write the desired number to order. You will need to expand the database to hold cupcakes (see appendix A) – hint you might want to consider using more than one table. A cupcake has a bottom, a top and a total price. (Unless you want to keep it very simple and just work with a list of Cupcakes. No toppings and buttons then just a list og cupcakes e.g. List)

The shopping cart should be stored in the session (Why do you think?). When a cupcake is added, a new Line Item is created and added to the cart. If the user order the same cake twice we can add yet another LineItem (or the quantity of an already existing Line Item can be incremented).

6 The invoice

When cupcakes have been added to the cart the order can be finalized. This creates an invoice with an id and a customer(user). This invoice and all the Line Items in the shopping cart are stored in the database.

7 Customer page

8 Admin page

The cake shop administrator needs to know which orders have been placed

9 Styling

Appendix A - The cupcakes

The bottoms

Bottom Price
Chocolate 5.00
Vanilla 5.00
Nutmeg 5.00
Pistacio 6.00
Almond 7.00

The toppings

Topping Price
Chocolate 5.00
Blueberry 5.00
Rasberry 5.00
Crispy 6.00
Strawberry 6.00
Rum/Raisin 7.00
Orange 8.00
Lemon 8.00
Blue cheese 9.00