Skip to content

dhruvmohan867/Task-maker

Repository files navigation

Task Manager — Spring Boot + MongoDB + JWT

A modern task manager with a clean web UI (Thymeleaf + Bootstrap), JWT authentication (login/signup), role-based access control, analytics dashboard, and optional webhook integration.


Landing Page

Landing Page

Dashboard

Dashboard

Table of Contents


Live Demo

Key Tech Highlights

System Architecture

Data flow (high level): Frontend → JWT-secured REST → Services/Policies → Repository → MongoDB
Events from services → optional Webhook → external system


Features

  • Authentication: Sign up / Login with JWT
  • Role-based access: User vs Admin
  • Task management: create, list, update, delete (policy-based)
  • Analytics dashboard:
    • Status and priority charts
    • Completion trend
    • Admin-level analytics (team view)
  • Optional webhook publisher for task events (disabled by default)

Backend entry point: com.dhruv.taskmanager.TaskmanagerApplication
Ping endpoint: com.dhruv.taskmanager.controller.PingController
UI routes: com.dhruv.taskmanager.controller.ViewController


Tech Stack

Layer Tech
Runtime Java 21
Framework Spring Boot 3
Database MongoDB
Security Spring Security + JWT
UI Thymeleaf + Bootstrap 5
Charts Chart.js (dashboard)

How to add screenshots

  1. Create folder: docs/images/
  2. Save images as:
    • docs/images/landing.png
    • docs/images/dashboard.png
  3. Uncomment the Markdown section above.

Quick Start (Development)

Prerequisites

  • JDK 21
  • MongoDB (local or Atlas connection string)
  • Maven wrapper (included): mvnw / mvnw.cmd

Run

Windows (PowerShell):

$env:MONGODB_URI="mongodb://localhost:27017/taskmanager"
$env:APP_JWT_SECRET="change-me-to-a-long-secret"
$env:APP_JWT_EXP_MIN="120"
# optional:
# $env:APP_WEBHOOK_URL="https://example.com/webhook"

.\mvnw clean spring-boot:run

Linux/macOS:

export MONGODB_URI="mongodb://localhost:27017/taskmanager"
export APP_JWT_SECRET="change-me-to-a-long-secret"
export APP_JWT_EXP_MIN=120
# optional:
# export APP_WEBHOOK_URL="https://example.com/webhook"

./mvnw clean spring-boot:run

Open:


Configuration

All configuration is in src/main/resources/application.properties.

Property Env var Default Notes
spring.data.mongodb.uri MONGODB_URI mongodb://localhost:27017/taskmanager MongoDB connection
app.jwt.secret APP_JWT_SECRET change-me-to-a-long-secret Change in production
app.jwt.exp-min APP_JWT_EXP_MIN 120 Token expiration in minutes
app.webhook.url APP_WEBHOOK_URL (empty) Empty disables webhook

Webhook behavior

  • app.webhook.url is intentionally empty by default so the app runs without any external dependency.
  • When set, the webhook publisher posts task events to your URL.

Default Admin User

On first run, an admin user is seeded by com.dhruv.taskmanager.TaskmanagerApplication:

  • username: admin
  • password: admin123

Change/remove this seed logic for production deployments.


API

Auth

POST /auth/signup
Body: { "username": "...", "password": "..." }
→ { "token": "<JWT>", "roles": ["USER"], "user": { ... } }

POST /auth/login
Body: { "username": "...", "password": "..." }
→ { "token": "<JWT>", "roles": ["USER"|"ADMIN"], "user": { ... } }

Tasks (Authorization: Bearer <token>)

GET    /api/tasks
GET    /api/tasks/{id}
POST   /api/tasks
PUT    /api/tasks/{id}
DELETE /api/tasks/{id}        // admin only by policy

Example cURL:

TOKEN=$(curl -s -X POST localhost:8080/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"admin123"}' | jq -r .token)

curl -H "Authorization: Bearer $TOKEN" localhost:8080/api/tasks

Project Layout

Key UI files:

Analytics DTOs: com.dhruv.taskmanager.dto.AnalyticsDtos


Build & Test

./mvnw -DskipTests compile
./mvnw test
./mvnw package

License

MIT LICENSE.

About

A modern task manager with a clean web UI (Thymeleaf + Bootstrap), JWT authentication (login/signup), role-based access control, analytics dashboard, and optional webhook integration.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors