This is a simple project for a web platform that allows recruiters to submit job offers, and for candidates to have access to and apply for job positions.
Frameworks used:
IDEs:
Additional tools:
- Class Diagram:
- Global architecture:
We set up the backend project using Spring Initializr, as a Maven project, and Java for the language.
Add Maven dependencies:
- Spring Web: to build our RESTful application using Spring MVC, for a Model-View-Controller design pattern.
- Spring Data JPA: to persist data into our database.
- PostgreSQL Driver: to allow our Java application to connect to the PostgreSQL database.
The application will be responding on port 8080.
Each entity of our class diagram will have a number of specific classes and interfaces dedicated to it organised in layers:
- Model: represents a data entity.
- Repository or DAO(Data Access Object): defines the contract for accessing and manipulating entities in the database.
- Service Interface: defines the contract for interacting with entities using CRUD operations and other business logic related to the entity.
- Service Implementation: implements the service interface.
- Controller: handles HTTP requests related to the entity.
Class diagram of the MVC pattern for an entity:
In order to allow candidates to upload their CV, as well as for recruiters to download them, we established a file system. All uploaded files will be stored in a separate folder.
To configure the path toward that folder, add this line of code in the configuration file application.properties
:
file.upload.directory=/path/to/upload/directory/
Create a new Database from pgAdmin.
In application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/DATABASE_NAME
spring.datasource.username=USERNAME
spring.datasource.password=PASSWORD
spring.jpa.hibernate.ddl-auto=update
spring.datasource.driver-class-name=org.postgresql.Driver
- Create an Angular project:
ng new project-name
- You can run the project using the command:
ng serve
- The application will be running on port 4200. To view its interface, simply access the URL: http://localhost:4200
The frontend layout is composed of different blocs, following the MVC pattern as well.
- The code for each interface is contained within a component, along with its html, css and ts files.
- Since we're using typescript which is a staticly typed language, we can define in a model layer, the different entities already establshed in our backend.
- We can implement the business logic in a service layer, with service classes, where we can call the server with HTTP requests.
App layout:
You can find the different views of the application in the folder assets/views
To test out the code yourself:
- Clone the project:
git clone https://github.com/Cristal32/recruitment_platform.git
- Execute the docker compose script (that will rely on docker-compose.yml) that will build images for the postgres database, backend and frontend, and starts the containers for each service:
docker compose up -d
-
Go to the URL:
http://localhost:4200/
to access the client side app. -
Since this project is still incomplete especially with the authentication part, there is no user management yet, which might hinder testing the app's full functionalities. I'll make sure to complete it in the near future. As such, for now, before testing the functionalities, a temporary user needs to be created first:
{
id: 1,
email: 'mery@gmail.com',
pwd: 'mery32',
name: 'Meryem',
lastName: 'El Karati'
};
This user will represent the current authenticated user, we can create many others, and switch between them to represent the current user in the frontend side's global service
This project is unfinished. It still needs a lot more refinement, and we have yet to implement the security aspect by implementing authentication and securing access to all endpoints using the Spring Security dependency.