Prerequisites
Before you begin, ensure you have the following:- Node.js v18 or later (recommended: v20+)
- PostgreSQL database (v14 or later recommended)
- Redis instance - Upstash Redis or compatible Redis service
- Blob storage - Vercel Blob or S3-compatible storage for file uploads
- Git for cloning the repository
Forge uses Next.js 16, Drizzle ORM for database management, and BetterAuth for authentication. Make sure your infrastructure supports these technologies.
Installation
Install dependencies
Install all required Node.js packages using npm:This will install all dependencies including:
- Next.js (v16.1.6+)
- Drizzle ORM for database operations
- BetterAuth for authentication
- Upstash Redis client
- React Query for data fetching
- And all other required packages
Configure environment variables
Create a Add the required environment variables to your
.env file in the root of the project:.env file. See the Environment Variables page for a complete reference.At minimum, you’ll need:Set up the database
Run database migrations using Drizzle Kit to create all necessary tables:This will create the following tables in your PostgreSQL database:
user- User accountsaccount- OAuth provider connectionssession- User sessionsdashboard- User dashboardswidget- Dashboard widgetssettings- User settings
Drizzle Kit will connect to your database using the
DATABASE_URI from your .env file. Make sure your PostgreSQL instance is running and accessible.Start the development server
Start Forge in development mode:The application will be available at
http://localhost:3000 (or the URL you specified in NEXT_PUBLIC_APP_URL).Building for Production
To build Forge for production deployment:- Compile TypeScript code
- Optimize React components (using React Compiler)
- Generate optimized static assets
- Create production-ready server bundles
For production deployments, see the Deployment guide for platform-specific instructions.
Verifying Your Installation
After setup, verify everything is working:- Authentication: Try logging in with email/password
- Database: Create a dashboard - it should persist after refresh
- Redis: Real-time notifications should work (test with widget updates)
- Blob Storage: Upload a profile picture in settings
Next Steps
Environment Variables
Configure all environment variables for full functionality
Deployment
Deploy Forge to production platforms
Troubleshooting
Database Connection Issues
If you see database connection errors:- Verify your
DATABASE_URIis correct - Ensure PostgreSQL is running and accessible
- Check firewall rules allow connections to PostgreSQL port (default: 5432)
- Verify the database user has proper permissions
Redis Connection Issues
If Redis connection fails:- Verify your Upstash Redis URL and token are correct
- Check if your Redis instance is active in the Upstash dashboard
- Ensure your network allows outbound connections to Upstash
Build Errors
If you encounter build errors:- Ensure you’re using Node.js v18 or later
- Delete
node_modulesand.nextfolders, then runnpm installagain - Check that all environment variables are properly set