Skip to content

About

Full-stack Skill Gap Analyzer built with Java, Spring Boot, MySQL, Thymeleaf and Bootstrap to help students identify skills required for different career roles.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Skill Gap Analyzer (Engineering Students)

A Spring Boot + MySQL + Thymeleaf demo web app. Students pick their branch and target role, enter the skills they already have, and get a skill-gap percentage plus study links (YouTube / Coursera / free resources) for every missing skill.

Tech stack

  • Spring Web (MVC + REST endpoint for AJAX)
  • Spring JDBC (JdbcTemplate — no JPA/Hibernate)
  • Thymeleaf (server-side templates)
  • MySQL Driver
  • Bootstrap 5 (via CDN link in each template's <head> — no npm/build step needed)

Project structure

skill-gap-analyzer/
├── pom.xml
├── src/main/java/com/skillgap/analyzer/
│   ├── SkillGapAnalyzerApplication.java
│   ├── model/        (Role, GapResult, SkillCourse, User, AnalysisHistory, RoleStat, AdminAnalysisView)
│   ├── repository/   (RoleRepository, UserRepository, AnalysisHistoryRepository — plain JDBC)
│   ├── service/       (SkillGapService - gap calculation logic, unchanged)
│   ├── security/      (PasswordUtil - salted SHA-256 hashing)
│   ├── config/         (AuthInterceptor, AdminInterceptor, WebConfig)
│   └── controller/   (SkillGapController, AuthController, AdminController)
└── src/main/resources/
    ├── application.properties
    ├── schema.sql     (roles table resets every startup; users/analysis_history do not)
    ├── data.sql       (auto-run on every startup, ~90 roles across 11 branches)
    ├── templates/
    │   ├── index.html, result.html, history.html   (regular users)
    │   ├── login.html, register.html
    │   ├── admin.html                                 (admin only)
    │   └── fragments/footer.html                     (shared History/Logout/Admin footer)
    └── static/css/style.css   (small overrides layered on top of Bootstrap CDN)

What's new: Login + Analysis History

  • Register / Login / Logout — session-based auth (no Spring Security dependency needed). Passwords are stored as salted SHA-256 hashes (security/PasswordUtil.java). For a real production app, swap this for spring-boot-starter-security + BCryptPasswordEncoder.
  • Protected pages — /, /analyze, /api/roles, and /history all require login. An AuthInterceptor (see config/) redirects anyone without a session to /login.
  • Persistent history — every analysis you run is saved to analysis_history, tied to your account, and shown on the new My History page (most recent first). The homepage also shows a quick preview of your last 3 analyses with a "View all" link, so your history is visible right away without an extra click.
  • Most Searched Role preview — the homepage shows a "🔥 Most Searched Role" card: the single role analyzed most often across all users, computed with a read-only GROUP BY / COUNT query (AnalysisHistoryRepository.findMostSearchedRole()), along with its core required skills. This is purely a read aggregation over existing history rows — it doesn't create, edit, or move any data.
  • Past analyses are never altered. AnalysisHistoryRepository only ever INSERTs new rows — there is no update/delete path — and the users / analysis_history tables use CREATE TABLE IF NOT EXISTS (not DROP TABLE), so restarting the app never wipes accounts or previously saved reports. Only the read-only roles reference table is reset on startup, exactly as before.
  • The skill-gap calculation itself is untouched — SkillGapService.analyze() is called exactly as before; the controller just also saves the result afterward.

What's new: Admin-only view of all users' data + Bootstrap UI

  • Every page now uses Bootstrap 5 loaded from the CDN (https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css) — no build step, no npm, just a <link> in each template's <head>.
  • History and Logout buttons moved to the footer — every page now shares a single footer fragment (templates/fragments/footer.html), included with th:replace="~{fragments/footer :: appFooter}", so the History/Logout/Admin buttons look and behave identically everywhere.
  • Admin-only dashboard (/admin) — shows a table of every user's analyses (name, email, role, branch, match %, gap %, missing skills, timestamp) plus a "Top Searched Roles" ranking. This is powered by AnalysisHistoryRepository.findAllWithUser(), a read-only join across analysis_history and users.
  • Locked down with two interceptors (config/AuthInterceptor + config/AdminInterceptor): a logged-out visitor is redirected to /login; a logged-in but non-admin user is redirected to / if they try to reach anything under /admin/**. Regular users still only ever see their own history at /history — never other users' data.
  • How to make a user an admin: there's no signup flow for admins on purpose (keeps it safe by default). Register a normal account, then promote it directly in MySQL:
    UPDATE users SET is_admin = TRUE WHERE email = 'you@example.com';
    Log out and back in afterward so the session picks up the change.
  • Top Searched Role preview stays on the analyzer page (the homepage) for all users, unchanged — the admin dashboard additionally shows the full top-10 ranking, not just the single winner.

Setup

1. Install prerequisites

  • JDK 17+
  • Maven (or use the included mvnw if you generate one via Spring Initializr / your IDE)
  • MySQL Server running locally

2. Create the database

You don't need to create tables manually — schema.sql and data.sql run automatically on startup. You only need the database itself to exist:

CREATE DATABASE IF NOT EXISTS skillgap_db;

(The datasource URL also has createDatabaseIfNotExist=true as a safety net.)

3. Configure credentials

Edit src/main/resources/application.properties:

spring.datasource.username=root
spring.datasource.password=your_mysql_password

4. Run the app

cd skill-gap-analyzer
mvn spring-boot:run

Then open: http://localhost:8080

How it works

  1. GET / loads distinct branches from the roles table into a dropdown.
  2. Selecting a branch fires a fetch() call to GET /api/roles?branch=..., which returns JSON and repopulates the role dropdown — no page reload.
  3. Submitting the form (POST /analyze) with branch, role, and the student's comma-separated skills:
    • Looks up the role's required skills from MySQL.
    • Case-insensitively compares them against what the student entered.
    • Calculates match % and gap %.
    • Builds YouTube / Coursera / free-resource search links for every missing skill (generated dynamically, so all ~90 roles / 200+ skills are covered without hardcoding a course catalogue).
  4. result.html renders the report with a progress bar, matched skills, and clickable study links for missing skills.

Extending it

  • Add a students table + login to save each student's analysis history.
  • Add a skill_courses table if you want curated (not auto-generated) links.
  • Add a REST-only API layer (@RestController) if you want a separate frontend (React/Angular) instead of Thymeleaf.

About

Full-stack Skill Gap Analyzer built with Java, Spring Boot, MySQL, Thymeleaf and Bootstrap to help students identify skills required for different career roles.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages