Features β’ Quick Start β’ Screenshots β’ Architecture β’ API Docs
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
| 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 |
- 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
| Tool | Version | Required |
|---|---|---|
| Java | 17+ | β |
| Node.js | 18+ | β |
| npm | 9+ | β |
| PostgreSQL | 14+ | Production only |
git clone https://github.com/CodeItAlone/FoucsBuddy.git
cd FoucsBuddy/FocusBuddycd server
# Windows
.\mvnw.cmd spring-boot:run
# macOS/Linux
./mvnw spring-boot:runThe API server starts at
http://localhost:8080
cd client
npm install
npm startPress
wfor Web,afor Android, orifor iOS
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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 β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
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
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
}
}Authenticate and receive a JWT token.
// Request
{
"email": "[email protected]",
"password": "securePassword123"
}
// Response 200
{
"token": "eyJhbGciOiJIUzUxMiJ9...",
"user": { ... }
}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 |
| 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 |
- 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
# 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}const BASE_URL = Platform.OS === 'web'
? 'http://localhost:8080/api'
: 'http://10.0.2.2:8080/api'; // Android emulator# 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"}'- π― 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
- π₯ 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
- β¨ 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
- π Implemented BCrypt password hashing
- π« Added JWT token-based authentication
- β Added session ownership validation
- π‘οΈ Centralized exception handling
- Fork the repository
- Create your feature branch:
git checkout -b feature/awesome-feature - Commit your changes:
git commit -m 'Add awesome feature' - Push to the branch:
git push origin feature/awesome-feature - Open a Pull Request
This project is licensed under the MIT License. See LICENSE for details.
Built with β€οΈ for focused developers

