Gym is a fitness center that has been grown rapidly throughout the country. They provide a quality healthcare service and give their members control over their health is paramount at all Rathnayaka GYMS. They help members prevent and overcome degenerative diseases, achieve their optimum fitness goals, realize personal lifestyle development objectives, and rehabilitate them into good health. This is accomplished by designing exercise programs that are effective, efficient, and motivational.
Due to the increasing number of members, they have planned to automate their billing process. Imagine that you are a software developer in this project and design and develop a system for Vigaro.
- File-based database
- Authenticate allowable users
- View fitness package details
- View food supplement details
- Calculate bill for invoice
- Information about business
- Multi-platform support (Windows, Linux, Mac OS)
Please download the latest release of the application form here. Once downloaded you should find a directory named app
. Inside the app
directory you will find the following executables and directories.
- app - Unix executable.
- app.exe - Windows executable.
- invoices - Directory where invoices generated after each purchase is stored.
- details - Details regarding packages and business are stored and accessed by the app.
- display - App user interface specific files.
If you are on a Windows machine you can directly double click on and open the app.exe
file and the application should startup on a terminal screen. It is recommended that the app.exe
be run through a terminal
app like Powershell
on Windows. If you are on a Linux or Mac machine you need to access the app
directory through your terminal
application and run the app
executable file through the treminal
application by running the command:
./app
Please make sure that the
details
,display
, andinvoices
directories are located right next to bothapp
andapp.exe
executables inside theapp
directory. These directories are essential for the application to function properly.
Once the application is running you will be prompted to log in to the system by entering a valid email address and password. Use the below provided for the test run:
Password | |
---|---|
staff@gym.com | password123 |
After you have been logged in you should be able to see a menu with a list of actions for you to choose from and an input prompting for your action choice. Type in the relative number associated with the action you would like to perform on to the prompt and press enter
.
Upon choice of an action relating to "view details", the application will display relevant details on the screen. These details are accessed from the details
directory located next to the executable file itself.
If option no. 4 is chosen you will be redirected to another prompt asking for your choice of a membership package to purchase. This is followed by another prompt asking how many packages you would like to purchase and yet another similar prompt asking if you would like to purchase any supplement packages to accompany your purchase of a membership package.
Please provide a valid package ID
on both instances you are prompted for a choice otherwise the prompt will loop back and ask again until a valid package ID
is provided.
Once the package and supplements are purchased the application will ask for your name. You can provide your full name with spaces included and the app will capture it as a whole string.
Finally, the bill amount and relevant charges are calculated and an invoice is generated and displayed back to you.
The invoice is also written to a file and saved within the invoices
directory for use by the business.
The source code follows the below directory structure:
.
βββ sourcecode/
βββ src/
β βββ includes/
β β βββ bill.h
β β βββ auth.h
β β βββ db.h
β β βββ menus.h
β β βββ invoice.h
β β βββ details.h
β β βββ fort.h
β β βββ fort.hpp
β βββ main.cpp <- Start here!
β βββ auth.cpp
β βββ db.cpp
β βββ menus.cpp
β βββ invoice.cpp
β βββ details.cpp
β βββ bill.cpp
β βββ fort.cpp
βββ tests/
β βββ bill_test.cpp
β βββ details_test.cpp
β βββ auth_test.cpp
β βββ util_test.cpp
β βββ main.cpp
β βββ CMakeLists.txt
βββ googletest
βββ CMakeLists.txt
When inspecting the code please start with the src
directory and follow the below order.
main.cpp
db.cpp
auth.cpp
menus.cpp
details.cpp
bill.cpp
utils.cpp
invoice.cpp
The relevant header files are located within the
include
directory inside thesrc
directory.
The source code is also stored on Github
at Thavarshan/gym
for storage, version management, and CI/CD purposes. All unit test files are found within the tests
directory and the testing framework itself is found inside the googletest
directory.
Please note that an external library called libfort
is also included within the src
directory in the files:
fort.cpp
include/fort.h
include/fort.hpp
Source code has multiple lines between code blocks to improve readability.
The project (not the app) is only installable through git
and should be cloned from the remote repository. To clone the project to your local development environment or even production environment, run the below shell
command through your terminal.
git clone git@github.com:Thavarshan/gym.git gym
You should see a directory called gym
or gym
at the place where you cloned the project.
All coding was done by Thavarshan Thayananthajothy (CL/HDCSE/95/15). No existing applications were used as a reference and extra knowledge on how to accomplish certain tasks was acquired through online research. The application source code follows C++17
standards and clang-format
coding standards.
- IDE/Code Editor - Visual Studio Code
- Build system - CMake
- Compiler - Clang (Mac) & MinGW-w64 (Windows)
- Testing framework - GoogleTest
- Terminal application - MacOS Terminal & Windows Terminal
- Extra libraries - libfort
All unit testing both locally and on the cloud through CI was accomplished through GoogleTest. CMake was used to compile and test the executables and libraries.
Continuous integration is a coding philosophy and set of practices that drive development teams to implement small changes and check-in code to version control repositories frequently (IDG Communications, Inc. 2020).
The free service of CI provided by Github was utilized for the CI pipeline. Every time code is pushed to Github
a special automated action is run where a cloud droplet / virtual machine hosted on the cloud is propagated and is used to build and test the code in different platforms.
The code is compiled, built, and tested on Linux
, Mac OS
and Windows
platforms. You can view all CI processes here.
Three services are run every time the code is pushed to Github
.
- Build and test application
- Build application for release (normal use)
- Static code analysis.
Static code analysis is a method of debugging by examining source code before a program is run. Itβs done by analyzing a set of code against a set (or multiple sets) of coding rules.
As mentioned previously static code analysis service is automatically run by the CI pipeline every time updates to the source code are pushed to Github
.
Similar to static code analysis service the CI pipeline also performs an action where the application on successful testing builds for release or regular usage by end-user. The service produces usable executable files for both Unix
and Windows
platforms.
Semantic versioning is a formal convention for specifying compatibility using a three-part version number: major version; minor version; and patch.
The application is released based on semantic versioning and is available for download here.
This application and project as a whole was developed and is maintained by Jerome Thayananthajothy.