How dar3d3v1l/hiresphere works
1. Overall shape
- This is a single Spring Boot 3 monolith for a job portal, using server-side rendering rather than a separate frontend SPA.
- The main runtime path is: browser request → Spring MVC controller → service layer → JPA repository → MySQL → Thymeleaf view response.
2. Presentation layer
- UI pages live in src/main/resources/templates and are rendered with Thymeleaf.
- Static assets are served from src/main/resources/static, including Bootstrap-related CSS, icons/fonts, JavaScript, and the Summernote editor used for rich-text job content.
- There is no dedicated API layer exposed for a separate client; the controllers appear to back HTML pages directly.
3. Web and routing layer
- Controllers are organized by business area: HomeController, GlobalSearchController, UsersController, JobPostActivityController, JobSeekerApplyController, JobSeekerProfileController, and RecruiterProfileController.
- These controllers likely handle page navigation, form submissions, search, job posting, applications, and profile management.
- The MvcConfig class suggests custom view routing or resource handling, while CustomAuthenticationSuccessHandler handles post-login redirects.
4. Security and identity
- Authentication is handled by Spring Security via WebSecurityConfig.
- CustomUserDetailsService and CustomUserDetails bridge application users to Spring Security’s authentication model.
- Users, UsersType, and related services/repositories indicate role-based access, likely distinguishing recruiter and job seeker behavior.
- The success handler implies role-aware landing pages after login, which is a key architectural boundary.
5. Domain model
- Core entities define the business model: Users, UsersType, RecruiterProfile, JobSeekerProfile, JobCompany, JobLocation, Skills, JobPostActivity, JobSeekerApply, and JobSeekerSave.
- The model is split between account identity, recruiter profile data, seeker profile data, job postings, applications, and saved jobs.
- RecruiterJobsDto and IRecruiterJobs suggest read-optimized projection objects for recruiter-facing listings.
6. Persistence layer
- Each major domain area has a dedicated Spring Data repository under repository/.
- Repositories manage database access for users, user types, recruiter profiles, job seeker profiles, applications, saved jobs, and job posts.
- The DB is MySQL, and schema/user setup is stored separately in DB_Scripts, indicating the app expects an initialized relational schema.
7. Service layer
- Services encapsulate application logic and sit between controllers and repositories.
- The service set mirrors the domain: UsersService, UsersTypeService, RecruiterProfileService, JobSeekerProfileService, JobPostActivityService, and CustomUserDetailsService.
- This is the main transaction/business boundary; controllers should be thin and delegate work here.
8. Job seeker flow
- A seeker typically moves through profile creation, job search, saving jobs, and applying to jobs.
- JobSeekerProfileController and JobSeekerProfileService manage seeker profile data.
- GlobalSearchController and HomeController support discovery, while JobSeekerSave and JobSeekerApply model bookmark and application actions.
- saved-jobs.html, candidate-profile.html, and job-seeker-profile.html reflect these seeker-oriented screens.
9. Recruiter flow
- Recruiters manage their own profile and post jobs through RecruiterProfileController and JobPostActivityController.
- The recruiter domain centers on JobPostActivity, RecruiterProfile, and related DTO/projection objects for listing jobs.
- dashboard.html and add-jobs.html indicate a back-office style recruiter workspace for creating and reviewing postings.
10. Cross-cutting utilities
- FileUploadUtil suggests the app supports file uploads, likely for profile images, resumes, or job/company assets, and stores them outside the main relational data.
- This creates an important boundary between database persistence and filesystem storage.
- The app also includes a custom test bootstrap in JobPortalApplicationTests, but the repository tree does not show a separate integration-test infrastructure.
11. Build and deployment assumptions
- The project is Maven-based and uses the Maven wrapper for reproducible builds.
- The repository is designed to run as a single deployable Spring Boot application with embedded server behavior.
- External dependencies that materially shape the architecture are Spring MVC, Spring Security, Thymeleaf, JPA/Hibernate, and MySQL.
12. How to draw the architecture
- Represent three main layers inside one application boundary: web/UI, service/business, and persistence/data.
- Add a separate security track cutting across the web and user-service layers.
- Show MySQL and the filesystem as the two external storage targets.
- Split the domain into recruiter, job seeker, job posting, and shared user/account subsystems, with search/home as the entry and discovery path.
Main entry points: templates Thymeleaf Views · 01-jobportal.sql MySQL · JobPostActivityService.java Job Post Service · MvcConfig.java MVC Config
Components 33
Spring Boot App
Single deployable job-portal monolith
- JobPortal · Spring Boot entrypoint for the monolith
src/main/java/com/jobportal/JobPortalApplication.java
Web & UI
Controllers, Thymeleaf views, and static assets
- Home · Landing pages and public entry flow
src/main/java/com/jobportal/controllers/HomeController.java - Search · Global job search and discovery
src/main/java/com/jobportal/controllers/GlobalSearchController.java - Users · Registration and account-facing routes
src/main/java/com/jobportal/controllers/UsersController.java - Recruiter · Recruiter profile management routes
src/main/java/com/jobportal/controllers/RecruiterProfileController.java - Job Posts · Job creation and posting workflows
src/main/java/com/jobportal/controllers/JobPostActivityController.java - Seeker Profile · Job seeker profile pages and updates
src/main/java/com/jobportal/controllers/JobSeekerProfileController.java - Apply · Application and saved-job actions
src/main/java/com/jobportal/controllers/JobSeekerApplyController.java - MVC Config · View routing and resource handling
src/main/java/com/jobportal/config/MvcConfig.java - Thymeleaf Views · Server-rendered HTML pages
src/main/resources/templates - Static Assets · CSS, JavaScript, fonts, and editor assets
src/main/resources/static
Security
Authentication and role-aware login flow
- Security Config · Spring Security rules and login setup
src/main/java/com/jobportal/config/WebSecurityConfig.java - Login Redirect · Role-aware post-login landing selection
src/main/java/com/jobportal/config/CustomAuthenticationSuccessHandler.java - User Details · Bridges users into Spring Security
src/main/java/com/jobportal/services/CustomUserDetailsService.java - Principal · Application-backed user principal
src/main/java/com/jobportal/util/CustomUserDetails.java
Domain Services
Business logic by user and job workflow
- Users Service · Account and identity operations
src/main/java/com/jobportal/services/UsersService.java - User Types · Role and account-type logic
src/main/java/com/jobportal/services/UsersTypeService.java - Recruiter Service · Recruiter profile lifecycle
src/main/java/com/jobportal/services/RecruiterProfileService.java - Seeker Service · Job seeker profile lifecycle
src/main/java/com/jobportal/services/JobSeekerProfileService.java - Job Post Service · Job posting and listing logic
src/main/java/com/jobportal/services/JobPostActivityService.java
Persistence
JPA entities and repositories
- Users · Account identity and credentials
src/main/java/com/jobportal/entity/Users.java - UsersType · Role/type lookup entity
src/main/java/com/jobportal/entity/UsersType.java - Recruiter Profile · Recruiter account profile data
src/main/java/com/jobportal/entity/RecruiterProfile.java - Seeker Profile · Job seeker profile data
src/main/java/com/jobportal/entity/JobSeekerProfile.java - Job Post · Job posting record and content
src/main/java/com/jobportal/entity/JobPostActivity.java - Applications · Job application records
src/main/java/com/jobportal/entity/JobSeekerApply.java - Saved Jobs · Bookmarked job records
src/main/java/com/jobportal/entity/JobSeekerSave.java - Job Repository · Job post persistence access
src/main/java/com/jobportal/repository/JobPostActivityRepository.java - Recruiter Repo · Recruiter profile persistence access
src/main/java/com/jobportal/repository/RecruiterProfileRepository.java - Seeker Repo · Job seeker profile persistence access
src/main/java/com/jobportal/repository/JobSeekerProfileRepository.java - Users Repo · Account persistence access
src/main/java/com/jobportal/repository/UsersRepository.java
External Storage
Database and filesystem boundaries
- MySQL · Primary relational datastore
DB_Scripts/01-jobportal.sql - File Store · Upload target for resumes and assets
src/main/java/com/jobportal/util/FileUploadUtil.java
Connections 30
- JobPortal → Security Config: boots with · Application starts under the security configuration
- JobPortal → MVC Config: registers · Loads MVC and view routing configuration
- Home → Thymeleaf Views: renders · Serves server-side pages
- Search → Thymeleaf Views: renders · Returns search and detail pages
- Users → Thymeleaf Views: renders · Handles registration and account screens
- Recruiter → Thymeleaf Views: renders · Handles recruiter profile pages
- Job Posts → Thymeleaf Views: renders · Handles job posting forms and pages
- Seeker Profile → Thymeleaf Views: renders · Handles seeker profile pages
- Apply → Thymeleaf Views: renders · Handles apply and saved-jobs screens
- MVC Config → Thymeleaf Views: routes to · Configures template/view behavior
- MVC Config → Static Assets: serves · Makes static resources available to the UI
- Security Config → User Details: uses · Security authenticates through custom user lookup
- Login Redirect → Thymeleaf Views: redirects · Sends users to role-specific pages after login
- User Details → Users Service: loads via · Fetches account data for authentication
- User Details → Principal: builds · Maps domain users to security principal
- Users Service → Users Repo: persists via · Manages account data through repository
- Users Service → Users: manages · Creates and updates user accounts
- User Types → UsersType: manages · Handles role/type metadata
- Recruiter Service → Recruiter Repo: persists via · Stores recruiter profile data
- Recruiter Service → Recruiter Profile: manages · Creates and updates recruiter profiles
- Seeker Service → Seeker Repo: persists via · Stores job seeker profile data
- Seeker Service → Seeker Profile: manages · Creates and updates seeker profiles
- Job Post Service → Job Repository: persists via · Stores and queries job posts
- Job Post Service → Job Post: manages · Creates job posting records
- Job Post Service → MySQL: reads/writes · Primary job data persistence
- Recruiter Repo → MySQL: reads/writes · Recruiter profiles in relational storage
- Seeker Repo → MySQL: reads/writes · Seeker profiles in relational storage
- Users Repo → MySQL: reads/writes · Accounts and roles in relational storage
- Apply → File Store: uploads · Supports file-based assets such as resumes
- File Store → Static Assets: separate from · Uploads are outside packaged web assets