Skip to content

Documentation on the project's structure and handover procedures

Notifications You must be signed in to change notification settings

IV1201-Group-2/project-docs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 

Repository files navigation

Project documentation for IV1201 Group 2

This repository contains documentation about the recruitment application project.

The purpose of the project is to develop a secure, robust and scalable recruitment application for an amusement park. The application should be well-architected and documented so that further maintenance by a different team is possible.

The recruitment application allows users to create an account for registering job applications. It allows selecting an area of expertise, years of experience and availability period. For recruiters, it presents an overview of applications that have been submitted. Applications are pending by default and recruiters can choose to either accept or reject them.

The project implements the frontend using a client-side rendering architecture and backend using a REST API. This makes it easy to swap out the frontend (for example, with a mobile app) without modifying the backend.

REST API documentation

The REST APIs are documented in api.md. All APIs follow some common rules but information that is specific to each API (such as the path and parameters) is documented in the apis directory.

Relevant repositories

The frontend browser application is hosted at IV1201-Group-2/client. The repository also contains a Spring Boot server for serving static files.

The backend is implemented as a set of microservices that follow the API specifications. Internally, they're implemented using different languages and frameworks, but they all follow the API rules to provide a consistent experience to frontend developers.

The repository IV1201-Group-2/database contains SQL files for setting up a database compatible with the application.

Deploying to Heroku

Every microservice has slightly different instructions and environment variables for deployment, but these are some general instructions for getting the application set up in Heroku.

Creating applications

These applications need to be created on your Heroku account:

  • application-form-service
  • application-status-service
  • client-service
  • login-service
  • personal-info-service
  • recruiter-service
  • register-service

To create them from the command line, run heroku create {name} in the repositores for the client and backend microservices. If you already have the applications set up, you can use heroku git:remote -a ${name} to associate the repository with a Heroku application.

Use git push heroku main to push the main branch to Heroku. Every microservice has either a Procfile or Dockerfile so no manual setup locally is necessary. Heroku will build the services on their servers.

Creating the database

Follow the instructions at https://devcenter.heroku.com/articles/heroku-postgresql to set up a Postgres database in Heroku. It will be associated with one microsevice, so you can share it with the other services by using heroku addons:attach.

Heroku should automatically set up the DATABASE_URL environment variable. If you have problems with services using too many connections, you can use the DATABASE_MAX_CONNECTIONS variable to limit the connections that a single microservice is allowed to make.

After the database is set up, use the SQL schema in the database repository to set up empty tables for the application.

Generating a JWT secret

The JWT secret is a secret key shared between every microservice to authenticate users without requiring communication with the database or other services. The JWT secret can be any string but to be secure it should be a long and random string that is hard to guess.

You can use the command openssl rand -hex 32 to generate a random 256-bit string. Set the JWT_SECRET variable in every microservice to the resulting string.

Configuring API URLs in frontend

Heroku will assign a random URL to every service, so the URLs need to be manually configured in frontend applications. Follow the instructions in the client README once the backend has been set up.

About

Documentation on the project's structure and handover procedures

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •