Skip to content

code100x/1ai

Repository files navigation

1AI - All-in-one AI Platform

Frontend

To install dependencies:

bun install

Update .env file

NEXT_PUBLIC_BACKEND_URL=http://localhost:3000

To run:

bun dev

Open http://localhost:3002 with your browser to see the result.

Backend

To install dependencies:

bun install

Start database locally

  docker run -p 5432:5432 -d -e POSTGRES_PASSWORD=postgres postgres

Copy .env.example to .env

  cp .env.example .env

Update .env creds

  DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres
  ...

Migrate the db

  bunx prisma migrate dev

To run:

bun run index.ts

Running Docker

Building the Image

docker build -t backend-app .

Running the Container

docker run -p 3000:3000 \
  -e DB_URL="your_database_url" \
  -e OPENROUTER_KEY="your_openrouter_key" \
  -e FROM_EMAIL="your_email" \
  -e POSTMARK_SERVER_TOKEN="your_postmark_token" \
  -e RZP_WEBHOOK_SECRET="your_razorpay_webhook_secret" \
  backend-app

## For quick testing (without env vars):
  docker run -p 3000:3000 backend-app

Required Environment Variables

Copy .env.example to .env and fill in the required values:

  • DB_URL: PostgreSQL database connection string
  • OPENROUTER_KEY: API key for OpenRouter AI services
  • FROM_EMAIL: Email address for sending emails
  • POSTMARK_SERVER_TOKEN: Postmark email service token
  • RZP_WEBHOOK_SECRET: Razorpay webhook verification secret