mirror of
https://github.com/bitbaum/evig.git
synced 2026-12-04 05:37:00 +01:00
Docs truth-sweep against ground truth (package.json, CI workflows): - npm → pnpm across evergreen docs (pnpm 11.25.0 is the package manager; npx tsx → pnpm exec tsx, npx ts-prune/jscpd → pnpm dlx, npm ci → pnpm install --frozen-lockfile, package-lock.json → pnpm-lock.yaml) - Jest → Vitest in README, CONTRIBUTING, COMMANDS (vitest 4 is installed) - Node claims: README 20+ → 22.13+ (engines) with CI/deploy on 24; deployment.md "Setup Node 20 (npm cache)" → Node 24 (pnpm cache), and the pipeline line now shows `pnpm run verify` as CI actually runs - TypeScript 5.x claims → 6 (typescript ^6.0.3); Next.js 14 → 16 in BLOG_SYSTEM, guides/ARCHITECTURE, AI_BOT_SYSTEM_PROMPT - COMMANDS.md: dropped nonexistent `dev:cms` script; services list fixed to db/meilisearch/listmonk (no redis in compose) - HR_RUNBOOK: `npm run test -- src/…` → `pnpm run test src/…` (pnpm passes args without the `--` separator) Historical records (docs/archive/**, dated audit reports, UPGRADE_PLAN) left as-is — they describe what was true when written. Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
5.2 KiB
5.2 KiB
Installation Guide
This guide will help you set up the RevampIT development environment on your local machine.
Prerequisites
Before you begin, ensure you have the following installed:
Quick Setup
1. Clone the Repository
git clone https://github.com/your-org/revampit.git
cd revampit
2. Install Dependencies
# Install frontend dependencies
pnpm install
# Install CMS API dependencies
cd cms-api
pnpm install
cd ..
3. Environment Configuration
Frontend Environment
cp .env.example .env.local
Edit .env.local with your configuration:
# Frontend Configuration
NEXT_PUBLIC_API_URL=http://localhost:3001
NEXT_PUBLIC_SITE_URL=http://localhost:3000
# Database — DATABASE_URL is the single connection source (app + auth share this pool).
# Local dev: Docker Postgres (pnpm run services:up → port 5433)
DATABASE_URL=postgresql://postgres:your_password@localhost:5433/revampit_cms
CMS API Environment
cd cms-api
cp .env.example .env
Edit cms-api/.env with your configuration:
# Server Configuration
PORT=3001
NODE_ENV=development
# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_NAME=revampit_cms
DB_USER=postgres
DB_PASSWORD=your_password
# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key-change-in-production
JWT_EXPIRES_IN=24h
# CORS Configuration
FRONTEND_URL=http://localhost:3000
# Admin User Configuration
ADMIN_EMAIL=admin@revampit.ch
ADMIN_PASSWORD=Admin123!
ADMIN_FIRST_NAME=Admin
ADMIN_LAST_NAME=User
4. Database Setup
Option A: Using Docker (Recommended)
# Start PostgreSQL container
docker-compose up -d postgres
# The database will be automatically created with the correct schema
Option B: Local PostgreSQL
# Create database
createdb revampit_cms
# Run migrations
cd cms-api
pnpm run migrate
cd ..
5. Start Development Servers
Open two terminal windows:
Terminal 1 - CMS API:
cd cms-api
pnpm run dev
Terminal 2 - Frontend:
pnpm run dev
6. Access the Application
- Frontend: http://localhost:3000
- CMS API: http://localhost:3001
- Admin Interface: http://localhost:3000/admin/login
Default Admin Credentials
- Email: admin@revampit.ch
- Password: Admin123!
Docker Development (Alternative)
If you prefer using Docker for the entire development environment:
# Start all services
docker-compose -f docker-compose.dev.yml up
# Or run in background
docker-compose -f docker-compose.dev.yml up -d
This will start:
- PostgreSQL database
- CMS API server
- Frontend development server
Troubleshooting
Common Issues
Port Already in Use
# Check what's using the port
lsof -i :3000 # or :3001
# Kill the process
kill -9 <PID>
Database Connection Issues
# Check PostgreSQL status
brew services list | grep postgresql # macOS
systemctl status postgresql # Linux
net start postgresql # Windows
# Test connection
psql -h localhost -p 5432 -U postgres -d revampit_cms
Permission Issues
# Fix pnpm store permissions (Unix/Linux)
sudo chown -R $(whoami) "$(pnpm store path)"
# Prune the pnpm store
pnpm store prune
Module Not Found
# Clear node_modules and reinstall
rm -rf node_modules
pnpm install
# Also clear cms-api modules
cd cms-api
rm -rf node_modules
pnpm install
cd ..
Environment-Specific Issues
macOS
# Install Command Line Tools if needed
xcode-select --install
# Install Homebrew if needed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install PostgreSQL via Homebrew
brew install postgresql@15
brew services start postgresql@15
Windows
# Use Windows Subsystem for Linux (WSL) for better compatibility
wsl --install
# Or use PowerShell with elevated privileges for npm global packages
Linux (Ubuntu/Debian)
# Update package list
sudo apt update
# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install PostgreSQL
sudo apt install postgresql postgresql-contrib
sudo systemctl start postgresql
sudo systemctl enable postgresql
Verification
After installation, verify everything works:
# Check frontend
curl http://localhost:3000
# Check API health
curl http://localhost:3001/health
# Check database connection
cd cms-api && pnpm run db:status
Next Steps
- Read the Development Guide
- Check the API Documentation
- Review the Contributing Guidelines
- Explore the CMS User Guide
Getting Help
If you encounter issues:
- Check the Troubleshooting section above
- Search GitHub Issues
- Create a new issue with details about your environment and the problem
- Join our community discussions
Happy coding! 🚀