Skip to content

rajgupta04/TrackAsap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

58 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TrackAsap - 75 Day Goal Tracking Application

A full-stack personal analytics dashboard to track your 75-day journey for competitive programming, internship preparation, and fitness goals.

Tech Stack Tailwind Node.js MongoDB

🎯 Features

Core Tracking

  • Daily Tracker - Log daily progress with checkboxes for each goal
  • LeetCode - Contest participation & problems solved
  • CodeChef - Daily problems & contest tracking
  • Codeforces - Problems solved & rating updates
  • Gym - Workout completion & type tracking
  • Diet - Clean diet compliance & macro tracking
  • Internship Prep - Study hours logging

πŸ“ Problem Tracking (NEW!)

  • Save Solutions - Store problem title, link, code, and notes
  • Monaco Code Editor - View saved code with syntax highlighting
  • Copy Code - One-click copy functionality
  • Multi-platform - Track LeetCode, CodeChef, Codeforces, GFG, HackerRank
  • Tags & Difficulty - Organize problems by tags and difficulty
  • Time Tracking - Log time spent on each problem

πŸ“‹ Custom Sheets & Roadmaps (NEW!)

  • Pre-built Templates - DSA, CP, OS, CN, OOPS, Development
  • Topic-based Progress - Track progress by topics
  • Custom Sheets - Create your own learning roadmap
  • Visual Progress - See completion percentage per topic
  • Link Problems to Sheets - Organize problems by sheet/topic

πŸ”₯ Streak Animation (NEW!)

  • Confetti Celebration - Animated celebration on completing daily goals
  • Streak Counter - Visual streak display with fire animation
  • Progress Ring - See your 75-day progress
  • Motivational Messages - Dynamic messages based on streak length

Analytics & Visualization

  • Dashboard - Overview with key stats & progress
  • Problems Trend - Line chart showing cumulative problems
  • Platform Distribution - Bar chart comparing platforms
  • Difficulty Breakdown - Pie chart for problem difficulty
  • Consistency Heatmap - GitHub-style activity visualization
  • Codeforces Rating - Rating progression graph
  • Weight Progress - Weight trend with target line

Physique Tracker

  • Weekly weight logging
  • Body fat percentage tracking
  • Progress visualization
  • Weekly average calculations
  • Goal progress percentage

Authentication

  • JWT-based authentication
  • Protected routes
  • Persistent login state
  • Profile management with logout

UI Design

  • πŸŒ™ Dark theme
  • ✨ Glassmorphism cards
  • πŸ’š Neon green accents
  • 🎬 Smooth Framer Motion animations
  • πŸ“± Fully responsive layout

πŸ“ Folder Structure

TrackAsap/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”‚   └── db.js                 # MongoDB connection
β”‚   β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.controller.js    # Auth logic
β”‚   β”‚   β”‚   β”œβ”€β”€ dailyLog.controller.js # Daily logs CRUD
β”‚   β”‚   β”‚   β”œβ”€β”€ physique.controller.js # Weight tracking
β”‚   β”‚   β”‚   β”œβ”€β”€ analytics.controller.js # Dashboard data
β”‚   β”‚   β”‚   β”œβ”€β”€ problem.controller.js  # Problem tracking (NEW)
β”‚   β”‚   β”‚   └── sheet.controller.js    # Sheets/Roadmaps (NEW)
β”‚   β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.middleware.js    # JWT verification
β”‚   β”‚   β”‚   β”œβ”€β”€ error.middleware.js   # Error handling
β”‚   β”‚   β”‚   └── validate.middleware.js # Input validation
β”‚   β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”‚   β”œβ”€β”€ User.model.js         # User schema
β”‚   β”‚   β”‚   β”œβ”€β”€ DailyLog.model.js     # Daily log schema
β”‚   β”‚   β”‚   β”œβ”€β”€ PhysiqueLog.model.js  # Weight log schema
β”‚   β”‚   β”‚   β”œβ”€β”€ Problem.model.js      # Problem schema (NEW)
β”‚   β”‚   β”‚   └── Sheet.model.js        # Sheet/Roadmap schema (NEW)
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.routes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ dailyLog.routes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ physique.routes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ analytics.routes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ problem.routes.js     # (NEW)
β”‚   β”‚   β”‚   └── sheet.routes.js       # (NEW)
β”‚   β”‚   └── server.js                 # Express app entry
β”‚   β”œβ”€β”€ .env.example
β”‚   └── package.json
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/
β”‚   β”‚   └── favicon.svg
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ layout/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Layout.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.jsx
β”‚   β”‚   β”‚   β”‚   └── Header.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ui/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ GlassCard.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ StatCard.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ProgressRing.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Checkbox.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ NumberInput.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Select.jsx
β”‚   β”‚   β”‚   β”‚   └── LoadingSpinner.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ProblemModal.jsx      # Problem input form (NEW)
β”‚   β”‚   β”‚   β”œβ”€β”€ CodeViewer.jsx        # Monaco editor view (NEW)
β”‚   β”‚   β”‚   └── StreakAnimation.jsx   # Streak celebration (NEW)
β”‚   β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”‚   └── api.js                # Axios instance
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Register.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ DailyTracker.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Analytics.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ PhysiqueTracker.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Profile.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Sheets.jsx            # Sheets/Roadmaps page (NEW)
β”‚   β”‚   β”‚   └── Problems.jsx          # Problems list page (NEW)
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ authService.js
β”‚   β”‚   β”‚   β”œβ”€β”€ dailyLogService.js
β”‚   β”‚   β”‚   β”œβ”€β”€ physiqueService.js
β”‚   β”‚   β”‚   β”œβ”€β”€ analyticsService.js
β”‚   β”‚   β”‚   β”œβ”€β”€ problemService.js     # (NEW)
β”‚   β”‚   β”‚   └── sheetService.js       # (NEW)
β”‚   β”‚   β”œβ”€β”€ store/
β”‚   β”‚   β”‚   β”œβ”€β”€ authStore.js          # Zustand auth state
β”‚   β”‚   β”‚   β”œβ”€β”€ dailyLogStore.js      # Daily logs state
β”‚   β”‚   β”‚   β”œβ”€β”€ analyticsStore.js     # Analytics data
β”‚   β”‚   β”‚   β”œβ”€β”€ physiqueStore.js      # Weight tracking
β”‚   β”‚   β”‚   β”œβ”€β”€ problemStore.js       # Problems state (NEW)
β”‚   β”‚   β”‚   └── sheetStore.js         # Sheets state (NEW)
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   β”œβ”€β”€ main.jsx
β”‚   β”‚   └── index.css                 # Tailwind + custom styles
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ vite.config.js
β”‚   β”œβ”€β”€ tailwind.config.js
β”‚   └── package.json
β”‚
└── README.md

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • MongoDB (local or Atlas)
  • npm or yarn

Backend Setup

cd backend
npm install

# Create .env file
cp .env.example .env

# Edit .env with your values:
# PORT=5000
# MONGODB_URI=mongodb://localhost:27017/trackasap
# JWT_SECRET=your_super_secret_key
# JWT_EXPIRE=30d

# Start development server
npm run dev

Frontend Setup

cd frontend
npm install

# Create .env file (optional for custom API URL)
cp .env.example .env

# Start development server
npm run dev

Visit http://localhost:3000 to use the application.

πŸ“Š Database Schema

User Model

{
  name: String,
  email: String (unique),
  password: String (hashed),
  startDate: Date,           // 75-day challenge start
  targetWeight: Number,
  codeforcesHandle: String,
  codechefHandle: String,
  leetcodeHandle: String,
  timestamps: true
}

DailyLog Model

{
  user: ObjectId,
  date: Date,
  dayNumber: Number (1-75),
  leetcode: {
    contestParticipated: Boolean,
    problemsSolved: Number,
    problemDifficulty: enum ['easy', 'medium', 'hard', 'none']
  },
  codechef: {
    dailyProblem: Boolean,
    contestParticipated: Boolean,
    problemsSolved: Number
  },
  codeforces: {
    problemsSolved: Number,
    contestParticipated: Boolean,
    rating: Number
  },
  gym: {
    completed: Boolean,
    workoutType: enum ['push', 'pull', 'legs', 'cardio', 'rest', 'other', 'none'],
    duration: Number
  },
  diet: {
    cleanDiet: Boolean,
    calories: Number,
    protein: Number,
    notes: String
  },
  internshipPrep: {
    completed: Boolean,
    hoursSpent: Number,
    topics: [String]
  },
  notes: String,
  timestamps: true
}

PhysiqueLog Model

{
  user: ObjectId,
  date: Date,
  weight: Number,
  bodyFat: Number,
  weekNumber: Number (1-11),
  measurements: {
    chest: Number,
    waist: Number,
    hips: Number,
    arms: Number,
    thighs: Number
  },
  notes: String,
  timestamps: true
}

πŸ”Œ API Endpoints

Authentication

Method Endpoint Description
POST /api/auth/register Register user
POST /api/auth/login Login user
GET /api/auth/me Get current user
PUT /api/auth/profile Update profile

Daily Logs

Method Endpoint Description
GET /api/daily-logs Get all logs
POST /api/daily-logs Create/Update log
GET /api/daily-logs/:date Get log by date
DELETE /api/daily-logs/:date Delete log
GET /api/daily-logs/streak Get streak info
GET /api/daily-logs/weekly-summary Get weekly stats

Physique

Method Endpoint Description
GET /api/physique Get all weight logs
POST /api/physique Add weight log
GET /api/physique/progress Get progress summary
DELETE /api/physique/:id Delete weight log

Analytics

Method Endpoint Description
GET /api/analytics/dashboard Dashboard overview
GET /api/analytics/problems-trend Problems over time
GET /api/analytics/platform-distribution Platform breakdown
GET /api/analytics/difficulty-breakdown Difficulty stats
GET /api/analytics/heatmap Activity heatmap
GET /api/analytics/codeforces-rating CF rating history
GET /api/analytics/weight-progress Weight chart data

Problems (NEW!)

Method Endpoint Description
GET /api/problems Get all problems
POST /api/problems Create problem
GET /api/problems/:id Get problem details
PUT /api/problems/:id Update problem
DELETE /api/problems/:id Delete problem
GET /api/problems/by-date/:date Get problems by date
GET /api/problems/stats Get problem statistics

Sheets/Roadmaps (NEW!)

Method Endpoint Description
GET /api/sheets Get all sheets
POST /api/sheets Create sheet
GET /api/sheets/templates Get available templates
GET /api/sheets/:id Get sheet with problems
PUT /api/sheets/:id Update sheet
DELETE /api/sheets/:id Delete sheet
POST /api/sheets/:id/topics Add topic to sheet
PUT /api/sheets/:id/topics/:topicName Update topic progress

πŸ”₯ Streak Calculation Logic

// Streak is calculated based on completion score >= 60%
// A day is "active" if user completes at least 3/5 of:
// 1. LeetCode (solved problems or participated)
// 2. CodeChef (daily problem or contest)
// 3. Codeforces (solved problems or contest)
// 4. Gym (workout completed)
// 5. Diet (clean diet maintained)

const calculateCompletionScore = (log) => {
  let score = 0;
  const totalChecks = 5;

  if (log.leetcode.problemsSolved > 0 || log.leetcode.contestParticipated) score++;
  if (log.codechef.dailyProblem || log.codechef.contestParticipated) score++;
  if (log.codeforces.problemsSolved > 0 || log.codeforces.contestParticipated) score++;
  if (log.gym.completed) score++;
  if (log.diet.cleanDiet) score++;

  return Math.round((score / totalChecks) * 100);
};

// Current streak: Count consecutive days from today backwards
// where each day has completionScore >= 60%

// Longest streak: Maximum consecutive active days in all logs

🎨 State Management (Zustand)

// Auth Store
const useAuthStore = create((set) => ({
  user: null,
  token: null,
  isAuthenticated: false,
  login: async (credentials) => { ... },
  logout: () => { ... },
  updateUser: async (data) => { ... },
}));

// Daily Log Store
const useDailyLogStore = create((set, get) => ({
  currentLog: null,
  selectedDate: today,
  streak: { currentStreak: 0, longestStreak: 0 },
  fetchLogByDate: async (date) => { ... },
  saveLog: async (data) => { ... },
  updateCurrentLog: (field, value) => { ... },
  fetchStreak: async () => { ... },
}));

// Analytics Store
const useAnalyticsStore = create((set) => ({
  dashboard: null,
  problemsTrend: [],
  platformDistribution: [],
  fetchAll: async () => { ... },
}));

🌐 Deployment

Backend (Render/Railway/Vercel)

  1. Set environment variables
  2. Build command: npm install
  3. Start command: npm start

Frontend (Vercel/Netlify)

  1. Build command: npm run build
  2. Output directory: dist
  3. Set VITE_API_URL environment variable

Environment Variables

Backend:

PORT=5000
MONGODB_URI=mongodb+srv://...
JWT_SECRET=your_production_secret
JWT_EXPIRE=30d
NODE_ENV=production

Frontend:

VITE_API_URL=https://your-api-url.com/api

πŸ“ License

MIT License - feel free to use this for your own 75-day challenge!


Built with πŸ’š for the grind. Stay consistent, track everything, achieve your goals!

About

πŸš€ 75-Day Coding Challenge Tracker with TakeUForward-style DSA sheets, daily logs, problem tracking, analytics dashboard, and physique tracker. Built with React + Node.js + MongoDB.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages