The next-generation developer analytics platform that will go VIRAL!
DevFlow is the "Spotify Wrapped for Developers" - a comprehensive analytics platform with AI-powered insights, gamification, social features, and team collaboration tools.
- Productivity Tracking: Monitor commits, PRs, issues, and code volume
- Time Patterns: Discover your most productive hours and coding habits
- Language Breakdown: See which languages you use most
- Streak System: Track daily coding streaks (current & longest)
- GPT-4 Integration: Personalized productivity recommendations
- Burnout Detection: ML algorithm that predicts burnout before it happens
- Pattern Recognition: Identify trends in your coding behavior
- Actionable Tips: Get specific advice to improve productivity
- 15+ Achievements: Unlock badges for milestones and special accomplishments
- Global Leaderboards: Compete with developers worldwide
- Progress Tracking: See how close you are to unlocking achievements
- Shareable Badges: Show off your accomplishments
- Year in Review: Beautiful shareable cards (like Spotify Wrapped)
- Developer DNA: Unique coding personality profile
- Custom Stats: Personalized metrics and highlights
- Social Sharing: One-click sharing to Twitter, LinkedIn, etc.
- Friend Connections: Compare stats with friends
- Team Analytics: See how your team collaborates
- Private Leaderboards: Team-only competitions
- Collaboration Metrics: Track code reviews and interactions
- Framework: Next.js 14 (App Router) with TypeScript
- Database: Supabase (PostgreSQL 15)
- Authentication: NextAuth.js v5 with GitHub OAuth
- Caching: Upstash Redis
- AI: OpenAI GPT-4
- Background Jobs: Inngest
- APIs: GitHub REST & GraphQL (Octokit)
- Hosting: Vercel
- Database: Supabase
- Monitoring: Sentry
- Analytics: PostHog
dev-flow/
├── app/
│ ├── api/
│ │ ├── auth/[...nextauth]/ # NextAuth configuration
│ │ ├── github/
│ │ │ └── sync/ # GitHub data sync
│ │ ├── analytics/
│ │ │ ├── productivity/ # Productivity metrics
│ │ │ └── burnout/ # Burnout detection
│ │ ├── achievements/
│ │ │ └── unlock/ # Achievement system
│ │ ├── insights/
│ │ │ └── generate/ # AI insights
│ │ ├── social/
│ │ │ ├── connections/ # Friend system
│ │ │ └── leaderboard/ # Rankings
│ │ ├── teams/ # Team management
│ │ ├── sharing/
│ │ │ ├── year-review/ # Year in review
│ │ │ └── [shareUrl]/ # Public shares
│ │ └── user/
│ │ └── profile/ # User profile
│ ├── page.tsx # Landing page
│ ├── layout.tsx # Root layout
│ └── globals.css # Global styles
├── lib/
│ ├── auth.ts # Auth configuration
│ ├── db.ts # Database helpers
│ ├── encryption.ts # Token encryption
│ └── utils.ts # Utility functions
├── supabase-schema.sql # Database schema
├── package.json
├── tsconfig.json
├── next.config.mjs
├── tailwind.config.js
└── .env.example
- Node.js 20+
- npm 10+
- Supabase account
- GitHub OAuth App
- OpenAI API key
-
Clone the repository
git clone <your-repo-url> cd dev-flow
-
Install dependencies
npm install
-
Set up Supabase
- Create a new Supabase project
- Run the SQL in
supabase-schema.sqlin the SQL Editor - Copy your project URL and keys
-
Create GitHub OAuth App
- Go to GitHub Settings > Developer settings > OAuth Apps
- Create new OAuth App
- Set callback URL to
http://localhost:3000/api/auth/callback/github - Copy Client ID and Client Secret
-
Set up environment variables
cp .env.example .env
Fill in your
.envfile:# Database NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key SUPABASE_SERVICE_ROLE_KEY=your_service_role_key # Auth NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=generate_with_openssl_rand_base64_32 # GitHub GITHUB_ID=your_github_client_id GITHUB_SECRET=your_github_client_secret # Google Gemini AI GEMINI_API_KEY=your_gemini_api_key # Encryption ENCRYPTION_KEY=generate_with_openssl_rand_hex_32
-
Run the development server
npm run dev
-
Open your browser Navigate to
http://localhost:3000
The project uses 10 main tables:
- users - User profiles and GitHub data
- daily_stats - Daily coding statistics
- repositories - Repository information
- achievements - User achievements
- insights - AI-generated insights
- teams - Team information
- social_connections - Friend connections
- leaderboards - Ranking data
- sharing_cards - Shareable cards
- burnout_predictions - Burnout risk analysis
See supabase-schema.sql for complete schema.
POST /api/auth/signin- Sign in with GitHubPOST /api/auth/signout- Sign out
POST /api/github/sync- Sync GitHub data
GET /api/analytics/productivity- Get productivity metricsGET /api/analytics/burnout- Get burnout analysis
POST /api/achievements/unlock- Check and unlock achievementsGET /api/achievements/unlock?userId=xxx- List achievements
POST /api/insights/generate- Generate AI insights
GET /api/social/leaderboard- Get leaderboardGET /api/social/connections- List connectionsPOST /api/social/connections- Create connection
GET /api/teams- List teamsPOST /api/teams- Create team
GET /api/sharing/year-review- Generate year reviewGET /api/sharing/[shareUrl]- View shared card
GET /api/user/profile- Get user profilePUT /api/user/profile- Update profile
The productivity score (0-100) is calculated using:
- Commit Score (30%): Number of commits
- Volume Score (25%): Lines of code added
- Diversity Score (20%): Number of unique repos
- Consistency Score (25%): Active hours per day
Uses 6 factors to predict burnout risk:
- Long working hours (25% weight)
- Weekend work (15% weight)
- Late-night coding (20% weight)
- No breaks (20% weight)
- Productivity decline (15% weight)
- Inconsistent patterns (5% weight)
Calculates 5 personality traits:
- Consistency: How regularly you code
- Intensity: Average commits per active day
- Variety: Number of languages used
- Collaboration: Interaction with other developers
- Night Owl: Percentage of late-night commits
- GitHub tokens are encrypted using AES-256
- Row Level Security (RLS) enabled on all tables
- JWT-based session management
- HTTPS-only in production
-
Push to GitHub
git add . git commit -m "Initial commit" git push origin main
-
Deploy to Vercel
- Import your GitHub repository
- Add environment variables
- Deploy!
-
Update GitHub OAuth
- Update callback URL to your production domain
- Update
NEXTAUTH_URLin environment variables
- Set up Inngest for background jobs
- Implement daily sync cron job
- Add OG image generation for sharing
- Set up Sentry error tracking
- Add rate limiting
- Implement caching with Redis
- Add email notifications
- Build frontend UI
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
- GitHub API for providing developer data
- OpenAI for GPT-4 insights
- Supabase for the amazing database platform
- Vercel for hosting
Built with ❤️ for developers who want to understand their coding journey
🔥 Make DevFlow go VIRAL! 🔥