Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Technical Assignment: Dockerized Secure Task Manager

Candidate

NSENGIYUMVA CHRISTOPHE

Secure Task Manager

A full-stack, Dockerized Task Manager application built with Spring Boot, React, PostgreSQL, Redis, and Keycloak.

Architecture

The application is structured as a multi-container Docker application:

  • Frontend: React application served via Nginx.
  • Backend: Spring Boot REST API.
  • Database: PostgreSQL for persistent task storage.
  • Cache: Redis for caching task and analytics data.
  • Identity Provider: Keycloak for OAuth2 / OIDC authentication.

For more details, see docs/architecture.md.

Setup Instructions

Prerequisites

  • Docker and Docker Compose installed.

Running the Application

  1. Clone the repository and navigate to the root directory.
  2. Ensure you have the .env file set up (copy .env.example to .env if necessary):
    cp .env.example .env
  3. Start the containers using Docker Compose:
    docker compose up --build

The services will be available at:

Test User Credentials

Keycloak is pre-configured with the following users in the task-manager realm:

Role Username Password
Admin admin@example.com admin123
User user@example.com user123

Keycloak Admin Console:

  • Username: admin
  • Password: admin123

Environment Variables

The application relies on environment variables for configuration. See .env.example for the required variables. Key variables include:

  • POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD
  • KEYCLOAK_ADMIN, KEYCLOAK_ADMIN_PASSWORD
  • VITE_KEYCLOAK_URL, VITE_API_URL

API Documentation

Once the backend is running, the Swagger / OpenAPI documentation is available at:

Dashboard and Visualizations

The application includes a Dashboard (/dashboard) that displays user-specific analytics:

  1. Total / Completed / In-Progress / Overdue: Quick summary metric cards.
  2. Completion Rate: A progress bar showing the percentage of completed tasks.
  3. Tasks by Status: A Pie Chart visualizing the distribution of task statuses.
  4. Tasks Created Over Time: A Line Chart tracking the number of tasks created daily.

All analytics endpoints are secured and scoped to only show data belonging to the currently authenticated user.

Redis Usage

Redis is used as a caching layer to improve application performance and reduce database load:

  • Task List Cache: Caches the user's task list (@Cacheable(value = "tasks")).
  • Individual Task Cache: Caches single tasks (@Cacheable(value = "task")).
  • Analytics Cache: Caches the results of the status distribution, time series, and summary queries.

Cache invalidation (@CacheEvict) is automatically triggered whenever a task is created, updated, or deleted, ensuring the user always sees fresh data without unnecessary DB queries.

Backup and Restore

Backup

Windows (PowerShell):

New-Item -ItemType Directory -Force -Path backups
docker exec -t task-manager-postgres pg_dump -U postgres -d taskmanager -F p -c -v > backups/task-manager-backup.sql

Restore

Windows (PowerShell):

# Copy backup file into container and execute restore
docker cp backups/task-manager-backup.sql task-manager-postgres:/tmp/restore.sql
docker exec -t task-manager-postgres psql -U postgres -d taskmanager -f /tmp/restore.sql
docker exec -t task-manager-postgres rm -f /tmp/restore.sql

⚠️ Known Limitations

  • The JWT refresh mechanism in the frontend currently uses a simple setInterval approach.
  • Only a single Keycloak realm is supported, and user registration is disabled by default.
  • Test coverage is minimal and needs to be expanded.

AI Usage

See AI_USAGE.md for details on how AI tools were used during the development of this project.

About

NSENGIYUMVA CHRISTOPHE

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages