Getting Started

Quick start guide for setting up the EthosPower AI development environment.

Last updated: 31 January 2026

Getting Started

This guide walks you through setting up the EthosPower AI development environment on your local machine.

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js 20+ - JavaScript runtime
  • npm 10+ - Package manager
  • Git - Version control
  • Wrangler CLI - Cloudflare Workers CLI

Clone the Repository

git clone <your-repository-url>
cd your-project-name

Install Dependencies

npm ci --legacy-peer-deps

The --legacy-peer-deps flag is required due to peer dependency conflicts between some packages.

Environment Configuration

Create a .env.local file in the project root:

# Payload CMS
PAYLOAD_SECRET=your-secret-key-here

# Cloudflare (optional for local dev)
CLOUDFLARE_ACCOUNT_ID=your-account-id
CLOUDFLARE_API_TOKEN=your-api-token

For Cloudflare bindings in development, create .dev.vars:

# Database
DB=your-d1-database-id

# External Services
ERPNEXT_URL=https://erp.yourdomain.org
ERPNEXT_API_KEY=your-api-key
ERPNEXT_API_SECRET=your-api-secret

Start Development Server

npm run dev

The application will be available at http://localhost:3000.

Verify Installation

  1. Homepage - Visit http://localhost:3000
  2. Admin - Visit http://localhost:3000/admin
  3. API Health - Visit http://localhost:3000/api/health

Project Structure

src/
├── app/
│   ├── (frontend)/     # Public pages
│   └── (payload)/      # CMS admin
├── collections/        # Payload CMS schemas
├── components/         # React components
├── content/           # MDX content (blog, docs)
├── lib/               # Utilities and services
└── hooks/             # React hooks

Common Tasks

Running Tests

# Unit tests
npm run test

# E2E tests (requires dev server)
npm run test:e2e

# Type checking
npm run typecheck

Building for Production

SKIP_MIGRATIONS=1 CI=true npm run build

Deploying

npm run deploy

Troubleshooting

Port Already in Use

lsof -i :3000
kill -9 <PID>

Cloudflare Binding Errors

Ensure wrangler is authenticated:

wrangler login
wrangler whoami

TypeScript Errors After Pulling

rm -rf node_modules .next
npm ci --legacy-peer-deps

Next Steps

setupdevelopmentquickstart