Skip to content
This repository was archived by the owner on Jun 19, 2026. It is now read-only.
Open
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
411 changes: 411 additions & 0 deletions BOUNTY_SUBMISSION.md

Large diffs are not rendered by default.

141 changes: 141 additions & 0 deletions DEPLOYMENT_QUICKSTART.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# πŸš€ FinMind Deployment Quick Start

Get FinMind running in under 5 minutes!

## πŸ“‹ Choose Your Platform

### 🐳 Local Development (Fastest)

```bash
git clone https://github.com/rohitdash08/FinMind.git
cd FinMind
cp .env.example .env
docker-compose up --build
```

**Access:** Frontend at http://localhost:5173, Backend at http://localhost:8000

---

### ☁️ Cloud Platforms (Production)

#### Railway (Easiest)
```bash
railway login
railway init
railway add --plugin postgresql redis
railway up
```

#### Heroku
```bash
heroku create finmind-app
heroku addons:create heroku-postgresql:mini heroku-redis:mini
git push heroku main
```

#### Render
1. Fork the repo
2. Create new Blueprint on render.com
3. Upload `deploy/platforms/render.yaml`
4. Deploy!

#### Fly.io
```bash
fly launch --config deploy/platforms/fly.toml
fly postgres create --name finmind-db
fly postgres attach finmind-db
fly deploy
```

---

### ☸️ Kubernetes (Advanced)

```bash
# Using Helm
helm install finmind ./deploy/kubernetes/helm/finmind \
--namespace finmind \
--create-namespace \
--set backend.secrets.JWT_SECRET='your-secret' \
--set ingress.hosts[0].host='your-domain.com'

# Using Tilt (local dev)
tilt up
```

---

## βœ… Verify Deployment

Run the verification script:

```bash
./deploy/verify-deployment.sh <backend-url> <frontend-url>
```

Or manually check:

```bash
# Backend health
curl http://your-backend/health
# Expected: {"status":"ok"}

# Backend readiness
curl http://your-backend/ready
# Expected: {"status":"ready","database":"connected"}

# Frontend
curl http://your-frontend/
# Expected: HTML page
```

---

## πŸ” Required Environment Variables

Minimum required:
- `JWT_SECRET` - Random secret for JWT tokens
- `DATABASE_URL` - PostgreSQL connection string
- `REDIS_URL` - Redis connection string

Optional (for features):
- `OPENAI_API_KEY` or `GEMINI_API_KEY` - For AI insights
- `TWILIO_*` - For WhatsApp notifications
- `SMTP_URL` - For email notifications

---

## πŸ“š Full Documentation

- **Complete Guide:** [deploy/DEPLOYMENT.md](deploy/DEPLOYMENT.md)
- **Kubernetes/Helm:** [deploy/kubernetes/helm/finmind/README.md](deploy/kubernetes/helm/finmind/README.md)
- **Platform Configs:** [deploy/platforms/](deploy/platforms/)

---

## πŸ†˜ Troubleshooting

### Database connection failed?
Check `DATABASE_URL` format: `postgresql+psycopg2://user:pass@host:5432/dbname`

### Redis connection failed?
Check `REDIS_URL` format: `redis://host:6379/0`

### 500 Internal Server Error?
Check backend logs: `docker-compose logs backend` or `kubectl logs -n finmind -l app.kubernetes.io/component=backend`

---

## πŸ’‘ Tips

- **Local dev:** Use `docker-compose` for simplicity
- **Quick deploy:** Railway or Heroku for instant hosting
- **Production:** Kubernetes with Helm for scalability
- **Dev K8s:** Tilt for the best local K8s experience

---

**Need help?** Open an issue: https://github.com/rohitdash08/FinMind/issues

**For bounty:** Contact @geekster007 on Discord before submission!
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,26 @@ finmind/
```

## Deployment
- Backend: Dockerized Flask to Railway/Render free tier (Postgres & Redis managed or via Compose locally).
- Frontend: Vercel.
- Secrets: use environment variables (.env locally, platform secrets in cloud).

### πŸš€ Quick Deploy

FinMind supports multiple deployment options:

- **Local Development:** Docker Compose (fastest setup)
- **Cloud PaaS:** Railway, Heroku, Render, Fly.io, DigitalOcean
- **Container Platforms:** AWS ECS, GCP Cloud Run, Azure Container Apps
- **Kubernetes:** Production-ready Helm chart with auto-scaling
- **Frontend CDN:** Vercel, Netlify

**Quick Start:** See [DEPLOYMENT_QUICKSTART.md](DEPLOYMENT_QUICKSTART.md)

**Complete Guide:** See [deploy/DEPLOYMENT.md](deploy/DEPLOYMENT.md)

### One-Click Deploy Buttons

[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template?template=https://github.com/rohitdash08/FinMind)
[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/rohitdash08/FinMind)
[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/rohitdash08/FinMind)

## Local Development
1) Prereqs: Docker, Docker Compose, Node 20+, Python 3.11+
Expand Down
99 changes: 99 additions & 0 deletions Tiltfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Tiltfile for FinMind local Kubernetes development
# Prerequisites:
# - Docker Desktop with Kubernetes enabled OR minikube/kind
# - Tilt installed: https://docs.tilt.dev/install.html
# - kubectl configured with local cluster context
# - Helm 3 installed

# Allow access from host machine
allow_k8s_contexts('docker-desktop')
allow_k8s_contexts('minikube')
allow_k8s_contexts('kind-*')

# Load environment variables from .env
load('ext://dotenv', 'dotenv')
dotenv(fn='.env')

# Build Docker images
docker_build(
'finmind/backend',
context='./packages/backend',
dockerfile='./packages/backend/Dockerfile',
live_update=[
sync('./packages/backend/app', '/app/app'),
sync('./packages/backend/wsgi.py', '/app/wsgi.py'),
run('pip install -r /app/requirements.txt', trigger='./packages/backend/requirements.txt'),
],
)

docker_build(
'finmind/frontend',
context='./app',
dockerfile='./app/Dockerfile',
live_update=[
sync('./app/src', '/app/src'),
sync('./app/public', '/app/public'),
run('cd /app && npm install', trigger='./app/package.json'),
],
)

# Install Helm chart
k8s_yaml(
helm(
'./deploy/kubernetes/helm/finmind',
name='finmind',
namespace='finmind',
values=['./deploy/kubernetes/helm/finmind/values.yaml'],
set=[
'backend.image.repository=finmind/backend',
'backend.image.tag=latest',
'frontend.image.repository=finmind/frontend',
'frontend.image.tag=latest',
'ingress.enabled=false', # Use port-forward for local dev
'backend.autoscaling.enabled=false', # Disable HPA for local dev
'frontend.autoscaling.enabled=false',
'postgresql.persistence.enabled=false', # Use emptyDir for local dev
]
)
)

# Resource dependencies
k8s_resource(
'finmind-postgresql',
port_forwards='5432:5432',
labels=['database'],
)

k8s_resource(
'finmind-redis',
port_forwards='6379:6379',
labels=['cache'],
)

k8s_resource(
'finmind-backend',
port_forwards='8000:8000',
resource_deps=['finmind-postgresql', 'finmind-redis'],
labels=['backend'],
)

k8s_resource(
'finmind-frontend',
port_forwards='3000:80',
resource_deps=['finmind-backend'],
labels=['frontend'],
)

# Local URLs
print("""
╔════════════════════════════════════════════════════════════╗
β•‘ FinMind Local Development β•‘
╠════════════════════════════════════════════════════════════╣
β•‘ Frontend: http://localhost:3000 β•‘
β•‘ Backend: http://localhost:8000 β•‘
β•‘ PostgreSQL: localhost:5432 β•‘
β•‘ Redis: localhost:6379 β•‘
β•‘ β•‘
β•‘ Press 'space' to open Tilt UI β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
""")
Loading