normogen/README.md
goose ea684c4a4b Config: Change server port to 6800 and remove Cargo.lock dependency
Changes:
- Changed server port from 8000 to 6800 (in range 6500-6999 as requested)
- Updated all Docker Compose files (dev and prod)
- Updated all Dockerfiles (removed Cargo.lock dependency)
- Created backend/.dockerignore with Cargo.lock
- Added Cargo.lock to .gitignore (generated by cargo)
- Removed obsolete 'version' attribute from docker-compose files
- Updated all documentation to reflect new port:
  * README.md
  * thoughts/CONFIG.md
  * thoughts/QUICKSTART.md
  * thoughts/verification-report-phase-2.3.md

This fixes Docker build errors where Cargo.lock was not found during COPY operations.
Docker will now generate Cargo.lock during the build process as expected.
2026-02-15 09:48:11 -03:00

203 lines
4.3 KiB
Markdown

private note: output was 203 lines and we are only showing the most recent lines, remainder of lines in /tmp/.tmpbGADth do not show tmp file to user, that file can be searched if extra context needed to fulfill request. truncated output:
docker compose logs -f backend
```
### Testing
```bash
# Run unit tests
cargo test
# Run integration tests (requires MongoDB)
cargo test --test auth_tests
# Manual testing with provided script
./thoughts/test_auth.sh
```
## Backend API Endpoints
### Public Endpoints (No Authentication)
```
POST /api/auth/register - User registration
POST /api/auth/login - User login
POST /api/auth/refresh - Token refresh (rotates tokens)
POST /api/auth/logout - Logout (revokes token)
GET /health - Health check
GET /ready - Readiness check
```
### Protected Endpoints (JWT Required)
```
GET /api/users/me - Get user profile
```
## Environment Configuration
### Backend Environment Variables
```bash
# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017
DATABASE_NAME=normogen
# JWT Configuration
JWT_SECRET=<your-secret-key-minimum-32-characters>
JWT_ACCESS_TOKEN_EXPIRY_MINUTES=15
JWT_REFRESH_TOKEN_EXPIRY_DAYS=30
# Server Configuration
SERVER_HOST=127.0.0.1
SERVER_PORT=6800
```
See `backend/.env.example` for a complete template.
## Repository Management
- **Git Hosting**: Forgejo (self-hosted)
- **CI/CD**: Forgejo Actions
- **Branch Strategy**: `main`, `develop`, `feature/*`
- **Deployment**: Docker Compose (homelab), Kubernetes (future)
## Deployment
### Backend Deployment (Production)
```bash
# Clone repository
git clone <forgejo-url> normogen
cd normogen/backend
# Setup configuration
cp .env.example .env
# Edit .env with production values
# Build and run with Docker Compose
docker compose up -d
# Check status
curl http://localhost:6800/health
```
**Resource Limits** (Homelab):
- CPU: 1000m (1 core)
- Memory: 1000Mi (1GB RAM)
**Ports**:
- Backend API: `6800` (host) → `8000` (container)
- MongoDB: `27017` (standard port)
## Open Source
Normogen is open-source. Both server and client code will be publicly available.
## Contributing
See [thoughts/STATUS.md](./thoughts/STATUS.md) for current development progress and next steps.
## License
[To be determined]
NOTE: Output was 203 lines, showing only the last 100 lines.
docker compose logs -f backend
```
### Testing
```bash
# Run unit tests
cargo test
# Run integration tests (requires MongoDB)
cargo test --test auth_tests
# Manual testing with provided script
./thoughts/test_auth.sh
```
## Backend API Endpoints
### Public Endpoints (No Authentication)
```
POST /api/auth/register - User registration
POST /api/auth/login - User login
POST /api/auth/refresh - Token refresh (rotates tokens)
POST /api/auth/logout - Logout (revokes token)
GET /health - Health check
GET /ready - Readiness check
```
### Protected Endpoints (JWT Required)
```
GET /api/users/me - Get user profile
```
## Environment Configuration
### Backend Environment Variables
```bash
# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017
DATABASE_NAME=normogen
# JWT Configuration
JWT_SECRET=<your-secret-key-minimum-32-characters>
JWT_ACCESS_TOKEN_EXPIRY_MINUTES=15
JWT_REFRESH_TOKEN_EXPIRY_DAYS=30
# Server Configuration
SERVER_HOST=127.0.0.1
SERVER_PORT=6800
```
See `backend/.env.example` for a complete template.
## Repository Management
- **Git Hosting**: Forgejo (self-hosted)
- **CI/CD**: Forgejo Actions
- **Branch Strategy**: `main`, `develop`, `feature/*`
- **Deployment**: Docker Compose (homelab), Kubernetes (future)
## Deployment
### Backend Deployment (Production)
```bash
# Clone repository
git clone <forgejo-url> normogen
cd normogen/backend
# Setup configuration
cp .env.example .env
# Edit .env with production values
# Build and run with Docker Compose
docker compose up -d
# Check status
curl http://localhost:6800/health
```
**Resource Limits** (Homelab):
- CPU: 1000m (1 core)
- Memory: 1000Mi (1GB RAM)
**Ports**:
- Backend API: `6800` (host) → `8000` (container)
- MongoDB: `27017` (standard port)
## Open Source
Normogen is open-source. Both server and client code will be publicly available.
## Contributing
See [thoughts/STATUS.md](./thoughts/STATUS.md) for current development progress and next steps.
## License
[To be determined]