replace nginx with existing traefik, split networks.

This commit is contained in:
Jake Kasper
2025-08-21 07:23:55 -05:00
parent b3662ea35e
commit 3840b627dc
6 changed files with 64 additions and 193 deletions

View File

@@ -66,7 +66,7 @@ TurfTracker is a comprehensive web application designed for homeowners to track
- **Frontend**: React 18, Tailwind CSS, React Router, React Query, Leaflet Maps
- **Backend**: Node.js, Express.js, PostgreSQL
- **Authentication**: JWT, OAuth2 (Authentik)
- **Infrastructure**: Docker, Nginx
- **Infrastructure**: Docker, Traefik
- **Maps**: OpenStreetMap via Leaflet, Esri Satellite Imagery
- **APIs**: OpenWeatherMap
@@ -75,8 +75,18 @@ TurfTracker is a comprehensive web application designed for homeowners to track
### Prerequisites
- Docker and Docker Compose
- Traefik reverse proxy running with `proxy` network
- DNS pointing `turftracker.kaspers.us` to your server
- Git
### Traefik Configuration Notes
This application is pre-configured for deployment behind Traefik with:
- **Networks**: `proxy` (external) for Traefik, `turftracker` (internal) for service communication
- **SSL/TLS**: Automatic Let's Encrypt certificates via Traefik
- **Security**: Database isolated from public network
- **Routing**: Frontend serves on root, API on `/api` path
### Installation
1. **Clone the repository**
@@ -123,14 +133,14 @@ TurfTracker is a comprehensive web application designed for homeowners to track
```
4. **Access the application**
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- Database: localhost:5432
- Application: https://turftracker.kaspers.us
- API: https://turftracker.kaspers.us/api
- Database: Internal network only (not exposed)
### First Time Setup
1. **Create an admin account**
- Go to http://localhost:3000/register
- Go to https://turftracker.kaspers.us/register
- Register with your email and password
- The first user becomes an admin automatically
@@ -212,7 +222,7 @@ If you have an Authentik instance for SSO:
- Create new "OAuth2/OpenID Provider"
- Set Authorization grant type: `authorization-code`
- Set Client type: `confidential`
- Set Redirect URIs: `http://localhost:5000/api/auth/authentik/callback`
- Set Redirect URIs: `https://turftracker.kaspers.us/api/auth/authentik/callback`
- Note the Client ID and Client Secret
2. **In your `.env` file:**
@@ -220,7 +230,7 @@ If you have an Authentik instance for SSO:
AUTHENTIK_CLIENT_ID=your-client-id-from-authentik
AUTHENTIK_CLIENT_SECRET=your-client-secret-from-authentik
AUTHENTIK_BASE_URL=https://your-authentik-domain.com
AUTHENTIK_CALLBACK_URL=http://localhost:5000/api/auth/authentik/callback
AUTHENTIK_CALLBACK_URL=https://turftracker.kaspers.us/api/auth/authentik/callback
```
3. **In Authentik Applications:**
@@ -252,9 +262,7 @@ turftracker/
│ └── package.json
├── database/ # PostgreSQL schema
│ └── init.sql # Database initialization
── nginx/ # Reverse proxy configuration
│ └── nginx.conf
└── docker-compose.yml # Container orchestration
── docker-compose.yml # Container orchestration with Traefik
```
## Usage Guide