Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,36 @@ poetry run black . # fix formatting

GitHub Actions runs tests and Black checks on push/PRs. Coverage is optionally uploaded to Codecov.

## Deployment

The React frontend is hosted on Vercel and the FastAPI backend on Fly.io.

### Frontend (Vercel)

Vercel deploys automatically on push to `main` via GitHub integration.

1. Install the Vercel CLI: `npm install -g vercel`
2. Link the project: `cd frontend && vercel link`
3. Set the Mapbox token as an environment variable in the Vercel dashboard:
- Key: `VITE_MAPBOX_TOKEN`
- Value: your Mapbox token
- Environment: Production (and Preview if desired)
4. Deploy manually if needed: `vercel --prod`

### Backend (Fly.io)

1. Install the Fly CLI: `brew install flyctl`
2. Authenticate: `flyctl auth login`
3. Create the app (first time only): `cd backend && flyctl launch --no-deploy`
4. Set secrets:
```sh
flyctl secrets set GOOGLE_MAPS_API_KEY=your_key_here
```
5. Deploy: `flyctl deploy`
6. Check health: `curl https://indy-explorer-backend.fly.dev/health`

Subsequent deploys run automatically on push to `main` via the CI/CD pipeline (to be configured in a later issue).

## Contributing

1. Fork the repository.
Expand Down
5 changes: 5 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Backend environment variables
# Copy to .env and fill in values (never commit .env)

# Required for geocoding (only needed when regenerating data/resort_locations.csv)
GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here
23 changes: 23 additions & 0 deletions backend/fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
app = "indy-explorer-backend"
primary_region = "iad"

[build]

[http_service]
internal_port = 8000
force_https = true
auto_stop_machines = "stop"
auto_start_machines = true
min_machines_running = 0

[[http_service.checks]]
grace_period = "10s"
interval = "30s"
method = "GET"
path = "/health"
timeout = "5s"

[[vm]]
memory = "256mb"
cpu_kind = "shared"
cpus = 1
6 changes: 6 additions & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Frontend environment variables
# Copy to .env.local and fill in values (never commit .env.local)
# In Vercel, set these in the dashboard under Project Settings > Environment Variables

# Required for map rendering
VITE_MAPBOX_TOKEN=your_mapbox_token_here
7 changes: 7 additions & 0 deletions frontend/vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"buildCommand": "npm run build",
"outputDirectory": "dist",
"rewrites": [
{ "source": "/(.*)", "destination": "/index.html" }
]
}
Loading