- 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
2.7 KiB
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
- Frontend: http://localhost:3000
- Backend API: http://localhost:4000/api
- GraphQL: http://localhost:4000/graphql
- Admin: http://localhost:3000/admin
Troubleshooting
Database Connection Issues
-
Verify PostgreSQL is running:
pg_isready -h localhost -p 5432 -
Test connection:
psql $DATABASE_URL -c "SELECT version();" -
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.mdfor 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