Files
asle/COMPLETE_SETUP_INSTRUCTIONS.md
defiQUG beb4d86b00 Add complete setup instructions and automated setup script
- Create setup-complete.sh for automated setup after DB configuration
- Add COMPLETE_SETUP_INSTRUCTIONS.md with step-by-step guide
- Document remaining steps that require database authentication
2025-12-03 22:16:12 -08:00

2.7 KiB

Complete Setup Instructions

Current Status

Completed:

  • Dependencies installed (backend & frontend)
  • Prisma client generated
  • Environment files created
  • Prisma schema fixed

Remaining (requires PostgreSQL authentication):

Step-by-Step Completion

1. Configure Database Connection

You need to set up PostgreSQL database access. Choose one method:

Option A: Using Docker (Easiest - No Password Needed)

# Start PostgreSQL container
docker-compose up -d postgres

# Update backend/.env
DATABASE_URL="postgresql://asle:asle_password@localhost:5432/asle?schema=public"

Option B: Local PostgreSQL (Requires Password)

# Create database (you'll need PostgreSQL admin password)
sudo -u postgres psql << EOF
CREATE DATABASE asle;
CREATE USER asle WITH PASSWORD 'asle_password';
GRANT ALL PRIVILEGES ON DATABASE asle TO asle;
EOF

# Update backend/.env
DATABASE_URL="postgresql://asle:asle_password@localhost:5432/asle?schema=public"

Option C: Use Existing PostgreSQL

If you have PostgreSQL running with different credentials:

# Update backend/.env with your connection string
DATABASE_URL="postgresql://your_user:your_password@localhost:5432/asle?schema=public"

2. Run Complete Setup

After configuring the database:

cd backend

# Run migrations
npm run prisma:migrate

# Initialize database
npm run setup:db

# Create admin user
npm run setup:admin

Or use the automated script:

cd backend
./setup-complete.sh

3. Start Services

# Terminal 1: Backend
cd backend
npm run dev

# Terminal 2: Frontend
cd frontend
npm run dev

4. Access Application

Troubleshooting

Database Connection Issues

  1. Verify PostgreSQL is running:

    pg_isready -h localhost -p 5432
    
  2. Test connection:

    psql $DATABASE_URL -c "SELECT version();"
    
  3. Check .env file:

    cat backend/.env | grep DATABASE_URL
    

Migration Issues

If migrations fail:

cd backend
npm run prisma:generate
npm run prisma:migrate

Admin User Creation

If admin setup fails, you can create manually:

cd backend
npm run setup:admin
# Follow prompts to create admin user

Quick Reference

Database Setup:

  • Docker: docker-compose up -d postgres
  • Local: Requires PostgreSQL admin access
  • See: DATABASE_SETUP.md for details

Complete Setup:

cd backend
npm run prisma:migrate
npm run setup:db
npm run setup:admin

Start Development:

# Backend
cd backend && npm run dev

# Frontend  
cd frontend && npm run dev