Developer year-in-review for GitHub users.
This app fetches GitHub activity, computes yearly stats, caches results in MongoDB, and generates optional AI insights (roast, predictions, advice, and dev story).
- Next.js 16 (App Router)
- React 19 + TypeScript
- MongoDB + Mongoose
- Tailwind CSS 4
- OpenAI API (optional, with local fallbacks)
- Username-based wrapped page:
/wrapped/:username - Aggregated yearly GitHub stats (repos, commits, activity, language mix, contributions)
- Cached wrapped results per
username + year - AI-generated extras:
- roast
- predictions
- personalized advice
- one-line dev story
- Graceful fallback behavior when OpenAI or portions of GitHub data are unavailable
npm installCreate .env.local in the project root:
# Required
MONGO_URI=mongodb+srv://<user>:<pass>@<cluster>/<db>?retryWrites=true&w=majority
# Recommended (prevents GitHub rate limits)
GITHUB_TOKEN=ghp_xxx
# Optional (enables AI insights)
OPENAI_TOKEN=sk-xxx
# Optional for split frontend/backend deployments
# Leave unset for same-origin API calls in local development.
NEXT_PUBLIC_API_URL=npm run devOpen http://localhost:3000.
npm run dev- Start development servernpm run build- Build for productionnpm run start- Run production servernpm run lint- Run ESLint
- Computes wrapped stats for the target year and caches in MongoDB.
- Returns cached result when available.
- Returns
404when the GitHub user does not exist.
Body:
{
"stats": { "...": "wrapped stats object" }
}Response:
{
"predictions": {
"languagePrediction": "...",
"ossPrediction": "...",
"burnoutRisk": "..."
},
"advice": "...",
"devStory": "..."
}Body:
{
"stats": { "...": "wrapped stats object" }
}Response:
{
"roast": "..."
}The wrapped year is dynamic:
- before December 1st: previous year
- on/after December 1st: current year
OPENAI_TOKENis optional. If missing, AI endpoints return deterministic fallback text.GITHUB_TOKENis strongly recommended to reduce rate-limit issues.- MongoDB is required because wrapped output and AI fields are cached/stored.