Skip to content

Latest commit

Β 

History

233 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ WorkNest

Enterprise Multi-Tenant Company Management Platform

A modern SaaS platform built for organizations to manage employees, projects, teams, tasks, HR operations, recruitment, communication, analytics, and collaboration β€” all within isolated multi-tenant workspaces.

Java Spring Boot React TypeScript MySQL Docker JWT WebSocket

GitHub stars GitHub forks GitHub issues GitHub license


πŸ“– Overview

WorkNest is a modern enterprise Software-as-a-Service (SaaS) platform that enables multiple organizations to operate independently inside a single application while maintaining complete data isolation.

Every registered company receives its own dedicated tenant database, allowing organizations to securely manage:

  • Employees
  • Departments
  • Teams
  • Projects
  • Tasks
  • Recruitment
  • Attendance
  • Leave Management
  • Performance
  • Notifications
  • Real-time Chat
  • Announcements
  • Reports
  • Analytics

without sharing data with any other organization.

The platform is designed around multi-tenant architecture, making it suitable for commercial SaaS deployment where hundreds or even thousands of organizations can be served from a single application.


✨ Key Features

🏒 Enterprise SaaS Platform

  • Multi-tenant architecture
  • Organization onboarding
  • Automatic tenant provisioning
  • Dedicated tenant databases
  • Secure tenant isolation
  • Platform administration

πŸ‘₯ Employee Management

  • Employee Profiles
  • Departments
  • Designations
  • Teams
  • Reporting Managers
  • Employment History
  • Documents
  • Employee Search
  • Employee Directory

πŸ“ Project Management

  • Project Lifecycle
  • Milestones
  • Team Assignment
  • Progress Tracking
  • Deadlines
  • Attachments
  • Project Statistics

βœ… Task Management

  • Kanban Board
  • Task Priorities
  • Task Status
  • Task Comments
  • File Attachments
  • Due Dates
  • Activity Timeline
  • Assignment Workflow

πŸ’¬ Real-Time Collaboration

  • Team Chat
  • Project Conversations
  • Instant Notifications
  • WebSocket Messaging
  • STOMP Protocol
  • Online Presence

πŸ“’ Organization Communication

  • Announcements
  • Company Notifications
  • Team Notifications
  • Read Receipts
  • Broadcast Messages

πŸ“… Attendance

  • Daily Attendance
  • Check In
  • Check Out
  • Attendance Reports
  • Attendance Analytics

πŸ– Leave Management

  • Leave Requests
  • Leave Approval Workflow
  • Leave Types
  • Leave Balance
  • Leave History

🎯 Recruitment

  • Job Vacancies
  • Applicant Tracking
  • Interview Scheduling
  • Candidate Pipeline
  • Recruitment Dashboard

πŸ“Š Analytics

  • Organization Dashboard
  • Employee Statistics
  • Project Analytics
  • Attendance Analytics
  • Recruitment Analytics
  • Performance Metrics
  • Reports

πŸ” Authentication & Security

  • JWT Authentication
  • Refresh Tokens
  • Role Based Access Control (RBAC)
  • Secure Password Hashing
  • Protected REST APIs
  • Tenant Isolation
  • CORS Protection
  • CSRF Protection
  • Spring Security

πŸ— Architecture

                    Internet
                        β”‚
                        β”‚
                Reverse Proxy
             (Traefik / Nginx)
                        β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                               β”‚
        β”‚                               β”‚
 Frontend (React)                 Spring Boot API
        β”‚                               β”‚
        β”‚                     Authentication
        β”‚                     Authorization
        β”‚                     Tenant Resolver
        β”‚                     Business Logic
        β”‚                               β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                Platform Database
              (platform_master)
                        β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚               β”‚               β”‚
        β”‚               β”‚               β”‚
   tenant_alpha     tenant_beta     tenant_gamma
      MySQL            MySQL            MySQL

🌍 Multi-Tenant Architecture

Unlike traditional applications where every customer shares the same tables, WorkNest provides complete tenant isolation.

Platform
β”‚
β”œβ”€β”€ platform_master
β”‚      β”‚
β”‚      β”œβ”€β”€ Company A
β”‚      β”œβ”€β”€ Company B
β”‚      β”œβ”€β”€ Company C
β”‚      └── ...
β”‚
β”œβ”€β”€ tenant_company_a
β”‚      β”œβ”€β”€ employees
β”‚      β”œβ”€β”€ projects
β”‚      β”œβ”€β”€ tasks
β”‚      β”œβ”€β”€ chats
β”‚      └── ...
β”‚
β”œβ”€β”€ tenant_company_b
β”‚      β”œβ”€β”€ employees
β”‚      β”œβ”€β”€ projects
β”‚      β”œβ”€β”€ tasks
β”‚      └── ...
β”‚
└── tenant_company_c

Each tenant receives:

  • Dedicated database
  • Dedicated datasource
  • Independent connection pool
  • Complete data isolation
  • Independent transactions
  • Independent caching

⚑ Technology Stack

Backend

Technology Version
Java 21
Spring Boot 3.3
Spring Security 6
Spring Data JPA Latest
Hibernate 6
MySQL 8
JWT 0.11
STOMP Latest
WebSocket Spring
Maven Latest

Frontend

Technology Version
React 19
TypeScript 5
Vite Latest
Tailwind CSS Latest
React Router Latest
Axios Latest

Infrastructure

  • Docker
  • Docker Compose
  • Dokploy
  • Traefik
  • GitHub Actions (planned)
  • Supabase Storage
  • SMTP
  • Let's Encrypt

πŸ“‚ Project Structure

WorkNest
β”‚
β”œβ”€β”€ WorkNest-Service-Springboot
β”‚
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ auth
β”‚   β”œβ”€β”€ config
β”‚   β”œβ”€β”€ security
β”‚   β”œβ”€β”€ master
β”‚   β”œβ”€β”€ tenant
β”‚   β”œβ”€β”€ websocket
β”‚   β”œβ”€β”€ notification
β”‚   β”œβ”€β”€ recruitment
β”‚   β”œβ”€β”€ employee
β”‚   β”œβ”€β”€ project
β”‚   β”œβ”€β”€ task
β”‚   β”œβ”€β”€ attendance
β”‚   β”œβ”€β”€ leave
β”‚   β”œβ”€β”€ analytics
β”‚   β”œβ”€β”€ reports
β”‚   β”œβ”€β”€ storage
β”‚   └── common
β”‚
β”œβ”€β”€ docker
β”œβ”€β”€ docs
β”œβ”€β”€ scripts
β”œβ”€β”€ pom.xml
└── README.md

🎯 Design Principles

WorkNest follows enterprise software engineering principles:

  • Clean Architecture
  • Layered Architecture
  • Domain Driven Design
  • SOLID Principles
  • Repository Pattern
  • DTO Pattern
  • Dependency Injection
  • Secure by Default
  • Stateless REST APIs
  • Production Ready Logging
  • Container Ready
  • Cloud Native Design

πŸš€ Why WorkNest?

Unlike many internal HR systems, WorkNest is designed as a true SaaS platform.

βœ” Multi-Tenant

βœ” Enterprise Security

βœ” Horizontal Scalability

βœ” Cloud Ready

βœ” Container Ready

βœ” Production Ready

βœ” Docker Native

βœ” Modern REST APIs

βœ” Real-Time Communication

βœ” Modular Architecture

βœ” Role Based Access Control

βœ” Automatic Tenant Provisioning

βœ” Enterprise Authentication


πŸ“Έ Screenshots

Screenshots will be added soon.

Dashboard

[ Screenshot Here ]

------------------------------------------------

Projects

[ Screenshot Here ]

------------------------------------------------

Kanban Board

[ Screenshot Here ]

------------------------------------------------

Recruitment

[ Screenshot Here ]

------------------------------------------------

Analytics

[ Screenshot Here ]

πŸ“š Documentation

The project documentation is organized under the /docs directory.

Document Description
Architecture System Architecture
Deployment Production Deployment Guide
Docker Docker Setup
API REST API
Security Security Guide
Multi-Tenant Tenant Architecture
Database Database Design

🧩 Backend Modules

The WorkNest backend is organized into modular business domains, enabling independent development, scalability, and maintainability.


πŸ” Authentication Module

Responsible for authentication and identity management.

Features

  • User Login
  • User Logout
  • JWT Access Token
  • Refresh Token
  • Password Reset
  • Email Verification
  • Secure Password Hashing
  • Token Rotation
  • Session Validation

πŸ‘€ Platform Administration

The platform administration module manages the SaaS platform itself.

Responsibilities

  • Platform Admin Management
  • Tenant Registration
  • Tenant Approval
  • Tenant Provisioning
  • Tenant Database Creation
  • Platform Configuration
  • Platform Analytics

🏒 Tenant Management

Each organization is represented as an isolated tenant.

Responsibilities include:

  • Tenant Creation
  • Tenant Configuration
  • Database Provisioning
  • Connection Pool Management
  • Tenant Isolation
  • Tenant Lifecycle

πŸ‘₯ Employee Module

Provides complete employee lifecycle management.

Features

  • Employee Registration
  • Employee Profile
  • Department Assignment
  • Team Assignment
  • Designation Management
  • Employment Status
  • Profile Image
  • Employee Documents
  • Search & Filtering

πŸ‘¨β€πŸ’Ό Department Module

  • Department Creation
  • Department Updates
  • Employee Assignment
  • Department Statistics

πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ Team Module

  • Team Creation
  • Team Leaders
  • Team Members
  • Team Projects
  • Team Chat

πŸ“ Project Module

Project lifecycle management.

Features

  • Create Project
  • Update Project
  • Archive Project
  • Project Status
  • Milestones
  • Members
  • Progress Tracking

βœ… Task Module

Powerful Kanban-based task management.

Features

  • Task Creation
  • Assignment
  • Priorities
  • Due Dates
  • Labels
  • Comments
  • Attachments
  • Activity Timeline
  • Status Updates

Task States

TODO

↓

IN PROGRESS

↓

REVIEW

↓

DONE

πŸ’¬ Chat Module

Real-time communication powered by WebSockets.

Supports:

  • Team Chat
  • Project Chat
  • Direct Messaging
  • Read Status
  • Message History
  • Notifications

πŸ”” Notification Module

Event-driven notification system.

Examples:

  • New Task
  • Task Assigned
  • Leave Approved
  • Interview Scheduled
  • Employee Joined
  • Announcement Published

πŸ“’ Announcement Module

Broadcast organization-wide announcements.

Supports:

  • Rich Text
  • Priority Levels
  • Attachments
  • Audience Targeting

πŸ“… Attendance Module

Employee attendance management.

Features:

  • Check In
  • Check Out
  • Attendance History
  • Reports
  • Analytics

🌴 Leave Module

Leave management workflow.

Features

  • Leave Requests
  • Leave Types
  • Approvals
  • Rejections
  • Leave Balance
  • History

🎯 Recruitment Module

Applicant Tracking System (ATS)

Features

  • Job Positions
  • Candidates
  • Interview Scheduling
  • Interview Feedback
  • Hiring Pipeline
  • Candidate Documents

πŸ“ˆ Reports Module

Generates organization reports.

Includes

  • Employee Reports
  • Attendance Reports
  • Leave Reports
  • Recruitment Reports
  • Project Reports

πŸ“Š Analytics Module

Business intelligence dashboard.

Provides

  • KPIs
  • Employee Analytics
  • Productivity
  • Recruitment Insights
  • Attendance Statistics

☁ Storage Module

File management using Supabase Storage.

Supports

  • Images
  • Documents
  • Attachments
  • Reports

πŸ”’ Security Architecture

Security is implemented across multiple layers.

                Request

                   β”‚

                   β–Ό

          Spring Security Filter

                   β”‚

                   β–Ό

            CORS Validation

                   β”‚

                   β–Ό

             JWT Validation

                   β”‚

                   β–Ό

         Tenant Resolution Filter

                   β”‚

                   β–Ό

          Authorization Check

                   β”‚

                   β–Ό

            Controller Layer

                   β”‚

                   β–Ό

             Business Logic

                   β”‚

                   β–Ό

              Database

Authentication Flow

User

 β”‚

 β”‚ Login

 β–Ό

Spring Security

 β”‚

 β–Ό

Authentication Manager

 β”‚

 β–Ό

UserDetailsService

 β”‚

 β–Ό

Database

 β”‚

 β–Ό

JWT Generation

 β”‚

 β–Ό

Access Token

Refresh Token

 β”‚

 β–Ό

Client

Authorization Model

WorkNest uses Role-Based Access Control (RBAC).

Platform Roles

PLATFORM_ADMIN

Tenant Roles

TENANT_ADMIN

ADMIN

HR

MANAGER

TEAM_LEAD

EMPLOYEE

Each API endpoint is protected based on user roles.


🏒 Multi-Tenant Request Lifecycle

Every request passes through tenant resolution before accessing business data.

Incoming Request

        β”‚

        β–Ό

Extract Tenant Header

        β”‚

        β–Ό

Validate JWT

        β”‚

        β–Ό

Load Tenant

(platform_master)

        β”‚

        β–Ό

Resolve DataSource

        β”‚

        β–Ό

Tenant Database

        β”‚

        β–Ό

Execute Business Logic

πŸ—„ Database Architecture

                     MySQL Server

                           β”‚

      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”

      β”‚                    β”‚                    β”‚

platform_master     tenant_companyA     tenant_companyB

      β”‚                    β”‚                    β”‚

      β”‚                    β”‚                    β”‚

 Platform Tables      Business Data      Business Data

Master Database

Stores platform-wide information.

Typical entities:

  • Platform Users
  • Platform Roles
  • Tenants
  • Refresh Tokens
  • Tenant Metadata

Tenant Database

Each tenant contains its own business data.

Typical entities:

  • Employees
  • Departments
  • Teams
  • Projects
  • Tasks
  • Chat
  • Notifications
  • Leave
  • Attendance
  • Recruitment

πŸ”„ Tenant Provisioning Workflow

Register Company

      β”‚

      β–Ό

Validate Input

      β”‚

      β–Ό

Create Tenant Record

(platform_master)

      β”‚

      β–Ό

Create Database

tenant_company

      β”‚

      β–Ό

Initialize Schema

      β”‚

      β–Ό

Seed Default Data

      β”‚

      β–Ό

Create Admin User

      β”‚

      β–Ό

Tenant Ready

πŸ“¦ Package Structure

src/

β”œβ”€β”€ auth/
β”œβ”€β”€ common/
β”œβ”€β”€ config/
β”œβ”€β”€ exception/
β”œβ”€β”€ master/
β”‚   β”œβ”€β”€ controller/
β”‚   β”œβ”€β”€ entity/
β”‚   β”œβ”€β”€ repository/
β”‚   └── service/
β”‚
β”œβ”€β”€ notification/
β”œβ”€β”€ security/
β”‚   β”œβ”€β”€ filter/
β”‚   β”œβ”€β”€ jwt/
β”‚   └── config/
β”‚
β”œβ”€β”€ storage/
β”œβ”€β”€ tenant/
β”‚   β”œβ”€β”€ attendance/
β”‚   β”œβ”€β”€ employee/
β”‚   β”œβ”€β”€ leave/
β”‚   β”œβ”€β”€ project/
β”‚   β”œβ”€β”€ recruitment/
β”‚   β”œβ”€β”€ reports/
β”‚   β”œβ”€β”€ task/
β”‚   └── analytics/
β”‚
β”œβ”€β”€ websocket/
└── Main.java

πŸ”„ Request Lifecycle

Browser

↓

Traefik

↓

Spring Boot

↓

Security Filter

↓

JWT Filter

↓

Tenant Filter

↓

Controller

↓

Service

↓

Repository

↓

JPA

↓

MySQL

πŸ“‘ WebSocket Architecture

Client

 β”‚

 β–Ό

WebSocket

 β”‚

 β–Ό

STOMP Endpoint

 β”‚

 β–Ό

Message Broker

 β”‚

 β–Ό

Topic

 β”‚

 β–Ό

Subscribed Clients

Supported capabilities:

  • Live Chat
  • Notifications
  • Team Messaging
  • Project Discussions

βœ‰ Email System

Supports SMTP integration for:

  • Welcome Emails
  • Password Reset
  • Interview Invitations
  • Leave Notifications
  • System Alerts

πŸ“ File Storage

The application uses Supabase Storage.

Supported file types:

  • Images
  • PDFs
  • Office Documents
  • ZIP Files

Maximum upload size is configurable.


πŸ“ˆ Scalability

Designed for cloud-native deployment.

Current architecture supports:

  • Multiple Organizations
  • Multiple Databases
  • Docker
  • Dokploy
  • Reverse Proxies
  • HTTPS
  • Cloud Storage
  • Horizontal Frontend Scaling

πŸš€ Getting Started

This guide walks you through setting up the WorkNest backend for local development and production deployment.


πŸ“‹ Prerequisites

Ensure the following software is installed before starting.

Software Version
Java 21+
Maven 3.9+
MySQL 8.0+
Git Latest
Docker Latest (optional)
Docker Compose Latest (optional)
IntelliJ IDEA Recommended

πŸ’» Clone Repository

git clone https://github.com/YOUR_USERNAME/WorkNest-Service-Springboot.git

cd WorkNest-Service-Springboot

βš™ Environment Configuration

Create a local environment file.

cp .env.example .env

Configure the values according to your environment.

Example:

#############################################
# APPLICATION
#############################################

SPRING_PROFILES_ACTIVE=dev

#############################################
# DATABASE
#############################################

MASTER_DB_HOST=localhost
MASTER_DB_PORT=3306
MASTER_DB_NAME=platform_master
MASTER_DB_USERNAME=root
MASTER_DB_PASSWORD=yourpassword

#############################################
# JWT
#############################################

JWT_SECRET=YOUR_BASE64_SECRET

JWT_ACCESS_EXPIRATION_MS=900000
JWT_REFRESH_EXPIRATION_MS=604800000

#############################################
# SUPABASE
#############################################

SUPABASE_URL=https://your-project.supabase.co

SUPABASE_SERVICE_ROLE_KEY=your-service-role-key

SUPABASE_BUCKET=worknest

#############################################
# EMAIL
#############################################

MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=example@gmail.com
MAIL_PASSWORD=yourpassword

#############################################
# APPLICATION URLS
#############################################

PUBLIC_WEB_BASE_URL=http://localhost:5173

PASSWORD_RESET_LINK_BASE_URL=http://localhost:5173/reset-password

#############################################
# CORS
#############################################

ALLOWED_ORIGINS=http://localhost:5173

WS_ALLOWED_ORIGINS=http://localhost:5173

πŸ—„ MySQL Setup

Start MySQL.

Create the master database.

CREATE DATABASE platform_master;

No tenant databases need to be created manually.

WorkNest automatically provisions new tenant databases during organization registration.


🧹 Clean Project

mvn clean

πŸ”¨ Compile

mvn compile

β–Ά Run Application

mvn spring-boot:run

Expected output:

Started Main

Backend API:

http://localhost:8080

Swagger (Development)

http://localhost:8080/swagger-ui/index.html

Actuator

http://localhost:8080/actuator/health

πŸ–₯ Running with IntelliJ IDEA

Open

File
    Open Project

Select

WorkNest-Service-Springboot

Wait until Maven imports all dependencies.

Run

Main.java

or

Spring Boot Configuration

πŸ’™ Running with VS Code

Install extensions

  • Java Extension Pack
  • Spring Boot Extension Pack
  • Maven for Java

Run

Main.java

or

mvn spring-boot:run

🐳 Docker

Build image

docker build -t worknest-backend .

Run container

docker run \
-p 8080:8080 \
--env-file .env \
worknest-backend

🐳 Docker Compose

Start

docker compose up -d

Stop

docker compose down

View logs

docker compose logs -f

Restart

docker compose restart

πŸ“‚ Important Configuration Files

application.yml

application-dev.yml

application-prod.yml

.env.example

Dockerfile

docker-compose.yml

🌐 Profiles

Development

dev

Uses

  • Local MySQL
  • Local .env
  • Development Logging

Run

mvn spring-boot:run

Production

prod

Uses

  • Environment Variables
  • External MySQL
  • Optimized Logging

Run

SPRING_PROFILES_ACTIVE=prod

πŸ“¦ Building Production JAR

mvn clean package

Generated

target/

worknest-service.jar

Run

java -jar worknest-service.jar

πŸ”‘ Environment Variables

Required

Variable Required
MASTER_DB_HOST βœ…
MASTER_DB_PORT βœ…
MASTER_DB_NAME βœ…
MASTER_DB_USERNAME βœ…
MASTER_DB_PASSWORD βœ…
JWT_SECRET βœ…
SUPABASE_URL βœ…
SUPABASE_SERVICE_ROLE_KEY βœ…
MAIL_HOST βœ…
MAIL_USERNAME βœ…
MAIL_PASSWORD βœ…

πŸ”’ JWT Secret

Generate a secure Base64 secret.

Linux

openssl rand -base64 64

PowerShell

[Convert]::ToBase64String((1..64 | ForEach-Object {Get-Random -Maximum 256}))

πŸ“‘ Health Endpoints

Liveness

GET

/actuator/health/liveness

Readiness

GET

/actuator/health/readiness

General Health

GET

/actuator/health

πŸ“š API Documentation

Swagger UI

/swagger-ui/index.html

OpenAPI

/v3/api-docs

πŸ“¨ Default Platform Administrator

When bootstrap is enabled

Email

admin@worknest.com

Password

Configured through environment variables

Disable bootstrap after the first deployment.


🏒 Automatic Tenant Provisioning

When a new company registers:

Company Registration

↓

Validate Request

↓

Create Platform Record

↓

Create MySQL Database

↓

Create Tables

↓

Seed Initial Data

↓

Create Administrator

↓

Ready

No manual SQL scripts are required for tenant creation.


πŸ” Verify Installation

Open

http://localhost:8080/actuator/health

Expected response

{
  "status": "UP"
}

πŸ§ͺ Running Tests

Run all tests

mvn test

Run integration tests

mvn verify

πŸ“ Development Workflow

Clone Repository

↓

Configure .env

↓

Create platform_master

↓

mvn clean

↓

mvn compile

↓

mvn spring-boot:run

↓

Develop

↓

Test

↓

Commit

↓

Push

↓

Deploy

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages