Installation
Complete installation guide for setting up Revi error monitoring in your development environment, including backend, dashboard, and SDK components.
Installation Guide
Welcome to the complete installation guide for Revi! This guide covers setting up the full Revi stack, including the backend API, dashboard, and SDK for comprehensive error monitoring and session replay.
Architecture Overview
Revi consists of three main components:
- Backend API: Encore.ts-based service for data collection and storage
- Dashboard: Next.js web application for monitoring and analytics
- SDK: Client-side JavaScript library for error capture and session recording
Clone the Revi repository to get started:
git clone https://github.com/your-org/revi.git
cd reviThe Revi backend is built with Encore.ts and requires PostgreSQL.
Install Encore CLI:
curl -L https://encore.dev/install.sh | bashNavigate to the backend directory:
cd backendInstall dependencies:
npm installSet up environment variables:
cp .env.example .env
# Edit .env with your database credentialsRun database migrations:
encore db migrateStart the backend server:
encore runThe backend will be available at http://localhost:4000
The dashboard is a Next.js application that provides the web interface.
Navigate to the dashboard directory:
cd ../dashboardInstall dependencies:
npm installConfigure environment variables:
cp .env.example .envEdit .env with your configuration:
DATABASE_URL=postgresql://user:password@localhost:5432/revi
NEXT_PUBLIC_REVI_API_URL=http://localhost:4000
BETTER_AUTH_SECRET=your-auth-secret-here
GOOGLE_CLIENT_ID=your-google-oauth-client-id
GOOGLE_CLIENT_SECRET=your-google-oauth-secretSet up the database schema:
npx drizzle-kit pushStart the dashboard:
npm run devThe dashboard will be available at http://localhost:3000
The SDK is the client-side library that captures errors and user sessions.
Navigate to the SDK directory:
cd ../sdkInstall dependencies:
npm installBuild the SDK:
npm run buildTest the SDK (optional):
npm testCreate a test application:
cd examples/react-demo
npm install
npm startNow that everything is running, create your first monitoring project:
- Open the dashboard at
http://localhost:3000 - Sign in with Google OAuth or create an account
- Click "Create New Project" and fill in the details
- Copy the generated API key
- Use the API key in your applications with the Revi SDK
Your project structure should look like this:
encore.app
package.json
package.json
.env
package.json
dist/
Environment Configuration
Backend Environment Variables
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/revi
# API Settings
PORT=4000
NODE_ENV=development
# Optional: External integrations
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/...
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...Dashboard Environment Variables
# Database (same as backend)
DATABASE_URL=postgresql://user:password@localhost:5432/revi
# Application URLs
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_REVI_API_URL=http://localhost:4000
NEXT_PUBLIC_REVI_PROJECT_ID=1
# Authentication
BETTER_AUTH_SECRET=your-long-random-secret-key-here
GOOGLE_CLIENT_ID=your-google-oauth-client-id
GOOGLE_CLIENT_SECRET=your-google-oauth-client-secretDevelopment Workflow
Starting the Full Stack
# Terminal 1: Start the backend
cd backend && encore run
# Terminal 2: Start the dashboard
cd dashboard && npm run dev
# Terminal 3: Build/watch the SDK (if developing)
cd sdk && npm run build:watchDatabase Management
Reset the database:
cd backend && encore db reset
cd dashboard && npx drizzle-kit pushView database contents:
cd backend && encore db shellBuilding for Production
Backend:
cd backend && encore buildDashboard:
cd dashboard && npm run buildSDK:
cd sdk && npm run buildTroubleshooting
Common Issues
Port conflicts:
- Backend: Change port in
encore.appor setPORTenvironment variable - Dashboard: Use
npm run dev -- -p 3001to use a different port
Database connection errors:
- Ensure PostgreSQL is running
- Check
DATABASE_URLin both backend and dashboard.envfiles - Run database migrations:
encore db migrateandnpx drizzle-kit push
Authentication not working:
- Verify Google OAuth credentials are correct
- Ensure
BETTER_AUTH_SECRETis set and matches between components - Check that callback URLs are configured in Google Console
SDK not capturing errors:
- Verify the backend is running and accessible
- Check browser network tab for API call errors
- Ensure the API key is correct and the project exists
Getting Help
- Documentation: Continue reading the guides in this documentation
- GitHub Issues: Report bugs and request features
- Discord Community: Join our developer community for real-time help
🎉 Congratulations! You now have a complete Revi installation running locally. Continue to the Quick Start Guide to integrate Revi into your first application.