A production-ready, privacy-first platform for LGBTQ+ sexual fluidity analysis
- Zero Data Persistence - All analysis happens in-memory only
- No Tracking - Absolutely no analytics or third-party scripts
- No PII Collection - Complete anonymity guaranteed
- Open Source - Full transparency in code and data handling
- Bilingual Support - Full Thai/English language support
- Accessibility - WCAG AA compliant
- SDG Aligned - UN Goals 3, 5, 10 (Health, Gender Equality, Reduced Inequalities)
- Mobile Responsive - Works seamlessly on all devices
- Docker Containerized - Easy deployment anywhere
- Kubernetes Ready - Horizontal auto-scaling included
- CI/CD Pipeline - Automated testing and deployment
- Comprehensive Testing - 19 E2E Cypress tests
- Statistical fluidity scoring
- Confidence intervals
- Pattern recognition
- Visual data representation
Working on this project? Read these first:
- 🔐 Security & Secrets Management - Critical for all contributors
- 🤖 Copilot Instructions - For AI-assisted development
Never commit API keys, tokens, or secrets to Git! This project has had 3 exposure incidents. Learn from them.
- Docker & Docker Compose (recommended) OR
- Python 3.12+ and Node.js 20+ (for local development)
# Clone the repository
git clone https://github.com/pichitchaipae/lgbtq-fluidity-analyzer.git
cd lgbtq-fluidity-analyzer
# Start the application
docker-compose up -d
# Access the application
# Frontend: http://localhost:3000
# Backend API: http://localhost:8000/docsThat's it! 🎉
| Guide | Description |
|---|---|
| 📖 Documentation Index | Complete documentation catalog |
| 🚀 Quick Start | Get started in 5 minutes |
| 🐙 GitHub Upload | Push to GitHub guide |
| 🐳 Docker & K8s | Container deployment |
| 📦 Full Deployment | Complete deployment guide |
| 🤝 Contributing | How to contribute |
| 🔒 Security | Security policy |
- 🏳️🌈 LGBTQ+ Sexual Fluidity Analysis Platform
.
├── backend/ # FastAPI service
│ ├── app/
│ │ ├── api/ # HTTP routes
│ │ ├── core/ # Settings & config
│ │ ├── schemas/ # Pydantic models
│ │ └── services/ # Business logic (LGBTQAnalyzer)
│ ├── tests/ # Pytest test-suite
│ ├── Dockerfile # Production container
│ └── requirements.txt
├── frontend/ # React + Vite + Tailwind application
│ ├── src/
│ │ ├── App.tsx # Survey experience (Thai/English)
│ │ ├── api.ts # REST client
│ │ └── __tests__/ # Vitest/RTL specs
│ ├── Dockerfile # Nginx production container
│ ├── nginx.conf # Nginx configuration
│ └── package.json
├── k8s/ # Kubernetes manifests
│ ├── namespace.yaml # Dedicated namespace
│ ├── configmap.yaml # Environment configs
│ ├── backend-deployment.yaml # 3-replica backend
│ ├── frontend-deployment.yaml # 2-replica frontend
│ ├── hpa.yaml # Horizontal autoscaling
│ ├── cypress-job.yaml # E2E testing job
│ └── ingress.yaml # NGINX ingress + TLS
├── cypress/ # E2E test suite
│ ├── e2e/
│ │ └── lgbtq-analysis.cy.js # 19 automated tests
│ ├── support/ # Custom commands
│ └── cypress.config.js
├── scripts/ # Automation scripts
│ ├── deploy.ps1 # Windows deployment script
│ ├── deploy-production.sh # Linux/Mac deployment
│ ├── fix-ci.ps1 # CI maintenance tool
│ └── test-docker.sh # Docker testing
├── .github/workflows/ci.yml # CI/CD pipeline
├── docker-compose.yml # Local development
└── README.md
- Framework: FastAPI + Uvicorn (4 workers in production)
- Logic:
LGBTQAnalyzerencapsulates weighted scoring, interpretation, and insight generation. - Schemas: Pydantic models handle request validation and rich responses.
- API Surface:
GET /health– readiness probe (Kubernetes health checks)POST /api/v1/analysis– accepts 12 integer responses (0-4) and returns aggregate scoring with insights
- Testing: Pytest unit + API integration coverage.
- Container: Multi-stage Python 3.12 image with non-root user and health checks.
- Scaling: 3-10 replicas via HPA (70% CPU threshold).
- Stack: React 18, TypeScript, Vite, TailwindCSS, React Query.
- Languages: Full Thai/English bilingual support (toggle in header).
- UX: Accessible form, colorful gradient layout, live validation, result visualization with emojis.
- Data Flow: Declarative mutation orchestrated via React Query calling the FastAPI endpoint.
- Testing: Vitest + Testing Library + Cypress E2E (19 automated tests).
- Container: Multi-stage build (Node → Nginx) with gzip, security headers, health checks.
- Scaling: 2-5 replicas via HPA (75% CPU threshold).
- Coverage: 19 comprehensive tests covering:
- Language toggle (Thai ⇄ English)
- Survey form interaction (all 6 question groups)
- Results display and translation
- API integration
- Responsive design (mobile/tablet/desktop)
- Execution: Docker container or Kubernetes Job
- Artifacts: Video recordings and screenshots on failure
- CI/CD: Automated in GitHub Actions pipeline
- Orchestration: Kubernetes with namespaces, ConfigMaps, HPA, Ingress
- Networking: ClusterIP (backend) + LoadBalancer (frontend)
- Security: Non-root containers, resource limits, network policies
- Privacy: No persistent volumes (in-memory processing only)
- Monitoring: Health checks, readiness/liveness probes
- Scaling: Automatic based on CPU/memory metrics
.editorconfigand Prettier-compatible ESLint configuration.- Optional pre-commit hooks for formatting and linting (
.pre-commit-config.yaml). - Renovate-ready dependency definitions (configure in your org if desired).
# Start all services
docker-compose up -d
# Access:
# - Frontend: http://localhost:3000
# - Backend API: http://localhost:8000
# - API Docs: http://localhost:8000/docs
# Run with Cypress tests
docker-compose --profile test up
# Stop services
docker-compose down# Run interactive deployment script (Windows)
.\scripts\deploy.ps1
# Or for Linux/Mac
./scripts/deploy-production.sh
# Choose from:
# 1. Docker Compose (Local Development)
# 2. Docker Compose with Cypress Tests
# 3. Kubernetes Deployment
# 4. Kubernetes with Cypress Tests
# 5. Build Docker Images Only
# 6. Install Cypress Locally- Python 3.12+
- Node.js 18+
- npm or pnpm
cd backend
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txt
uvicorn app.main:app --reloadEnvironment variables can be defined via .env (see .env.example).
cd frontend
npm install
npm run devSet VITE_API_BASE_URL in .env (default assumes http://localhost:8000/api/v1).
- Backend:
cd backend && pytest - Frontend:
cd frontend && npm test - GitHub Actions (
.github/workflows/ci.yml) runs both suites, lints, and builds Docker images.
- Build backend container:
docker build -t lgbtq-analyzer-api backend - Deploy to any container platform (Azure App Service, AWS ECS, GCP Cloud Run, etc.)
- Frontend
npm run buildgenerates static assets deployable on Netlify, Vercel, Azure Static Web Apps, or S3 + CloudFront. - Adjust workflow secrets (
REGISTRY_USERNAME,REGISTRY_PASSWORD,REGISTRY_URL, etc.) before enabling image publishing.
- Update weights and interpretation ranges in
backend/app/services/analyzer.py. - Extend request/response schemas in
backend/app/schemas/analysis.py. - Add new questions by modifying
questionGroupsinfrontend/src/App.tsxand backend schema definitions. - Tailwind theme colors are in
frontend/tailwind.config.js.
- Analyze interaction effects between Media and Social factors
- Understand how factors combine to influence identity exploration
- Get plain-language explanations of statistical results
- Bilingual support (Thai/English)
- Privacy-preserved: only aggregated statistics are shared
- 🔒 Local Mode: 100% private, browser-only calculation
- 🤖 AI Mode: Enhanced insights with anonymous statistics
v2.0 maintains our zero-data-collection policy:
-
Local mode: No data leaves your device
-
AI mode: Only statistical summaries (F-values, p-values) sent
-
No individual responses stored or transmitted
-
No user identification possible
-
No personally identifiable information is collected or persisted.
-
All computations rely on in-memory data supplied per request.
-
Output is suited for educational and research purposes only; it is not a clinical diagnosis.
Request:
{
"dataset": [
{
"media1": 3,
"media2": 2,
// ... other questions
}
],
"options": {
"ai_insights": true,
"language": "th"
}
}
Response:
{
"anova_results": {
"media_effect": {...},
"social_effect": {...},
"interaction_effect": {...}
},
"visualizations": {
"interaction_plot": "base64...",
"group_means": [...]
},
"ai_interpretation": {
"th": "คำอธิบายภาษาไทย...",
"en": "English explanation..."
}
}
- 💬 Discussions: GitHub Discussions - Ask questions, share ideas
- 🐛 Issues: Report bugs or request features
- 📖 Documentation: Full documentation
- Email: [email protected]
- GitHub: @pichitchaipae
For security vulnerabilities, please email [email protected] directly or see our Security Policy.
"การยอมรับความแตกต่างคือจุดเริ่มต้นของสังคมที่เท่าเทียม"