Documentation Index
Fetch the complete documentation index at: https://mintlify.com/igorek05m/daily-geogame/llms.txt
Use this file to discover all available pages before exploring further.
Vercel deployment (recommended)
Daily GeoGame is optimized for deployment on Vercel, the platform built by the creators of Next.js.Import to Vercel
Go to vercel.com and sign in with your GitHub account. Click “Add New Project” and import your repository.
Configure project settings
Vercel will automatically detect that this is a Next.js project. The default settings should work:
- Framework Preset: Next.js
- Build Command:
next build --turbopack(from package.json) - Output Directory:
.next(auto-detected) - Install Command:
pnpm install(auto-detected)
Add environment variables
Before deploying, add your MongoDB connection string:
- Go to “Environment Variables” section
- Add
MONGODB_URIwith your MongoDB Atlas connection string - Select all environments (Production, Preview, Development)
The live demo is hosted at https://daily-geogame.vercel.app
Environment variables in production
Required variables
Set these environment variables in your deployment platform:Setting variables on Vercel
Add environment variables
Click “Environment Variables” in the sidebar and add your variables:
- Key:
MONGODB_URI - Value: Your MongoDB connection string
- Environments: Select Production, Preview, and Development
MongoDB Atlas production setup
For production deployments, configure MongoDB Atlas with enhanced security:Use a production cluster
Create a separate production cluster, distinct from your development database. Consider upgrading from the free M0 tier for better performance.
Configure IP whitelist
Restrict access to Vercel’s IP addresses:
- In MongoDB Atlas, go to “Network Access”
- Add Vercel’s IP ranges or use 0.0.0.0/0 (less secure but easier)
- For tighter security, use Vercel’s static IP addresses if available on your plan
Set up database user
Create a production-specific database user:
- Use a strong, unique password
- Grant only necessary permissions (readWrite on your database)
- Store credentials securely in environment variables
Build process
The build process compiles your Next.js application for production:next build --turbopack, which:
- Compiles TypeScript to JavaScript
- Optimizes React components
- Generates static pages where possible
- Creates optimized bundles with Turbopack
Build output
After a successful build, you’ll see output similar to:Starting the production server
For custom hosting, start the production server after building:next start, which serves the built application on port 3000.
On Vercel, this step is handled automatically. You only need this for self-hosting.
Custom domain setup
To use a custom domain with your Vercel deployment:Configure DNS
Add DNS records to your domain provider:
- Type: A or CNAME
- Name: @ (or your subdomain)
- Value: Provided by Vercel
Alternative deployment platforms
Self-hosting with Docker
For self-hosting, create aDockerfile:
Other platforms
Daily GeoGame can be deployed to any platform that supports Next.js:- Netlify: Use the Next.js build plugin
- Railway: Auto-detects Next.js, add environment variables
- DigitalOcean App Platform: Import from GitHub, configure build settings
- AWS Amplify: Import repository and set build configuration
- Set
MONGODB_URIenvironment variable - Use Node.js 20.x or higher
- Install pnpm or configure the platform to use it
- Use build command:
pnpm build - Use start command:
pnpm start
Monitoring and logs
Vercel monitoring
Vercel provides built-in monitoring:- Real-time logs: View deployment and runtime logs in the dashboard
- Analytics: Track page views and performance (requires upgrade)
- Error tracking: See runtime errors and stack traces
- Go to your project → “Deployments”
- Click on a deployment to view its logs
- Use “Runtime Logs” for live application logs
MongoDB Atlas monitoring
Monitor your database:- Performance: View query performance and slow queries
- Connections: Track connection count and patterns
- Storage: Monitor database size and growth
- Alerts: Set up email alerts for issues
Production checklist
Before going live, verify:- MongoDB connection string is set in environment variables
- Using production MongoDB cluster (not development)
- MongoDB network access is properly configured
- Database user has appropriate permissions
- Build completes without errors
- All required dependencies are in
package.json -
.env.localis in.gitignore - Custom domain is configured (if applicable)
- SSL certificate is active
- Monitoring and alerts are enabled
Troubleshooting
Build failures
If your build fails:- Check the build logs for TypeScript errors
- Ensure all dependencies are listed in
package.json - Verify Node.js version is 20.x or higher
- Try building locally first:
pnpm build
MongoDB connection errors
If you see database connection errors:- Verify
MONGODB_URIis set correctly - Check MongoDB Atlas network access settings
- Ensure database user credentials are correct
- Test connection string locally
Performance issues
If your application is slow:- Check MongoDB Atlas performance metrics
- Consider upgrading from M0 tier
- Add database indexes for frequently queried fields
- Enable Vercel Analytics to identify bottlenecks
Next steps
After deployment:- Monitor your application’s performance
- Set up error tracking (Sentry, LogRocket, etc.)
- Configure continuous deployment for automatic updates
- Review and optimize database queries