codenuk_backend_mine/LOCAL_DEVELOPMENT_SETUP.md
2025-10-10 08:56:39 +05:30

64 lines
1.9 KiB
Markdown

# Local Development Setup
## Configuration Changes Made
### Frontend (Port 3001)
- Updated `src/config/backend.ts` to use `http://localhost:8000`
- Updated `src/app/api/ai/tech-recommendations/route.ts` to use local backend
- Updated `README.md` to reflect port 3001
- Frontend package.json already configured for port 3001
### Backend (Port 8000)
- Updated `config/urls.js` to use `http://localhost:3001` for frontend
- Updated `docker-compose.yml`:
- CORS_ORIGINS set to `http://localhost:3001`
- FRONTEND_URL environment variables updated to `http://localhost:3001`
- API_GATEWAY_PUBLIC_URL updated to `http://localhost:8000`
- All OAuth redirect URIs updated to use localhost:8000
- Updated AI mockup service CORS configuration
- Updated quick start scripts to use port 3001
## How to Run Locally
### 1. Start Backend Services
```bash
cd /home/tech4biz/Documents/merge/codenuk-backend-live
docker-compose up -d
```
### 2. Start Frontend
```bash
cd /home/tech4biz/Documents/merge/codenuk-frontend-live
npm run dev
```
### 3. Access Applications
- Frontend: http://localhost:3001
- Backend API Gateway: http://localhost:8000
- Backend Health Check: http://localhost:8000/health
## Verification Steps
1. **Check Backend Health**: Visit http://localhost:8000/health
2. **Check Frontend**: Visit http://localhost:3001
3. **Test API Communication**: The frontend should be able to make API calls to the backend
4. **Check CORS**: No CORS errors should appear in browser console
## Port Mappings
- Frontend: 3001
- Backend API Gateway: 8000
- PostgreSQL: 5432
- Redis: 6379
- MongoDB: 27017
- RabbitMQ: 5672 (management: 15672)
- Neo4j: 7474 (browser), 7687 (bolt)
- ChromaDB: 8010
## Environment Variables
The following environment variables are now configured for local development:
- `FRONTEND_URL=http://localhost:3001`
- `BACKEND_URL=http://localhost:8000`
- `CORS_ORIGINS=http://localhost:3001`