This guide will help you set up and run the complete Automation Platform stack, including backend services, database, frontend, and supporting services.
Before starting, ensure you have the following installed:
- Node.js (v16 or higher)
- npm or yarn
- Docker
- Git
This project consists of several services:
- Primary Backend - Main application server and API
- Frontend - User interface
- Database - PostgreSQL database
- Hooks - Webhook processing service
- Processor - Data processing with Kafka
- Worker - Background job processing
Follow these steps in order to get the entire system running:
First, start the PostgreSQL database using Docker:
docker run -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword postgresNavigate to the primary backend directory and set it up:
cd primary-backend
npm installRun database migrations:
npx prisma migrate devGenerate Prisma client:
npx prisma generateSeed the database with initial data:
npx prisma db seedStart the primary backend server:
npm run devThe primary backend will typically run on http://localhost:3000 or similar.
In a new terminal, navigate to the frontend directory:
cd frontend
npm install
npm run devThe frontend will typically run on http://localhost:3001 or similar.
In a new terminal, navigate to the hooks service directory:
cd hooks
npm installGenerate Prisma client:
npx prisma generateStart the hooks service:
npm run devFirst, start Kafka using Docker:
docker run -p 9092:9092 -d apache/kafka:4.0.0In a new terminal, navigate to the processor service directory:
cd processor
npm installGenerate Prisma client:
npx prisma generateStart the processor service:
npm run devIn a new terminal, navigate to the worker service directory:
cd worker
npm installGenerate Prisma client:
npx prisma generateStart the worker service:
npm run dev- Start Infrastructure: Always start Docker services (PostgreSQL, Kafka) first
- Primary Backend First: Start the primary backend service after running migrations
- Other Services: Start remaining services in any order
- Frontend Last: Start the frontend service last to ensure API connectivity
Database Connection Issues
- Ensure PostgreSQL container is running:
docker ps - Check if port 5432 is available
- Verify DATABASE_URL in .env files
Prisma Issues
- Run
npx prisma generateafter any schema changes - Run
npx prisma migrate devfor new migrations - Reset database if needed:
npx prisma migrate reset
Kafka Connection Issues
- Ensure Kafka container is running:
docker ps - Check if port 9092 is available
- Wait a few seconds for Kafka to fully start before starting processor service
Port Conflicts
- Check which ports are in use:
netstat -an | grep LISTEN - Modify port configurations in respective service configs
To stop all services:
- Stop all npm processes (Ctrl+C in each terminal)
- Stop Docker containers:
docker stop $(docker ps -q)# View database in Prisma Studio
npx prisma studio
# Reset database
npx prisma migrate reset
# Deploy migrations to production
npx prisma migrate deploy# View running containers
docker ps
# Stop specific container
docker stop <container_id>
# Remove containers
docker rm $(docker ps -aq)Automation-Platform/
├── primary-backend/ # Main API server
├── frontend/ # User interface
├── hooks/ # Webhook processing
├── processor/ # Kafka data processing
├── worker/ # Background jobs
└── README.md # This file
If you encounter issues during setup:
- Check that all prerequisites are installed
- Verify Docker is running
- Ensure all ports are available
- Check environment variables are properly configured
- Review service logs for specific error messages