Assignment Task
Academic Integrity
Permitted activities: Usage of Internet to search for syntax only; usage of course materials.
Not permitted:
- Communication with others (both inside and outside the class)
- Discussion of solution or approaches with others; sharing/using a “reference” from someone
- Searching the internet for full or partial solutions
- Sharing of resources, including links, computers, accounts
Problem Description
In this assessment, you will build a web application for a fitness gym. Here are the business requirements for the fitness gym.
1. The gym offers fitness classes. Customers can book a class and pay.
2. The price of a single class is $25.
3. The fitness gym offers a monthly membership plan. Users who sign-up for the monthly plan are charged a flat rate for classes of $75. Users who do not signup for the monthly plan must pay for each class individually
User Interface
The user interface of the website consists of these pages;.
1. Schedule of classes page → displays a list of classes and enables user to book a class
2. Cart page → a checkout page that displays the user’s shopping cart and checkout information
3. Login page → user can create an account or login using this page
Server Side
The server side of the application consists of all the logic to:
1. Define endpoints and manage the request-response cycle from a client
2. Interact with a MongoDb database
3. Control access to endpoints using authorization. Note the following access control rules:
Page | Access |
Schedule Page | All users can view, but only logged in users can book a class |
Cart Page | Only logged in users can view this page. |
Login Page | Any user can view – no login required |
MongoDB Database
The database must have the following collections. Ensure you follow this database design:
1. Users collection:
- Every user has a username and password
2. Classes collection: Stores the classes offered by the gym
- Every class has an image name, class name, length.
3. Payments collection: The payments made by the website’s customers.
- Every payment has a username and total amount paid.
4. Cart collection: Stores the items in the currently logged in user’s cart
- Every document must have the username and id of the corresponding class