Deployment options
Invoice Generator supports multiple deployment strategies:- Vercel - Recommended for quick deployment with zero configuration
- Self-hosted - Deploy to your own infrastructure using Docker or Node.js
- Other platforms - Compatible with any platform that supports Next.js applications
Prerequisites
Before deploying, ensure you have:Database setup
Create a Turso database instance. Invoice Generator uses LibSQL (Turso) for data storage.
OAuth configuration
Set up Google OAuth credentials in Google Cloud Console for authentication.
- Create a new OAuth 2.0 Client ID
- Add authorized redirect URIs for your deployment domain
- Note your Client ID and Client Secret
Environment variables
Prepare all required environment variables. See the environment variables reference for details.
Architecture overview
The application stack includes:- Framework: Next.js 16.1.1 with App Router
- Runtime: Node.js 20+
- Database: Turso (LibSQL) via
@libsql/client - Authentication: NextAuth.js 5.0 (beta)
- UI: React 19.2.3 with Tailwind CSS 4
Build configuration
The Next.js configuration (next.config.ts:3-18) includes:
- Turbopack enabled for faster builds
- Server external packages:
bcryptjsfor password hashing - Image optimization: Configured for Google profile images
Build scripts
Frompackage.json:5-11:
npm run build- Production buildnpm start- Start production servernpm run migrate:prod- Run database migrations for production
The application uses Next.js 16’s stable App Router. Ensure your hosting environment supports Node.js 20 or later.
Security considerations
Essential security practices:- Environment variables - Store sensitive credentials in platform-specific secret managers
- Database authentication - Always use Turso auth tokens in production
- OAuth secrets - Rotate Google OAuth credentials regularly
- HTTPS only - Ensure all production deployments use HTTPS
- Authentication secret - Generate a strong, random
AUTH_SECRETvalue
Performance optimization
For production deployments:- Enable Vercel’s Edge Network for global distribution
- Configure appropriate cache headers for static assets
- Use Turso’s edge replicas for reduced database latency
- Enable Next.js image optimization
Monitoring and logs
Recommended monitoring setup:- Track application errors and performance metrics
- Monitor database connection health
- Set up alerts for authentication failures
- Review deployment logs regularly
Next steps
Deploy to Vercel
Quick deployment with automatic CI/CD
Self-hosted deployment
Deploy to your own infrastructure
Environment variables
Complete environment variable reference