CodeAlert is a full-stack mobile application built to centralize competitive programming activities across multiple coding platforms.
Track ratings, solved questions, upcoming contests, and reminders β all from one dashboard.
β User Authentication (Signup/Login)
β JWT Session Management
β Platform Handle Integration
β Contest Tracking
β Contest Countdown Timer
β Coding Profile Monitoring
β Theme Support (Dark / Light)
backend/
β
βββ app/
β
βββ routers/
β βββ users.py
β βββ dashboard.py
β βββ contests.py
β βββ leetcode.py
β βββ codeforces.py
β βββ reminders.py
β
βββ auth/
β βββ auth_handler.py
β
βββ database/
β βββ database.py
β
βββ main.py
CodeAlert uses a dual-token authentication strategy.
-
Access Token
- JWT
- Short-lived (60 minutes)
- Sent in the
Authorizationheader
-
Refresh Token
- Opaque UUID
- Stored securely in MongoDB
- Long-lived (30 days)
- Automatically rotated on every refresh request
Login
β
βΌ
Access Token + Refresh Token
β
βΌ
Access Token Expires
β
βΌ
Flutter calls /auth/refresh
β
βΌ
New Access Token
+
New Refresh Token
β
βΌ
Retry Original Request
- Refresh token rotation
- Server-side refresh token revocation
- Single-device logout
- Logout from all devices
- Automatic expiration using MongoDB TTL indexes
The following diagram illustrates the logical relationships between the MongoDB collections used in CodeAlert.
{
"_id":"ObjectId",
"name":"Revant",
"email":"user@gmail.com",
"password":"****",
"handles":{
"cf_handle":"abc",
"lc_handle":"xyz"
}
}{
"_id": "ObjectId",
"token": "3d13fd70-5d0f-45d8-83b9-5a2a09a57d8d",
"user_id": "6865b7ef3f62d5cb3b92cb0a",
"created_at": "2026-07-10T16:25:13Z",
"expires_at": "2026-08-09T16:25:13Z",
"revoked": false,
"revoked_at": null,
"device_hint": "Flutter"
}
{
"_id": "ObjectId",
"user_id": "6865b7ef3f62d5cb3b92cb0a",
"lc_handle": "abc@123",
"rating": 1345,
"global_ranking": 419189,
"problems_solved": 109
}{
"_id": "ObjectId",
"user_id": "6865b7ef3f62d5cb3b92cb0a",
"cf_handle": "abc@123",
"rating": 364,
"max_rating": 465,
"rank": "newbie",
"problems_solved": 124
}{
"_id": "ObjectId",
"user_id": "6865b7ef3f62d5cb3b92cb0a",
"cc_handle": "abc@123",
"rating": 399,
"stars": "1β
",
"global_ranking": 442451,
"problems_solved": 39
}{
"name":"Weekly Contest",
"platform":"LeetCode",
"start_time":"timestamp"
}{
"_id": "ObjectId",
"user_id":"123",
"contest_name":"Codeforces Round",
"reminder_time":"timestamp"
}POST /signup
POST /login
POST /auth/refresh
POST /auth/logout
POST /auth/logout-allPUT /handles
PATCH /update-password
POST /dashboard/syncGET /contestsPOST /reminder
GET /reminders- LeetCode GraphQL
- Codeforces API
- CodeChef Data Source
- User Authentication
- JWT Access Tokens
- Refresh Token Rotation
- Automatic Session Refresh
- Secure Logout
- Logout from All Devices
- Contest Fetch
- Contest Countdown
- Profile Page
- Platform Handle Setup
- Dashboard Sync
- Rating Tracking
- Questions Solved Tracking
- Theme Support
- Auto Refresh
- Notification Integration
- Profile Analytics
- Contest Filtering
- Better Error Handling
- Background Sync
- Push Notifications
- Redis Contest Caching
- AI Contest Recommendation
- Statistics Dashboard
- Leaderboards
- Activity Graph
- Active Device Management
git clone <repo>
cd codealert
flutter pub get
flutter runBackend:
cd backend
uvicorn app.main:app --host 0.0.0.0 --reloadBuilt with β€οΈ using Flutter + FastAPI + MongoDB