Correct documented dev ports and ignore local tooling output
CLAUDE.md described the backend on 8000 and the frontend on 3000, but frontend/.env has overridden these to 8002 and 5172 (matching .env.example and the CORS defaults in settings.py). Following the documented ports leads to checking servers that are not there. Also records the CORS_ALLOWED_ORIGINS override and the real default origin list, and notes that the frontend port comes from frontend/.env. The serial bridge's BACKEND_URL is left at 8000 because that is what serial_bridge/.env actually contains - it points at a port Django no longer listens on, which is a config issue to fix separately, not a documentation error. Adds .claude/screenshots/ and .playwright-mcp/ to .gitignore so local verification output stays out of the repository. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -73,3 +73,7 @@ tools/license_private.key
|
||||
|
||||
# Local config backups
|
||||
*.env.bak
|
||||
|
||||
# Local tooling artifacts
|
||||
.claude/screenshots/
|
||||
.playwright-mcp/
|
||||
|
||||
@@ -5,8 +5,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
||||
## System Overview
|
||||
|
||||
ScalesApp is a three-tier weighing scale management system with real-time data synchronization:
|
||||
- **Django Backend** (REST API + Server-Sent Events) on port 8000
|
||||
- **React Frontend** (SPA) on port 3000
|
||||
- **Django Backend** (REST API + Server-Sent Events) on port 8002
|
||||
- **React Frontend** (SPA) on port 5172
|
||||
- **Serial Bridge** (Flask SSE server) on port 5000 for COM port reading
|
||||
|
||||
## Development Commands
|
||||
@@ -25,8 +25,8 @@ python manage.py migrate
|
||||
python manage.py createsuperuser
|
||||
|
||||
# Run server
|
||||
python manage.py runserver # Development (WSGI)
|
||||
uvicorn scalesapp.asgi:application --reload # Development (ASGI - for SSE)
|
||||
python manage.py runserver 8002 # Development (WSGI)
|
||||
uvicorn scalesapp.asgi:application --reload --port 8002 # Development (ASGI - for SSE)
|
||||
|
||||
# Testing (when implemented)
|
||||
python manage.py test
|
||||
@@ -38,7 +38,7 @@ python manage.py test api.tests.test_models # Single test file
|
||||
```bash
|
||||
cd frontend
|
||||
npm install
|
||||
npm start # Development server
|
||||
npm start # Development server (port from frontend/.env, currently 5172)
|
||||
npm run build # Production build
|
||||
npm test # Run tests
|
||||
```
|
||||
@@ -253,7 +253,8 @@ Element (base class)
|
||||
- SSE connection authenticated via query param: `/sse-connect/?token=<jwt>` or Authorization header
|
||||
|
||||
**CORS Configuration:**
|
||||
- Allowed origins: http://localhost:3000, http://127.0.0.1:3000, http://localhost:5174
|
||||
- Allowed origins (default): http://localhost:5172, http://127.0.0.1:5172, http://localhost:3000, http://127.0.0.1:3000, http://localhost:5174, http://127.0.0.1:5174
|
||||
- Override with the `CORS_ALLOWED_ORIGINS` env var (comma-separated)
|
||||
- Credentials allowed (for cookies if needed)
|
||||
|
||||
**User Roles:**
|
||||
@@ -316,7 +317,8 @@ DB_PORT=5432
|
||||
|
||||
**Frontend:** `frontend/.env`
|
||||
```
|
||||
REACT_APP_API_URL=http://localhost:8000
|
||||
PORT=5172
|
||||
REACT_APP_API_URL=http://localhost:8002
|
||||
```
|
||||
|
||||
**Serial Bridge:** `serial_bridge/.env`
|
||||
@@ -330,11 +332,11 @@ DEBUG=False
|
||||
|
||||
## Running the Full Application
|
||||
|
||||
1. Start Django: `cd backend && python manage.py runserver`
|
||||
1. Start Django: `cd backend && python manage.py runserver 8002`
|
||||
2. Start Serial Bridge: `cd serial_bridge && python app.py`
|
||||
3. Start React: `cd frontend && npm start`
|
||||
|
||||
For SSE to work properly in Django, use uvicorn instead: `uvicorn scalesapp.asgi:application --reload`
|
||||
For SSE to work properly in Django, use uvicorn instead: `uvicorn scalesapp.asgi:application --reload --port 8002`
|
||||
|
||||
## Common Patterns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user