Skip to content

About

FocusBuddy is a strict execution system built on accountability, not motivation. It removes gamification and distractions, forcing single-task focus and visible progress through social transparency. A decay-based streak system discourages inconsistency without hard resets, reducing burnout while keeping pressure high.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

107 Commits

Folders and files

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

Repository files navigation

⚑ FocusBuddy

A Modern Productivity Dashboard for Deep Work

Spring Boot React Native Expo JWT

Features β€’ Quick Start β€’ Screenshots β€’ Architecture β€’ API Docs


πŸ“– About

FocusBuddy is a full-stack productivity application that combines time tracking, streak management, and distraction logging to help you stay focused. Built with a modern tech stack featuring a Spring Boot backend and React Native frontend with Expo.

Key Highlights:

  • 🎨 Beautiful Dashboard β€” Tempus-inspired UI with timeline visualization, progress charts, and analytics
  • πŸŒ“ Dark/Light Theme β€” One-click theme toggle with smooth transitions
  • πŸ“± Cross-Platform β€” Runs on Web, iOS, and Android from a single codebase
  • πŸ” Secure by Design β€” JWT authentication, BCrypt password hashing, and per-request authorization

✨ Features

Feature Description
Productivity Dashboard Timeline visualization, projects breakdown, app usage tracking, and daily summary stats
Focus Sessions Timed Pomodoro-style sessions (25/45/60 min) with task descriptions
Distraction Logging Track distractions during sessions with normalized data model
Quick Action Header Sticky header with theme toggle and session timer
Daily Summary Compact horizontal progress rings showing Focus, Meetings, Breaks, Other
Streak Tracking Daily streaks with grace days and 20% decay algorithm for missed days
Theme Toggle Switch between light and dark modes instantly from header
Responsive Design Adapts to desktop, tablet, and mobile screen sizes
JWT Authentication Secure token-based auth with 24-hour expiry

Roadmap

  • MVP Single-User Focus β€” Distraction logging, REST-correct API
  • Push Notifications β€” Streak warnings and session reminders
  • Analytics Export β€” Download productivity reports
  • Calendar Integration β€” Sync with Google Calendar

πŸ“Έ Screenshots

Light Mode

Dashboard Light Mode

Dark Mode

Dashboard Dark Mode

πŸš€ Quick Start

Prerequisites

Tool Version Required
Java 17+ βœ…
Node.js 18+ βœ…
npm 9+ βœ…
PostgreSQL 14+ Production only

1. Clone the Repository

git clone https://github.com/CodeItAlone/FoucsBuddy.git
cd FoucsBuddy/FocusBuddy

2. Start the Backend

cd server

# Windows
.\mvnw.cmd spring-boot:run

# macOS/Linux
./mvnw spring-boot:run

The API server starts at http://localhost:8080

3. Start the Frontend

cd client
npm install
npm start

Press w for Web, a for Android, or i for iOS


πŸ›οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  CLIENT β€” React Native + Expo                                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Screens        β”‚  Components       β”‚  Services          β”‚  β”‚
β”‚  β”‚  ─────────      β”‚  ──────────       β”‚  ────────          β”‚  β”‚
β”‚  β”‚  Dashboard      β”‚  Sidebar          β”‚  AuthContext       β”‚  β”‚
β”‚  β”‚  Login/Signup   β”‚  TimelineChart    β”‚  ThemeContext      β”‚  β”‚
β”‚  β”‚  Session        β”‚  ProgressBar      β”‚  API (Axios)       β”‚  β”‚
β”‚  β”‚                 β”‚  CircularProgress β”‚                    β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚ HTTPS + JWT
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  SERVER β€” Spring Boot 3.2                                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Security       β”‚  Controllers      β”‚  Services          β”‚  β”‚
β”‚  β”‚  ────────       β”‚  ───────────      β”‚  ────────          β”‚  β”‚
β”‚  β”‚  JwtAuthFilter  β”‚  AuthController   β”‚  AuthService       β”‚  β”‚
β”‚  β”‚  JwtProvider    β”‚  SessionControllerβ”‚  SessionService    β”‚  β”‚
β”‚  β”‚  BCrypt         β”‚                   β”‚  StreakService     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚ JPA/Hibernate
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  DATABASE β€” H2 (Dev) / PostgreSQL (Prod)                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  app_users  β”‚  sessions  β”‚  streaks  β”‚  distraction_logs   β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

FocusBuddy/
β”œβ”€β”€ client/                              # React Native Frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/                  # Reusable UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.js               # Navigation sidebar
β”‚   β”‚   β”‚   β”œβ”€β”€ TimelineChart.js         # Activity timeline
β”‚   β”‚   β”‚   β”œβ”€β”€ ProgressBar.js           # Horizontal progress
β”‚   β”‚   β”‚   β”œβ”€β”€ CircularProgress.js      # Donut charts
β”‚   β”‚   β”‚   └── DashboardCard.js         # Card container
β”‚   β”‚   β”œβ”€β”€ screens/
β”‚   β”‚   β”‚   β”œβ”€β”€ DashboardScreen.js       # Main dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ LoginScreen.js           # Authentication
β”‚   β”‚   β”‚   β”œβ”€β”€ SignupScreen.js          # Registration
β”‚   β”‚   β”‚   └── SessionScreen.js         # Focus timer
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ api.js                   # Axios HTTP client
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthContext.js           # Auth state management
β”‚   β”‚   β”‚   └── ThemeContext.js          # Theme provider
β”‚   β”‚   └── theme/
β”‚   β”‚       └── index.js                 # Light/Dark palettes
β”‚   β”œβ”€β”€ App.js                           # Root component
β”‚   └── package.json
β”‚
β”œβ”€β”€ server/                              # Spring Boot Backend
β”‚   β”œβ”€β”€ src/main/java/com/focusbuddy/
β”‚   β”‚   β”œβ”€β”€ config/                      # App configuration
β”‚   β”‚   β”œβ”€β”€ controller/                  # REST endpoints
β”‚   β”‚   β”œβ”€β”€ dto/                         # Data transfer objects
β”‚   β”‚   β”œβ”€β”€ exception/                   # Error handling
β”‚   β”‚   β”œβ”€β”€ model/                       # JPA entities
β”‚   β”‚   β”œβ”€β”€ repository/                  # Data access layer
β”‚   β”‚   β”œβ”€β”€ security/                    # JWT infrastructure
β”‚   β”‚   └── service/                     # Business logic
β”‚   β”œβ”€β”€ src/main/resources/
β”‚   β”‚   └── application.properties
β”‚   └── pom.xml
β”‚
└── README.md

πŸ“‘ API Reference

Authentication

POST /api/auth/signup

Create a new user account.

// Request
{
  "email": "[email protected]",
  "handle": "username",
  "password": "securePassword123"
}

// Response 201
{
  "token": "eyJhbGciOiJIUzUxMiJ9...",
  "user": {
    "id": 1,
    "email": "[email protected]",
    "handle": "username",
    "currentStreak": 0,
    "graceDaysRemaining": 1
  }
}

POST /api/auth/login

Authenticate and receive a JWT token.

// Request
{
  "email": "[email protected]",
  "password": "securePassword123"
}

// Response 200
{
  "token": "eyJhbGciOiJIUzUxMiJ9...",
  "user": { ... }
}

Sessions

All session endpoints require Authorization: Bearer <token> header.

Method Endpoint Description
POST /api/sessions Create a new focus session
GET /api/sessions Get session history
GET /api/sessions/current Get current active session
GET /api/sessions/{id} Get a specific session
PATCH /api/sessions/{id} Update session (complete/abandon)
POST /api/sessions/{id}/distractions Log a distraction

πŸ” Security

Layer Implementation
Password Storage BCrypt (strength 10)
Authentication JWT tokens (HS512, 24h expiry)
Authorization Per-request token validation
Ownership Users can only access their own data
Validation Bean Validation on all inputs
Error Handling Centralized handler, no stack traces exposed

Production Checklist

  • Use environment variables for secrets
  • Configure HTTPS with valid SSL certificate
  • Restrict CORS to production domains
  • Enable rate limiting on auth endpoints
  • Set up database backups
  • Configure logging and monitoring

βš™οΈ Configuration

Backend (server/src/main/resources/application.properties)

# Server
server.port=8080

# JWT (use env vars in production)
app.jwt.secret=${JWT_SECRET:your-256-bit-secret}
app.jwt.expiration-ms=86400000

# Database - Development (H2)
spring.datasource.url=jdbc:h2:file:./data/focusbuddy
spring.h2.console.enabled=true

# Database - Production (PostgreSQL)
# spring.datasource.url=jdbc:postgresql://${DB_HOST}:5432/focusbuddy
# spring.datasource.username=${DB_USER}
# spring.datasource.password=${DB_PASS}

Frontend (client/src/services/api.js)

const BASE_URL = Platform.OS === 'web'
    ? 'http://localhost:8080/api'
    : 'http://10.0.2.2:8080/api';  // Android emulator

πŸ§ͺ Testing

# Backend unit tests
cd server && ./mvnw test

# API smoke test
curl -X POST http://localhost:8080/api/auth/signup \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","handle":"tester","password":"pass123"}'

πŸ“ Recent Changes

v1.4.0 β€” MVP Single-User Focus (January 2026)

  • 🎯 Removed Groups β€” Focused on single-user perfection
  • πŸ“ Distraction Logging β€” Normalized data model for tracking distractions
  • πŸ”§ REST-Correct API β€” Proper POST/GET/PATCH endpoints
  • 🧹 Cleanup β€” Removed WebSockets, group components, and squad features

v1.3.0 β€” Group Focus Module (January 2026)

  • πŸ‘₯ Live Squad Widget β€” Real-time friend status with Active/Deep Work/Idle indicators
  • 🎯 Quick Action Header β€” Sticky header with theme toggle and session timer
  • πŸ“Š Compact Daily Summary β€” Horizontal progress rings layout
  • πŸŽ‰ Milestone Toasts β€” Social notifications with High Five button
  • πŸŒ™ Header Theme Toggle β€” One-click Dark/Light mode switch in header

v1.2.0 β€” Dashboard UI (January 2026)

  • ✨ New Dashboard β€” Tempus-inspired productivity interface
  • πŸŒ“ Theme Toggle β€” Light/dark mode with smooth transitions
  • πŸ“Š New Components β€” Timeline, progress bars, circular charts
  • πŸ“± Responsive Layout β€” Desktop, tablet, and mobile support
  • πŸ› οΈ ThemeContext β€” Centralized theme state management

v1.1.0 β€” Security Hardening (January 2026)

  • πŸ” Implemented BCrypt password hashing
  • 🎫 Added JWT token-based authentication
  • βœ… Added session ownership validation
  • πŸ›‘οΈ Centralized exception handling

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/awesome-feature
  3. Commit your changes: git commit -m 'Add awesome feature'
  4. Push to the branch: git push origin feature/awesome-feature
  5. Open a Pull Request

πŸ“œ License

This project is licensed under the MIT License. See LICENSE for details.


Built with ❀️ for focused developers

Report Bug β€’ Request Feature

About

FocusBuddy is a strict execution system built on accountability, not motivation. It removes gamification and distractions, forcing single-task focus and visible progress through social transparency. A decay-based streak system discourages inconsistency without hard resets, reducing burnout while keeping pressure high.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages