Installing PostgreSQL
Postgres is required to be installed on your system
1. Download PostgreSQL from: https://www.postgresql.org/download. Please install the latest version (15)2. Depending on your machine, you can download the any package that suits your needs.
3. Please ensure that Postgres is running on your system. You might need to restart your machine
Creating the database and tables
Go into the directory, backend in the source code and open the terminal there.
This step also needs you to have npm (nodejs) installed. Please refer to "Running the Backend" subsection
1. run the command > node database.js.2. A message should show in the terminal saying "Database and tables created successfully."
3. You can use a tool such as PGAdmin 4 or any Database management software tool to verify the database is running.
4. You can also use one of our test scripts, "test-db-script", to check if the db is running. use command > node test-db-script.js
installing nodejs
Nodejs is required for npm and for running the backend.
1. Download nodejs from: https://nodejs.org/en/download/package-manager. Please install the latest v22.5.12. Depending on your machine, you can download the any package that suits your needs.
Installing The all of the backedn packages and dependencies
All our packages and dependencies is really simple.
1. Run the command: npm installRunning the server
After downloading nodejs, it's time to run the server.
1. go into the backend directory.2. type the command > node index.js
3. After the command is run, the server should be running on host: http://localhost:3000
Installing Angular
Angular is needed for the front end
1. In the command prompt, run the command npm: install -g @angular/cli@17Installing Tailwindcss
We are using tailwind as our frontend styling library
1. Run the command: npm install -D tailwindcssInstalling daisyui
another library we arer using is daisyui, which works with tailwindcss
1. Run the command: npm -i -D daisyui@latestInstalling ApexCharts
For charts we are using Apex Charts
1. Run the command: npm install apexcharts --saveInstalling The rest of the frontend packages and dependencies
All our packages and dependencies is really simple.
1. Run the command: npm installRunning the Frontend
1.change directories to the Workbench subdirectory within the frontend subdirectory. This can be done using the command
cd frontend/Workbench
- Once inside Workbench, run the command ng serve --open
- Should you get an error relating to a material component or ngx cookie, run the following commands
npm add @angular/material
npm install ngx-cookie
Should the routing not work for any reason please just add the link to the url manually as follows
- The base url should be 'localhost:4200', This should land you on the Login page.
- Clicking on the log in button should route you to the Home page,
- Clicking on the Sign up text should route you to the Sign up page,
- Clicking on the Forgot Password text should route you to the Forgot Password page.
- Should this not work for whatever reason you can manually access any of the pages as follows:
- Add the name of the page to the end of the base url, preceeded by a '/', e.g. "localhost:4200/Home" where /Home is the name of the page.
- Here are the names of the individual pages:
- Login: This is just the base url, i.e. "localhost:4200" 9 Signup: '/Signup'
- Forgot Password: '/Forgot'
- Home: '/Home'
- Profile: '/Pp'
- Personal Dashboard: '/Dashboard'
- Office Booking: '/Office' (Not working)
To enhance security, we implemented the following features to ensure security for employee data and the system as a whole
- Token-based access control: We used JWT Tokens for our token-based-access control.
The tokens were primarily used to protect our endpoints from any unauthorized access. Only registered users within our system may access these endpoints.
The tokens were implemented as middleware between the client and the endpoint. An unauthorized exception would be thrown if a user attempted to connect without a JWT token
- Role-based access control:
We used a Role-based access control mechanism to prevent unauthorised access to admin endpoints. This was just another layer of security on top of the JWT middleware. In the event someone has their token compromised, the role-based access control measures will prevent that person from going any further.
- Backend input validators:
We use validator functions in the backend to sanitize the data we receive from the outside world. It's very important that we validate the data that we are receiving as our code is very exposed to SQL and SQL Injection as a result.
- Hashing passwords:
Our system doesn't store passwords as plain text but stores their hashes. Compared to encryption, hashing is not reversible, hence why it's usually most preferred
The hash algorithm we use is Bcrypt. This is a robust algorithm that can withstand rainbow table attacks and Brute force attacks. Another perk of the algorithm is it's internal salting. This makes passwords hard to crack, as the salts are randomised.
- Registration: new users can register and choose their roles.
- Login: existing users can login and continue with their progress.
- View workhours: Users can view their weekly workhours on our dashboard.
- Password reset and recovery works as well.
- The profile page and updating of details: The routes broke at some point and we were unable to navigate to some of the pages.
- Number of hours worked tracker: The function isn't plugged into the database. Meaning the user is viewing a static number.
> git branch -a
The above command is used to view all branches.
> git flow feature start my_feature
The above command is used to create a feature (my_feature) branch from the develop branch.
> git flow feature finish my_feature
The above command is used to merge the feature branch (my_feature) into the develop branch.
> git pull origin develop
The above command is used to pull code from the remote develop branch to the local current branch
> git push origin develop
The above command is used to push code from the current local branch to origin develop
> git pull origin main
The above command is used to pull code from the remote main branch to the local current branch
This was made in my_feature