Skip to content

Local Setup

This guide covers setting up AccessALI for local development without Docker.

Prerequisites

Installation Steps

1. Clone the Repository

git clone https://github.com/stratpoint-engineering/poc-access-ali.git
cd poc-access-ali/src

2. Install Dependencies

pnpm install

3. Configure Environment

Copy the example environment file:

cp ../documents/00-references/.env.example .env.local

Edit .env.local with your database credentials:

# PostgreSQL connection
DATABASE_URL="postgresql://username:password@localhost:5432/accessali_dev"

# Or use Neon DB
DATABASE_URL="postgresql://user:password@ep-xxxxx.us-east-2.aws.neon.tech/accessali?sslmode=require"

# NextAuth
NEXTAUTH_SECRET="your-secret-key-min-32-characters"
NEXTAUTH_URL="http://localhost:3000"

# Redis (optional)
REDIS_URL="redis://localhost:6379"

# Mock APIs
USE_MOCK_SAP="true"
USE_MOCK_SALESFORCE="true"
USE_MOCK_SPRINGCM="true"
USE_MOCK_ELEDGER="true"

4. Create Database

Local PostgreSQL

# Create database
createdb accessali_dev

# Or using psql
psql -U postgres -c "CREATE DATABASE accessali_dev;"

Neon DB

  1. Sign up at neon.tech
  2. Create a new project
  3. Copy the connection string
  4. Paste into DATABASE_URL in .env.local

5. Run Migrations

pnpm db:migrate

6. Seed Database (Optional)

pnpm db:seed

7. Start Development Server

pnpm dev

Access the application at http://localhost:3000

Development Commands

# Development server
pnpm dev

# Build for production
pnpm build

# Start production server
pnpm start

# Type checking
pnpm type-check

# Linting
pnpm lint

# Database operations
pnpm db:migrate     # Run migrations
pnpm db:seed        # Seed data
pnpm db:studio      # Open Prisma Studio
pnpm db:push        # Push schema changes (dev only)

Troubleshooting

Database Connection Issues

# Test database connection
pnpm db:test

# Check PostgreSQL is running
pg_isready

# macOS: Start PostgreSQL
brew services start postgresql@16

# Linux: Start PostgreSQL
sudo systemctl start postgresql

Port Conflicts

# Find process on port 3000
lsof -i :3000

# Kill process
kill -9 <PID>

Module Not Found Errors

# Clear cache and reinstall
rm -rf node_modules .next
pnpm install

Next Steps