AI-powered hiking assistant with iOS (SwiftUI) frontend and FastAPI backend. Features include authentication (email + OAuth), AI gear and hike suggestions, trail upload, websocket chat, and profile setup.
- Backend: FastAPI, Uvicorn, SQLAlchemy, Alembic, PostgreSQL, Redis, Celery, Flower
- Integrations: OpenAI, SMTP (Gmail/SendGrid), Google OAuth, OpenWeatherMap, Google Places
- Frontend (iOS): SwiftUI, URLSession networking, optional WebSocket client
Location: back/AIgyr
- Python 3.10
- Docker and Docker Compose (recommended)
- Alternatively: local PostgreSQL and Redis
Create back/AIgyr/.env from env.example and fill values:
# Database
DATABASE_URL=postgresql://username:password@localhost:5432/aigyr_db
# JWT
SECRET_KEY=your-secret-key-here
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=10080
# SMTP (for email verification)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=[email protected]
SMTP_APP_PASSWORD=your-gmail-app-password
SMTP_USE_TLS=true
SMTP_USE_SSL=false
# Email verification
EMAIL_VERIFICATION_VERIFICATION_CODE_LENGTH=6
EMAIL_VERIFICATION_VERIFICATION_CODE_EXPIRY_MINUTES=10
EMAIL_VERIFICATION_EMAIL_SUBJECT=Your Verification Code
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0
REDIS_PASSWORD=
# OpenAI
OPENAI_API_KEY=your-openai-api-key
# Google OAuth
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# External APIs
OPENWEATHER_API_KEY=your-openweathermap-api-key
GOOGLE_PLACES_API_KEY=your-google-places-api-keyFrom back/AIgyr:
docker compose up --buildServices started:
- API:
http://localhost:8000 - Postgres:
localhost:5433(container port 5432) - Redis:
localhost:6379 - Celery worker and Flower (monitor):
http://localhost:5555
Alembic migrations run via the alembic service automatically. To re-run manually:
docker compose run --rm alembic alembic upgrade headFrom back/AIgyr:
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# Ensure Postgres and Redis are running locally, then:
alembic upgrade head
uvicorn src.main:app --host 0.0.0.0 --port 8000 --reloadGET /health- Auth:
POST /auth/register,POST /auth/login,POST /auth/send-code,POST /auth/verify-code,GET /auth/me,PUT /auth/profile,DELETE /auth/delete-account,POST /auth/google,POST /auth/apple - AI Engine:
POST /aiengine/gear-recommend,POST /aiengine/gear-and-hike-suggest,POST /aiengine/orchestrate - Peaks: mounted under
/peaks(browse for filters/listing) - WebSocket:
ws://<host>:8000/ws - Static legal pages:
GET /privacy-policy,GET /terms-of-service
Location: SwiftUIFront/AIGear
- Xcode 15+
- iOS 17+ (recommended target)
Update the backend URL in these files if you are not using the default/hotspot IP:
AIGear/Network/NetworkService.swift→baseURLAIGear/Services/Auth/AuthService.swift→baseURL
Example for local simulator connecting to Docker on the host:
private let baseURL = "http://localhost:8000"If running on a physical device, set baseURL to your machine’s LAN IP, e.g. http://192.168.1.10:8000.
- Open
SwiftUIFront/AIGear/AIGear.xcodeprojin Xcode - Select a simulator or your device
- Build and run
Click the image above to watch the demo video
- Email/password sign up and login, email verification flow
- Google/Apple sign-in endpoints supported on backend
- AI gear and hike suggestions (calls
/aiengine/*) - Trail data upload
- Profile setup and update (
/auth/profile) - Optional WebSocket chat (
/ws) – client scaffold present
- CORS is open for development. Restrict
allow_originsinsrc/main.pyfor production. - Legal documents are served from
back/AIgyr/static/legal. - Background jobs use Celery + Redis; monitor with Flower (
:5555).
- Python tests:
pytest(backend)
Proprietary – All rights reserved.