GitHunt
DI

Divyanshkumar62/Skill_Forge

SkillForge is a gamified productivity and goal-setting app that turns self-growth into a game. With habit tracking, daily quests, and AI-powered guidance, it helps users build discipline, track progress, and level up in real life.

๐Ÿš€ Skill Forge - Productivity Platform

TypeScript
React
Node.js
MongoDB
Jest

A full-stack productivity application that transforms boring task management into an engaging gamified experience. Built with modern technologies and production-ready architecture.

๐ŸŽฎ Features

โœ… Gamification System

  • XP Rewards: Complete tasks to earn experience points
  • Level Progression: Automatic level ups at XP milestones
  • Badge System: Achievement unlocks and recognition
  • Streak Tracking: Daily consistency rewards
  • Rewards Shop: Spend XP on digital rewards

โœ… Task Management

  • Goal Setting: Create and track personal goals
  • Habit Formation: Daily/weekly habit tracking
  • Progress Visualization: Analytics and statistics
  • Smart Reminders: Automated notification system
  • Milestone Tracking: Goal subdivision support

โœ… Advanced Analytics

  • Progress Charts: Weekly activity visualization
  • Consistency Scoring: Habit adherence tracking
  • Skill Tree: Multi-dimensional progress tracking
  • Streak Analytics: Historical streak comparisons
  • Personal Insights: Data-driven improvement tips

โœ… Production Ready

  • TypeScript: Full type safety and development experience
  • Unit Tests: Comprehensive test coverage (Jest/Vitest)
  • API Documentation: OpenAPI/Swagger specifications
  • Security: JWT authentication, bcrypt password hashing
  • Performance: Optimized queries and caching strategies

๐Ÿ› ๏ธ Tech Stack

Backend

  • Framework: Node.js + Express
  • Language: TypeScript
  • Database: MongoDB + Mongoose
  • Authentication: JWT + bcrypt
  • Testing: Jest + Supertest + mongodb-memory-server
  • Scheduling: node-cron for automated tasks

Frontend

  • Framework: React 19 + TypeScript
  • Styling: Tailwind CSS + cyber theme
  • State Management: Zustand
  • Routing: React Router v7
  • Charts: Recharts
  • Testing: Vitest + React Testing Library

Dev Tools

  • Linting: ESLint
  • API Spec: OpenAPI 3.0
  • CI/CD Ready: Jest testing framework
  • Code Formatting: Consistent TypeScript standards

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+ installed
  • MongoDB Atlas account OR local MongoDB
  • npm or yarn package manager

1. Clone and Setup

# Clone the repository
git clone https://github.com/Divyanshkumar62/Skill_Forge/
cd skill-forge

# Setup backend
cd backend
npm install

# Setup frontend
cd ../frontend
npm install

2. Environment Configuration

Backend Environment (.env)

# Database Configuration
MONGODB_URI=mongodb://localhost:27017/skillforge
# OR for MongoDB Atlas:
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/skillforge?retryWrites=true&w=majority

# JWT Configuration
JWT_SECRET=your-super-secure-jwt-secret-key-here-minimum-32-characters
JWT_EXPIRES_IN=7d

# Server Configuration
PORT=3001
NODE_ENV=development

# Email Configuration (Optional)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-app-password
EMAIL_FROM=noreply@skillforge.com

Frontend Environment (.env)

VITE_API_URL=http://localhost:3000
VITE_ENV=development

3. Database Setup

  1. Create a free MongoDB Atlas cluster
  2. Get connection string and add to MONGODB_URI
  3. Database will be automatically created on first run

Option B: Local MongoDB

# Install MongoDB locally
brew install mongodb-community  # macOS
sudo apt-get install mongodb    # Ubuntu

# Start MongoDB service
mongod

4. Run the Application

# Terminal 1: Backend
cd backend
npm run dev  # Runs on http://localhost:3000

# Terminal 2: Frontend
cd frontend
npm run dev  # Runs on http://localhost:5173

Production Mode

# Backend - Build and start
cd backend
npm run build
npm start

# Frontend - Build
cd frontend
npm run build
npm run preview

๐Ÿ“š API Documentation

OpenAPI Specification

Core Endpoints

// Authentication
POST /api/auth/register
POST /api/auth/login

// Tasks & Goals
GET /api/tasks
POST /api/tasks
DELETE /api/tasks/:id

// Gamification
POST /api/xp/earn
GET /api/rewards
POST /api/rewards/:id/purchase

// Analytics (NEW!)
GET /api/analytics/overview
GET /api/analytics/skillTree

// Notifications
GET /api/notifications
PATCH /api/notifications/:id/read

Authentication

All secure endpoints require JWT token:

Authorization: Bearer <your-jwt-token>

๐Ÿ—ƒ๏ธ Sample Data & Seeding

Automated Seeding

The application includes sample data for testing:

# Backend seeding (automatically runs on first startup)
npm run seed  # Creates sample users, habits, tasks

Manual Setup for Demo

// Create sample user (via API)
POST /api/auth/register
{
  "name": "Demo Hero",
  "email": "demo@skillforge.com",
  "password": "password123"
}

// Sample goals created automatically:
// - Read for 30 minutes daily
// - Exercise 3x per week
// - Complete project milestone
// - Write daily journal

๐Ÿ“Š Project Structure

skill-forge/
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ __tests__/          # Unit tests
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ auth.service.test.ts
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ xp.service.test.ts
โ”‚   โ”‚   โ”œโ”€โ”€ controllers/        # API handlers
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ auth.controller.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ analytics.controller.ts
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ xp.controller.ts
โ”‚   โ”‚   โ”œโ”€โ”€ models/            # MongoDB schemas
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ user.model.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ habit.model.ts
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ goal.model.ts
โ”‚   โ”‚   โ”œโ”€โ”€ routes/            # API routes
โ”‚   โ”‚   โ”œโ”€โ”€ services/          # Business logic
โ”‚   โ”‚   โ”œโ”€โ”€ middlewares/       # Authentication, validation
โ”‚   โ”‚   โ””โ”€โ”€ utils/            # Helpers and utilities
โ”‚   โ”œโ”€โ”€ jest.config.js         # Jest configuration
โ”‚   โ”œโ”€โ”€ package.json           # Dependencies & scripts
โ”‚   โ””โ”€โ”€ docs/api-spec.yaml     # API documentation
โ””โ”€โ”€ frontend/
    โ”œโ”€โ”€ src/
    โ”‚   โ”œโ”€โ”€ __tests__/         # Component tests
    โ”‚   โ”‚   โ”œโ”€โ”€ XpBar.test.tsx
    โ”‚   โ”‚   โ”œโ”€โ”€ HabitCard.test.tsx
    โ”‚   โ”‚   โ””โ”€โ”€ LoginForm.test.tsx
    โ”‚   โ”œโ”€โ”€ components/       # Reusable UI components
    โ”‚   โ”‚   โ”œโ”€โ”€ gamification/XpBar.tsx
    โ”‚   โ”‚   โ”œโ”€โ”€ notifications/NotificationBell.tsx
    โ”‚   โ”‚   โ””โ”€โ”€ layouts/DashboardLayout.tsx
    โ”‚   โ”œโ”€โ”€ features/         # Feature-sliced architecture
    โ”‚   โ”‚   โ”œโ”€โ”€ auth/          # Authentication feature
    โ”‚   โ”‚   โ”œโ”€โ”€ habits/        # Habits management
    โ”‚   โ”‚   โ”œโ”€โ”€ tasks/         # Task management
    โ”‚   โ”‚   โ””โ”€โ”€ analytics/     # Analytics dashboard
    โ”‚   โ”œโ”€โ”€ pages/            # Route-level components
    โ”‚   โ”œโ”€โ”€ stores/           # Zustand state management
    โ”‚   โ”œโ”€โ”€ hooks/            # Custom React hooks
    โ”‚   โ””โ”€โ”€ types/            # TypeScript type definitions
    โ”œโ”€โ”€ vite.config.ts         # Vite configuration
    โ”œโ”€โ”€ tailwind.config.js     # Tailwind CSS configuration
    โ””โ”€โ”€ package.json           # Frontend dependencies

๐Ÿ”ง Development Guidelines

Coding Standards

  • TypeScript: 100% type coverage required
  • Error Handling: Comprehensive try-catch blocks
  • Authentication: JWT tokens for all user-specific endpoints
  • Security: Input validation and sanitization
  • Performance: Optimized database queries and caching

Testing Guidelines

  • Unit Tests: All services and utilities
  • Integration Tests: API endpoints and database operations
  • Component Tests: React components with React Testing Library
  • Coverage: Minimum 80% coverage target

Git Workflow

# Development workflow
git checkout -b feature/awesome-feature
# Make changes with tests
git commit -m "Add awesome feature with tests"
git push origin feature/awesome-feature

# Pull Request Requirements
- โœ… All tests passing
- โœ… Code review completed
- โœ… TypeScript compilation successful
- โœ… Documentation updated

Environment Variables for Production

NODE_ENV=production
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/skillforge_prod
JWT_SECRET=your-production-jwt-secret-minimum-32-characters
EMAIL_HOST=your-smtp-host
PORT=3001

๐Ÿค Contributing

Development Setup

  1. Fork the repository
  2. Clone your fork
  3. Create a feature branch
  4. Make changes with tests
  5. Ensure all tests pass
  6. Open a Pull Request

Code Quality

  • Write comprehensive unit tests
  • Update API documentation
  • Follow TypeScript best practices
  • Ensure responsive design works on all devices

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

  • GitHub Issues for bug reports
  • Documentation in docs/ folder
  • Community discussions in Discussions tab

Built with โค๏ธ using modern web technologies. Transform productivity into fun!