Major WHOOSH system refactoring and feature enhancements

- Migrated from HIVE branding to WHOOSH across all components
- Enhanced backend API with new services: AI models, BZZZ integration, templates, members
- Added comprehensive testing suite with security, performance, and integration tests
- Improved frontend with new components for project setup, AI models, and team management
- Updated MCP server implementation with WHOOSH-specific tools and resources
- Enhanced deployment configurations with production-ready Docker setups
- Added comprehensive documentation and setup guides
- Implemented age encryption service and UCXL integration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
anthonyrawlins
2025-08-27 08:34:48 +10:00
parent 0e9844ef13
commit 268214d971
399 changed files with 57390 additions and 2045 deletions

View File

@@ -0,0 +1 @@
# Environment variables example

View File

@@ -0,0 +1 @@
# GitHub Actions CI

View File

@@ -0,0 +1 @@
# GitHub Actions deployment

View File

@@ -0,0 +1,42 @@
# Dependencies
node_modules/
__pycache__/
*.pyc
venv/
.venv/
# Environment files
.env
.env.local
.env.production
# Build outputs
build/
dist/
*.egg-info/
# Database
*.db
*.sqlite
# IDE
.vscode/
.idea/
*.swp
*.swo
# OS
.DS_Store
Thumbs.db
# Docker
.dockerignore
# Logs
*.log
logs/
# Test coverage
coverage/
.coverage
.pytest_cache/

View File

@@ -0,0 +1,137 @@
# Full-Stack Web Application
A modern full-stack web application built with React, FastAPI, and PostgreSQL.
## Features
- 🎯 **React 18** with TypeScript for the frontend
- 🚀 **FastAPI** for high-performance backend API
- 🗄️ **PostgreSQL** database with SQLAlchemy ORM
- 🐳 **Docker** containerization for development and production
- 🔐 **JWT Authentication** and authorization
- 📚 **Automatic API documentation** with OpenAPI/Swagger
-**Comprehensive testing** setup
- 🎨 **Tailwind CSS** for beautiful, responsive UI
- 📱 **Mobile-first** responsive design
## Quick Start
### Prerequisites
- Docker and Docker Compose
- Node.js 18+ (for local development)
- Python 3.9+ (for local development)
### Development Setup
1. **Clone and setup environment:**
```bash
cp .env.example .env
# Edit .env with your configuration
```
2. **Start development environment:**
```bash
docker-compose up -d
```
3. **Access the application:**
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- Database: localhost:5432
### Local Development
**Frontend:**
```bash
cd frontend
npm install
npm start
```
**Backend:**
```bash
cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload
```
## Project Structure
```
├── frontend/ # React TypeScript frontend
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── services/
│ │ └── hooks/
│ └── package.json
├── backend/ # FastAPI backend
│ ├── app/
│ │ ├── api/
│ │ ├── core/
│ │ ├── models/
│ │ └── schemas/
│ └── requirements.txt
├── database/ # Database initialization
├── docs/ # Documentation
└── docker-compose.yml
```
## API Documentation
The API is automatically documented using OpenAPI/Swagger. Access the interactive documentation at:
- **Swagger UI:** http://localhost:8000/docs
- **ReDoc:** http://localhost:8000/redoc
## Testing
**Frontend tests:**
```bash
cd frontend
npm test
```
**Backend tests:**
```bash
cd backend
pytest
```
## Deployment
### Production Deployment
1. **Build production images:**
```bash
docker-compose -f docker-compose.prod.yml build
```
2. **Deploy to production:**
```bash
docker-compose -f docker-compose.prod.yml up -d
```
### Environment Variables
Key environment variables (see `.env.example`):
- `DATABASE_URL`: PostgreSQL connection string
- `SECRET_KEY`: JWT secret key
- `CORS_ORIGINS`: Allowed CORS origins
- `ENVIRONMENT`: Development/production environment
## Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests for new functionality
5. Submit a pull request
## License
This project is licensed under the MIT License - see the LICENSE file for details.

View File

@@ -0,0 +1 @@
# FastAPI Dockerfile

View File

@@ -0,0 +1 @@
# Alembic configuration

View File

@@ -0,0 +1 @@
# Alembic environment

View File

@@ -0,0 +1 @@
# FastAPI authentication

View File

@@ -0,0 +1 @@
# FastAPI users API

View File

@@ -0,0 +1 @@
# FastAPI configuration

View File

@@ -0,0 +1 @@
# FastAPI database configuration

View File

@@ -0,0 +1,48 @@
from fastapi import FastAPI, Depends, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from sqlalchemy.orm import Session
import os
from app.core.config import settings
from app.core.database import engine, get_db
from app.api import auth, users
from app.models import user
# Create database tables
user.Base.metadata.create_all(bind=engine)
app = FastAPI(
title="WHOOSH API",
description="Full-stack application backend API",
version="1.0.0",
docs_url="/docs",
redoc_url="/redoc"
)
# Add CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=settings.CORS_ORIGINS,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# Include routers
app.include_router(auth.router, prefix="/auth", tags=["authentication"])
app.include_router(users.router, prefix="/users", tags=["users"])
@app.get("/")
async def root():
return {
"message": "Welcome to WHOOSH API",
"version": "1.0.0",
"docs": "/docs"
}
@app.get("/health")
async def health_check(db: Session = Depends(get_db)):
return {
"status": "healthy",
"database": "connected"
}

View File

@@ -0,0 +1 @@
# FastAPI user model

View File

@@ -0,0 +1 @@
# FastAPI user schema

View File

@@ -0,0 +1 @@
# FastAPI pyproject.toml

View File

@@ -0,0 +1 @@
# FastAPI requirements

View File

@@ -0,0 +1 @@
# FastAPI test file

View File

@@ -0,0 +1 @@
-- PostgreSQL initialization

View File

@@ -0,0 +1 @@
# Production docker-compose configuration

View File

@@ -0,0 +1,65 @@
version: '3.8'
services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
- REACT_APP_API_URL=http://localhost:8000
volumes:
- ./frontend:/app
- /app/node_modules
depends_on:
- backend
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "8000:8000"
environment:
- DATABASE_URL=postgresql://whoosh:password@postgres:5432/whoosh_db
- SECRET_KEY=your-secret-key-change-in-production
- CORS_ORIGINS=http://localhost:3000
volumes:
- ./backend:/app
depends_on:
- postgres
- redis
postgres:
image: postgres:15
environment:
- POSTGRES_USER=whoosh
- POSTGRES_PASSWORD=password
- POSTGRES_DB=whoosh_db
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
depends_on:
- frontend
- backend
volumes:
postgres_data:
redis_data:

View File

@@ -0,0 +1 @@
# API documentation

View File

@@ -0,0 +1 @@
# Deployment documentation

View File

@@ -0,0 +1 @@
# Setup documentation

View File

@@ -0,0 +1 @@
# React Dockerfile

View File

@@ -0,0 +1,51 @@
{
"name": "whoosh-frontend",
"version": "1.0.0",
"private": true,
"dependencies": {
"@types/node": "^20.0.0",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.8.0",
"react-query": "^3.39.0",
"axios": "^1.3.0",
"typescript": "^5.0.0",
"@headlessui/react": "^1.7.0",
"@heroicons/react": "^2.0.0",
"tailwindcss": "^3.2.0",
"autoprefixer": "^10.4.0",
"postcss": "^8.4.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.0",
"react-scripts": "5.0.1"
}
}

View File

@@ -0,0 +1 @@
// React App component

View File

@@ -0,0 +1 @@
// React test file

View File

@@ -0,0 +1 @@
// React layout component

View File

@@ -0,0 +1 @@
// React authentication hook

View File

@@ -0,0 +1 @@
// React index file

View File

@@ -0,0 +1 @@
// React home page

View File

@@ -0,0 +1 @@
// API service for React

View File

@@ -0,0 +1 @@
// Tailwind CSS configuration

View File

@@ -0,0 +1 @@
// TypeScript configuration

View File

@@ -0,0 +1,64 @@
{
"template_id": "fullstack-web-app",
"name": "Full-Stack Web Application",
"description": "Complete web application with React frontend, Node.js/FastAPI backend, PostgreSQL database, and Docker deployment",
"icon": "\ud83c\udf10",
"category": "web-development",
"tags": [
"react",
"nodejs",
"fastapi",
"postgresql",
"docker",
"typescript"
],
"difficulty": "intermediate",
"estimated_setup_time": "15-30 minutes",
"features": [
"React 18 with TypeScript",
"Node.js/Express or Python/FastAPI backend options",
"PostgreSQL database with migrations",
"Docker containerization",
"CI/CD with GitHub Actions",
"Authentication & authorization",
"API documentation with OpenAPI/Swagger",
"Testing setup (Jest, Pytest)",
"ESLint & Prettier configuration",
"Environment management"
],
"tech_stack": {
"frontend": [
"React",
"TypeScript",
"Tailwind CSS",
"React Query"
],
"backend": [
"Node.js/Express",
"Python/FastAPI"
],
"database": [
"PostgreSQL",
"Redis"
],
"deployment": [
"Docker",
"Docker Compose"
],
"testing": [
"Jest",
"Pytest",
"Cypress"
],
"ci_cd": [
"GitHub Actions",
"Docker Hub"
]
},
"requirements": {
"nodejs": ">=18.0.0",
"python": ">=3.9.0",
"docker": ">=20.0.0",
"postgresql": ">=13.0"
}
}

View File

@@ -0,0 +1 @@
# React FastAPI README

View File

@@ -0,0 +1 @@
# Simple docker-compose

View File

@@ -0,0 +1,24 @@
{
"template_id": "react-fastapi",
"name": "React + FastAPI",
"description": "Modern web application with React frontend and FastAPI backend",
"icon": "\u269b\ufe0f",
"category": "web-development",
"tags": [
"react",
"fastapi",
"typescript",
"python"
],
"difficulty": "beginner",
"estimated_setup_time": "10-15 minutes",
"features": [
"React 18 with TypeScript",
"FastAPI with automatic OpenAPI docs",
"JWT authentication",
"Real-time updates with WebSockets",
"Database integration with SQLAlchemy",
"Testing with Jest and Pytest",
"Docker development environment"
]
}