A lightweight, open-source error tracking platform built with Go, Next.js, PostgreSQL, and Redis. This system captures, stores, and displays application errors in real-time with a clean dashboard interface.
Frontend (Next.js) Backend (Go + Chi) Storage
โ โ โ
โโ Dashboard UI โโ REST API โโ PostgreSQL
โโ Error Details โโ API Key Auth โ (Persistent Storage)
โโ Test Error Buttons โโ Error Processing โ
โโ Real-time Updates โโ Background Workers โโ Redis
(Caching & Queuing)
- Error Capture: Frontend/Backend sends error โ Go API
- Immediate Storage: Error queued in Redis for fast response
- Background Processing: Worker processes Redis queue โ PostgreSQL
- Caching: Frequently accessed data cached in Redis with TTL
- Display: Dashboard fetches from cache/database โ User interface
- Docker & Docker Compose
- Go 1.24+ (for local development)
- Node.js 18+ (for local development)
git clone <your-repo>
cd error-logs# Start all services
docker-compose up -d
# View logs
docker-compose logs -fThis will start:
- PostgreSQL on port 5432
- Redis on port 6379
- Go Backend on port 8080
- Next.js Frontend on port 3000
- Dashboard: http://localhost:3000
- Backend API: http://localhost:8080
- Health Check: http://localhost:8080/health
- Visit the dashboard at http://localhost:3000
- Click "Trigger Frontend Error" or "Trigger Backend Error"
- Watch errors appear in real-time on the dashboard
- Click on errors to view detailed information
cd backend
# Install dependencies
go mod download
# Set up environment
cp .env.example .env
# Start PostgreSQL and Redis
docker-compose up postgres redis -d
# Run the backend
go run main.gocd frontend
# Install dependencies
npm install
# Set up environment
cp .env.local.example .env.local
# Start development server
npm run deverrors: Core error events with metadataapi_keys: Authentication keys for API accessprojects: Multi-project support (future enhancement)
id(UUID): Unique identifiertimestamp: When error occurredlevel: error, warning, info, debugmessage: Error messagestack_trace: Full stack tracecontext: JSON metadatasource: frontend, backend, apifingerprint: For grouping similar errorsresolved: Resolution status
All API requests require an X-API-Key header:
X-API-Key: test-api-key# Create Error
POST /api/errors
{
"level": "error",
"message": "Something went wrong",
"stack_trace": "Error: ...",
"context": {"user_id": 123},
"source": "frontend",
"url": "https://app.com/page"
}
# List Errors
GET /api/errors?limit=50&offset=0&level=error&source=frontend
# Get Error Details
GET /api/errors/{id}
# Resolve Error
PUT /api/errors/{id}/resolve
# Delete Error
DELETE /api/errors/{id}
# Get Statistics
GET /api/stats- Use the "Trigger Error" buttons in the dashboard
- Monitor error appearance in the UI
- Test error resolution and deletion
# Create a test error
curl -X POST http://localhost:8080/api/errors \
-H "Content-Type: application/json" \
-H "X-API-Key: test-api-key" \
-d '{
"level": "error",
"message": "Test API error",
"source": "api",
"context": {"test": true}
}'
# Get errors list
curl -H "X-API-Key: test-api-key" \
"http://localhost:8080/api/errors?limit=5"- Create Error โ Verify Redis queuing
- Background Processing โ Verify PostgreSQL persistence
- Caching โ Verify Redis cache population
- API Retrieval โ Verify data accuracy
- Frontend Display โ Verify UI updates
DATABASE_URL=postgres://error_logs_user:error_logs_password@localhost:5432/error_logs?sslmode=disable
REDIS_URL=redis://localhost:6379
PORT=8080
ENVIRONMENT=developmentNEXT_PUBLIC_API_URL=http://localhost:8080
NODE_ENV=development- Error capture and storage
- Real-time dashboard
- Error details view
- Redis caching and queuing
- Background processing
- API key authentication
- Statistics tracking
- Docker deployment
- Modern dashboard with Shadcn/ui
- Error list with filtering
- Detailed error modal
- Statistics cards
- Test error triggers
- Responsive design
- Chi router with middleware
- PostgreSQL with optimized schema
- Redis integration
- Background queue processing
- API key validation
- Error fingerprinting
- CORS support
# Build and deploy
docker-compose -f docker-compose.prod.yml up -d
# Scale backend if needed
docker-compose up --scale backend=3- Copy files to server
- Set production environment variables
- Run
docker-compose up -d - Set up reverse proxy (nginx/traefik)
- Configure SSL certificates
- Error Grouping: Group similar errors by fingerprint
- Pagination: Implement proper pagination in frontend
- Real-time Updates: WebSocket for live error notifications
- Email Alerts: Notify on critical errors
- Rate Limiting: Prevent spam/DoS
- User Authentication: Multi-user support
- Project Management: Isolate errors by project
- Advanced Filtering: Date ranges, custom queries
- Webhooks: Integration with Slack/Discord
- Performance Monitoring: Track response times
- Source Maps: Better stack trace resolution
- Error Trends: Analytics and trending
- Horizontal Scaling: Load balancer setup
- Database Sharding: Handle high volume
- CDC (Change Data Capture): Real-time sync
- Metrics: Prometheus/Grafana monitoring
- Logging: Structured logging with ELK stack
-
Connection Refused:
# Check if services are running docker-compose ps # Check logs docker-compose logs backend
-
Database Connection Issues:
# Verify PostgreSQL is ready docker-compose exec postgres pg_isready -U error_logs_user
-
Redis Connection Issues:
# Test Redis connectivity docker-compose exec redis redis-cli ping
-
API Key Issues:
- Verify
X-API-Key: test-api-keyheader - Check API key exists in database
- Verify
This project is open-source and available under the MIT License.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Built with โค๏ธ using Go, Next.js, PostgreSQL, and Redis