Prerequisites
Before you begin, ensure you have the following installed:- Node.js 18+ - Download Node.js
- pnpm - Install with
npm install -g pnpm(or use npm/yarn)
While the documentation mentions pnpm, you can also use npm or yarn if you prefer. Just replace
pnpm commands with your preferred package manager.Installation
Install dependencies
Install all required dependencies using pnpm:This will install all packages including:
- Next.js 16 (App Router)
- TypeScript
- Tailwind CSS
- Framer Motion for animations
- Octokit for GitHub API integration
Configure environment variables (optional)
For basic usage, no environment variables are required. However, for production deployments, you may want to configure:
GITHUB_TOKEN- For higher API rate limitsUPSTASH_REDIS_REST_URLandUPSTASH_REDIS_REST_TOKEN- For distributed caching
Start the development server
Building for Production
When you’re ready to deploy to production, build the optimized production bundle:- Compiles TypeScript to JavaScript
- Optimizes and minifies CSS with Tailwind
- Bundles and optimizes all client and server components
- Generates static pages where possible
The production build typically takes 1-3 minutes depending on your hardware.
Deployment Options
GitHub Wrapped can be deployed to any platform that supports Next.js:Vercel (Recommended)
The easiest deployment option with zero configuration:- Push your code to GitHub
- Import the project in Vercel
- Add environment variables in the Vercel dashboard
- Deploy!
Docker
Create aDockerfile in your project root:
Other Platforms
- Railway - Connect your GitHub repo and deploy
- Render - Supports Node.js applications with automatic deployments
- DigitalOcean App Platform - Deploy directly from GitHub
- AWS Amplify - Full CI/CD pipeline with AWS integration
Performance Optimization
For production deployments, consider:- Enable caching - Configure Redis for distributed caching (see Caching guide)
- Add a CDN - Use Vercel’s edge network or Cloudflare for static assets
- Configure rate limits - Set up a
GITHUB_TOKENto increase API limits (see Rate Limits guide)
Troubleshooting
Build fails with TypeScript errors
Build fails with TypeScript errors
Ensure you’re using Node.js 18 or higher and have all dependencies installed:
Port 3000 already in use
Port 3000 already in use
Change the port by setting the
PORT environment variable:GitHub API rate limit exceeded
GitHub API rate limit exceeded
Add a
GITHUB_TOKEN to your environment variables. See the Rate Limits guide for details.Next Steps
- Configure environment variables for production
- Learn about rate limits and how to avoid them
- Set up caching for better performance