Skip to content

DaGrisa/resource-planning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📅 Resource Planning

Employee capacity planning across projects and departments

Angular .NET SQLite SQL Server


A web application for planning and monitoring employee capacity across projects and departments.

Screenshots

Dashboard — overview cards, planning status, and per-week alerts for over/under-planned employees Dashboard

Employee Overview — color-coded utilization grid across weeks and employees Employee Overview

Project Overview — project utilization vs. weekly budget Project Overview Managers can allocate hours per employee and week, track over- and under-utilization, manage absences, and view planning status from both the employee and project perspective.

Tech Stack

  • Frontend: Angular 21 with Angular Material
  • Backend: .NET 10 Web API with Entity Framework Core
  • Database: SQLite (development) / SQL Server (production)

Prerequisites

Getting Started

Backend

cd backend/ResourcePlanning.Api
dotnet run

The API will start at http://localhost:5113 with Swagger UI at http://localhost:5113/swagger.

On first run, the database is automatically created and the default admin account is seeded (see First Login).

Sample data (employees, departments, projects, allocations) is seeded separately and controlled by the Seed:SampleData setting — see Seed Data below.

Frontend

cd frontend/resource-planning
npm install
ng serve

The app will be available at http://localhost:4200.

First Login

The database is seeded with a default admin account on first startup:

Field Value
Username admin
Password admin123

Navigate to http://localhost:4200/login and sign in with these credentials. Change the password after your first login via the account menu.

The admin account has full access to all features. Additional users with specific roles (DepartmentManager, ProjectManager, Employee) can be created under Master Data → Users.

Seed Data

The admin account is always created on startup if no users exist. All other sample data (employees, departments, projects, allocations) is optional and controlled via appsettings.json:

"Seed": {
  "SampleData": false
}
Value Behaviour
false (default) Only the admin account is created — the app starts with an empty dataset
true 6 employees, 3 departments, 4 projects, capacity allocations, project weekly budgets, and absences for 10 weeks starting from the first startup date are inserted

In appsettings.Development.json this is set to true so a local development environment gets sample data automatically. For staging or production, leave it at false and enter real data through the UI.

Sample data is only inserted once. If employees already exist in the database the seed is skipped, regardless of this setting.

Features

  • Dashboard: Overview cards with planning status, department/project filters, and alerts for over/under-planned employees per week
  • My Planning: Per-employee view of project allocations and weekly utilization — accessible to all roles
  • Employee Management: Create, edit, and deactivate employees with department assignments
  • Department Management: Organize employees into departments with lead managers and supporting managers
  • Project Management: Track customer and internal projects with team assignments
  • Capacity Planning Grid: Visual weekly planning grid with color-coded utilization (green = 80–100%, orange = under, red = over)
  • Project Planning: Plan capacity from the project perspective with weekly budgets
  • Planning Overview: Read-only employee utilization view across weeks
  • Project Overview: Read-only project utilization view across weeks, plus monthly planned/budget view across all projects with workday-based split for cross-month weeks
  • Absence Management: Track employee absences per calendar week and manage single-day holidays that apply to all employees (auto-counted as 1/5 weekly hours)

Roles

Role Access
Admin Full system access; manage users and all data
DepartmentManager Manage assigned departments, employees, and projects
ProjectManager Manage projects they lead
Employee View own planning data only

Database

The application uses Entity Framework Core (code-first) and supports two database providers:

  • SQLite (development) — file at backend/ResourcePlanning.Api/resourceplanning.db, created automatically on first run
  • SQL Server (production) — connection string configured via ConnectionStrings:SqlServer in appsettings.json
  • Auto-migration: Pending migrations are applied automatically on startup for both providers

Local secrets (.env)

Sensitive values are loaded from a .env file in the repository root (gitignored). Copy .env.example and fill in your values:

cp .env.example .env
# .env — never committed
Jwt__Key=your-strong-secret-key-min-32-chars

Double-underscore maps to nested config: Jwt__KeyJwt:Key.

Configuration

Before deploying, set the following values in backend/ResourcePlanning.Api/appsettings.json:

"Jwt": {
  "Key": "REPLACE_WITH_A_STRONG_SECRET_KEY_MIN_32_CHARS"
},
"Seed": {
  "AdminPassword": "CHANGE_THIS_ADMIN_PASSWORD"
},
"Cors": {
  "AllowedOrigins": [ "https://your-frontend-domain.com" ]
},
"Planning": {
  "EmployeeOptimalThresholdPercent": 80,
  "ProjectOptimalThresholdMinPercent": 90,
  "ProjectOptimalThresholdMaxPercent": 110
}

The application will refuse to start if Jwt:Key is still the placeholder value.

Planning thresholds are split by overview type:

  • Planning:EmployeeOptimalThresholdPercent: minimum utilization percentage for employee week status optimal (default 80); above 100 remains over.
  • Planning:ProjectOptimalThresholdMinPercent: lower bound for project week status optimal (default 90).
  • Planning:ProjectOptimalThresholdMaxPercent: upper bound for project week status optimal (default 110).

For projects, percentages below min are under, above max are over, and within [min, max] are optimal.

Database providers

The application supports SQLite (development) and SQL Server (production), selected via appsettings.json:

Setting Value Description
Database:Provider Sqlite Uses SQLite — migrations from Data/Migrations/
Database:Provider SqlServer Uses SQL Server — migrations from Data/MigrationsSqlServer/

Development (appsettings.Development.json) defaults to SQLite with Data Source=resourceplanning.db.

Production (appsettings.json) defaults to SQL Server. Set the connection string before deploying:

"Database": { "Provider": "SqlServer" },
"ConnectionStrings": {
  "SqlServer": "Server=your-server;Database=ResourcePlanning;User Id=sa;Password=your-password;TrustServerCertificate=True;"
}

Managing migrations

# Add a SQLite migration (development)
cd backend/ResourcePlanning.Api
dotnet ef migrations add <Name> --output-dir Data/Migrations

# Add a SQL Server migration (production)
$env:DB_PROVIDER="SqlServer"
dotnet ef migrations add <Name> --output-dir Data/MigrationsSqlServer
$env:DB_PROVIDER=""

Project Structure

ressource-planning/
├── backend/
│   ├── ResourcePlanning.Api/
│   │   ├── Controllers/     # API endpoints
│   │   ├── Data/            # DbContext, migrations, seed data
│   │   ├── DTOs/            # Request/response models
│   │   ├── Entities/        # Database entities
│   │   ├── Middleware/      # Error handling
│   │   ├── Services/        # Business logic
│   │   └── Program.cs       # App configuration
│   └── ResourcePlanning.Tests/  # xUnit backend tests
├── frontend/
│   └── resource-planning/
│       └── src/app/
│           ├── core/        # Services, models, guards, interceptors, utils
│           ├── shared/      # Shared components (confirm dialog)
│           └── features/    # Employees, departments, projects, planning,
│                            # absences, dashboard, my-planning, users, auth
└── README.md

Running Tests

# Backend (xUnit)
cd backend/ResourcePlanning.Tests
dotnet test

# Frontend (vitest)
cd frontend/resource-planning
npm test

This application was built entirely with the assistance of Claude Code — Anthropic's AI-powered CLI for software development.

About

Employee capacity planning web app — Angular 21 + .NET 10

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors