Skip to content

getbeton/beton-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Beton-AI

An open-source automation platform that helps teams streamline their workflows and manage API integrations efficiently.

πŸš€ Tech Stack

  • Frontend: Next.js 14, TypeScript, TailwindCSS
  • Backend: Express.js, TypeScript, Prisma ORM
  • Database: PostgreSQL
  • Authentication: Supabase (Google, GitHub, Email/Password)
  • Mock Services: Standalone Apollo API mock with 100K entities
  • Containerization: Docker & Docker Compose

πŸ“‹ Features

  • πŸ” Secure Authentication - Multiple sign-in options via Supabase
  • πŸ”‘ API Key Management - Store and manage API keys for various services
  • 🎨 Modern UI - Clean, professional interface for both technical and sales teams
  • 🎭 Mock Apollo Service - Standalone service with 100K mock entities for development
  • 🐳 Docker Ready - Full containerization support with automated database setup
  • πŸ”„ Real-time Updates - Dynamic page refreshing after changes

🎭 Mock Apollo Service

This project includes a standalone Apollo API mock service for development:

  • πŸ“Š 100K Mock Entities - Pre-seeded with realistic people, organizations, and locations
  • πŸ”§ Separate Database - Uses its own mock_apollo PostgreSQL database
  • ⚑ Configurable Latency - Simulates real-world API response times
  • πŸ”€ Smart Routing - Backend automatically routes between mock/real Apollo APIs
  • πŸš€ Auto-Setup - Database and data seeding handled automatically

The mock service runs on port 3002 and provides Apollo-compatible endpoints for development without requiring real API keys.

πŸ› οΈ Development Setup

Prerequisites

  • Node.js 18+ and npm
  • Docker and Docker Compose
  • PostgreSQL (if running locally)

πŸš€ First Time Setup (Recommended)

For new users, use our automated setup script:

git clone https://github.com/getbeton/beton-ai.git
cd beton-ai
./setup.sh

This script will:

  • βœ… Create all environment files automatically
  • βœ… Install dependencies
  • βœ… Build and start all Docker services
  • βœ… Create separate mock_apollo database
  • βœ… Seed 100K mock entities for development
  • βœ… Start the complete development environment

Services will be available at:

πŸ”§ Development Mode Selection

Use the interactive development script:

./dev.sh

Choose your preferred development mode:

  • Option 1: Full Docker (recommended for first-time setup)
  • Option 2: Frontend Dev + Backend Docker (hot reload frontend)
  • Option 3: Backend Dev + Frontend Docker (hot reload backend)
  • Option 4: Both Dev (hot reload both services)
  • Include Mock Apollo: Yes (recommended for development)

Manual Environment Setup (Alternative)

If you prefer manual setup:

Backend (.env in /backend):

DATABASE_URL=postgresql://postgres:postgres123@localhost:5432/beton_ai
SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
JWT_SECRET=your_jwt_secret
PORT=3001

Frontend (.env.local in /frontend):

NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
NEXT_PUBLIC_API_URL=http://localhost:3001

Manual Database Setup:

# Copy environment files
cp backend/env.example backend/.env
cp frontend/env.local.example frontend/.env.local

# Start PostgreSQL
docker-compose up -d postgres

# Run migrations
docker-compose run --rm backend npx prisma migrate deploy

# Start all services
docker-compose up

🐳 Docker Deployment

Using Docker Compose (Recommended)

# Build and start all services
npm run docker:build
npm run docker:up

# Stop all services
npm run docker:down

Manual Docker Commands

# Build images
docker-compose build

# Start services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

πŸ“ Project Structure

beton-ai/
β”œβ”€β”€ backend/                 # Express.js API server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ routes/         # API routes
β”‚   β”‚   β”œβ”€β”€ middleware/     # Custom middleware
β”‚   β”‚   β”œβ”€β”€ services/       # Business logic
β”‚   β”‚   └── types/          # TypeScript definitions
β”‚   β”œβ”€β”€ prisma/             # Database schema and migrations
β”‚   └── Dockerfile
β”œβ”€β”€ frontend/               # Next.js application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/           # App router pages
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable components
β”‚   β”‚   β”œβ”€β”€ lib/          # Utilities and configurations
β”‚   β”‚   └── types/        # TypeScript definitions
β”‚   └── Dockerfile
└── docker-compose.yml     # Multi-container configuration

πŸ”§ Available Scripts

  • npm run dev - Start both frontend and backend in development
  • npm run build - Build both applications for production
  • npm run start - Start both applications in production mode
  • npm run docker:build - Build Docker images
  • npm run docker:up - Start with Docker Compose
  • npm run docker:down - Stop Docker containers

🌐 Ports

πŸ—„οΈ Database Management

Prisma Commands (via Docker)

# View database with Prisma Studio
docker-compose run --rm backend npx prisma studio --browser none

# Generate Prisma client
docker-compose run --rm backend npx prisma generate

# Deploy migrations (production)
docker-compose run --rm backend npx prisma migrate deploy

# Create new migration (development)
docker-compose run --rm backend npx prisma migrate dev

# Reset database (⚠️ destructive)
docker-compose run --rm backend npx prisma migrate reset

Database Health Check

The PostgreSQL container includes health checks that ensure the database is ready before the backend starts. The backend startup script will:

  1. Wait for PostgreSQL to be healthy
  2. Automatically run migrations on startup
  3. Start the Express server

This ensures consistent database state across all environments.

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Beton is open source Clay.com alternative

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published