Files
asle/docs/archive/COMPLETE_SETUP_INSTRUCTIONS.md
defiQUG e227931583 Deduplicate and prune project root and docs/ directory
- Consolidate setup documentation: merge COMPLETE_SETUP_INSTRUCTIONS into QUICK_START
- Consolidate status docs: merge SETUP_PROGRESS, SETUP_COMPLETE, COMPLETION_STATUS into STATUS
- Consolidate review docs: merge REVIEW_SUMMARY into PROJECT_REVIEW
- Archive 7 redundant files to docs/archive/
- Update DOCUMENTATION_INDEX.md and README.md references
- Create archive README explaining consolidation
- Reduce root documentation from 19 to 13 files (32% reduction)
- Eliminate ~400 lines of duplicate content
2025-12-03 22:59:57 -08:00

156 lines
2.7 KiB
Markdown

# 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)
```bash
# 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)
```bash
# 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:
```bash
# 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:
```bash
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:
```bash
cd backend
./setup-complete.sh
```
### 3. Start Services
```bash
# 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
1. **Verify PostgreSQL is running:**
```bash
pg_isready -h localhost -p 5432
```
2. **Test connection:**
```bash
psql $DATABASE_URL -c "SELECT version();"
```
3. **Check .env file:**
```bash
cat backend/.env | grep DATABASE_URL
```
### Migration Issues
If migrations fail:
```bash
cd backend
npm run prisma:generate
npm run prisma:migrate
```
### Admin User Creation
If admin setup fails, you can create manually:
```bash
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:**
```bash
cd backend
npm run prisma:migrate
npm run setup:db
npm run setup:admin
```
**Start Development:**
```bash
# Backend
cd backend && npm run dev
# Frontend
cd frontend && npm run dev
```