Skip to content

jookzie/varnabuslines

Repository files navigation

Varna Buslines

The following project was my Semester 3 assignment - to build a full stack application. In other words, a replica of the existing system here: https://varnatraffic.com. You can learn more about it from the documentation available. The current state of the project is unfinished, however its aim was for me to learn many software engineering concepts, such as:

  • Java
  • Spring framework
  • Maven/Gradle
  • Hibernate (ORM)
  • Javascript
  • React.js
  • UI/UX development
  • Docker
  • CI/CD
  • GitLab workflow
  • Agile concepts
  • C4 diagram
  • Research using the DOT framework
  • SonarQube quality assurance
  • JWT Authentication & Authorization

Some information might mismatch with what is available. Here are the differences:

  • The project was done using GitLab, but is distributed using GitHub.
  • There is no active CI/CD, although the script is available.
  • The original git history is not available.
  • There is no source for the documents (doc/src).
  • No UX Report & Feedback (privacy reasons)

You can run the project by just using Docker. Build instructions can be found down below. If you have any questions about the project, feel free to ask!

Progress

  • Backend -
  • Frontend -
  • Unit tests -

What is what in the project

You can find further information about the fundamentals with the provided documentation.

Documentation

Prominent features

  • Docker integration
  • Token-based authentication & authorization
  • WebSockets support
  • A real world map overview using Leaflet + OpenStreetMap
  • CI/CD pipeline with SonarQube quality assurance
  • Password hashing using Argon2
  • Database persistence using an ORM (MySQL + Hibernate)
  • Frontend and backend testing

Features to be added

  • Real world integration
  • Route advisor
  • TypeScript rewrite

Build instructions

  1. Clone the repository with git:
git clone https://github.com/jookzie/varnabuslines --depth=1
cd ./varnabuslines/
  1. Ensure you have Docker installed: https://www.docker.com/products/docker-desktop/
  2. Open a terminal and execute:
docker compose up

Alternatively, you can run the production build

docker compose -f ./docker-compose.prod.yml up
  1. Visit http://localhost:80 in your browser.

You can use phpMyAdmin on http://localhost:8081 to view the database.

Mock data

Why?

Having data ready to test features on is a part of the presentation process. Best practice for this is to have a public database, which any client can use. Due to the project's goal being for educational purposes, hosting a database on a public domain is out of scope, primarily due to funding limitation. Fontys' free database hosting has been considered, but has failed to comply with the project's demands, detailed here:

  • Risk locking out of the database by having too many connections open
  • Limited privileges to increase max_user_connections (currently being 10) OR increase wait_timeout of the connection pool.
  • Unneccessary hassle of connecting to a VDI manually, with no provided support for app integration

How?

A current workaround is to load mock data once by manually executing an SQL script on the database.

  1. Start the project using the build instructions provided
  2. Connect to the database using the provided phpMyAdmin.
  3. Copy over and execute the script under scripts/mock-data.sql
  4. Done! If any of the script commands fail, that would mean that the data is already there.

Neccessary credentials

There are two roles in the application: users and administrators (also known as admins). To access CRUD operations, you need an admin account. By design, administrators are created by other administrators, which means that the first administrator account should be hard-coded into the database. If you have loaded the mock data presented above, you will be given an administrator accoount.

  • Email: admin@mock.com
  • Password: password

Else, you can follow these instructions:

  1. Create a regular user account
  2. Open the phpMyAdmin client
  3. Go to the user table
  4. Change the role value of your account from 0 to 1
  5. Done! Your account has become an administrator one.

About

Traffic overview website using React and Spring

Resources

License

Stars

Watchers

Forks

Languages