A comprehensive, AI-assisted development environment featuring Django backend, React frontend, PostgreSQL database, and Model Context Protocol (MCP) servers for enhanced AI-assisted development workflows.
- Docker Desktop (with Docker Compose)
- Node.js 18+ and npm
- Python 3.11+
- Git
./scripts/start-dev.shThis script will:
- Build all Docker containers
- Start all services
- Run database migrations
- Display access URLs and useful commands
ECEEE v4 is a modern content management system built with AI-assisted development principles. It combines robust backend technologies with modern frontend frameworks, all containerized for consistent development and deployment.
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β React Frontendβ β Django Backend β β PostgreSQL β
β (Port 3000) βββββΊβ (Port 8000) βββββΊβ (Port 5432) β
β β β β β β
β β’ Vite β β β’ REST API β β β’ Primary DB β
β β’ Tailwind CSS β β β’ HTMX Views β β β’ UUID Support β
β β’ React Query β β β’ Authenticationβ β β’ Full-text β
β β’ React Router β β β’ Admin Panel β β Search β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
β
βββββββββββββββββββ
β Redis β
β (Port 6379) β
β β
β β’ Caching β
β β’ Sessions β
β β’ Celery Queue β
βββββββββββββββββββ
We've achieved 100% frontend test success rate - transforming from 31 failing tests to 128/128 tests passing!
π Complete Documentation Navigation:
- ποΈ COMPLETE DOCUMENTATION INDEX - Master navigation for ALL project documentation
- π Getting Started Guide - Development workflow and project status
- ποΈ System Overview - Architecture and technology deep-dive
- π Frontend Testing Success - Complete transformation story
- π§ͺ Testing Best Practices - Standards for reliable testing
- π Publishing Workflow - Professional CMS features
- π§ Frontend Refactoring Guide - Component patterns
π Quality Metrics:
- β Test Success Rate: 128/128 (100%)
- β Components Covered: All 5 major components (100%)
- β Test Categories: Unit, Integration, Accessibility
- β Best Practices: Established and documented
- New Developers: Quick Start β Documentation Index
- Frontend Developers: Documentation Index
- Backend Developers: Documentation Index
- System Admins: Documentation Index
- Draft/Published Workflow: Create drafts, review changes, and publish when ready
- Version History: Complete audit trail of all page changes with user attribution
- Version Comparison: Visual diff between any two versions showing field and widget changes
- One-Click Restoration: Restore any previous version instantly
- Advanced Filtering: Find versions by status, date ranges, users, and content
- Auto-Version Creation: Automatic version snapshots on every page update
- Code-Based Layouts: Python class-based layouts with automatic discovery
- Slot Architecture: Slot-based page layouts with custom template selection
- Dynamic Themes: CSS variable-based themes with real-time preview
- Template Architecture: Modern base template with Tailwind CSS, HTMX, and Alpine.js
- Inheritance Engine: Automatic propagation of layouts and themes down page hierarchy
- Version Control: Layouts tracked in Git with the codebase
- Custom Templates: Layout-specific template files for enhanced flexibility
- Multi-Device Preview: Preview pages across desktop, tablet, and mobile
- Type-Safe Components: Pydantic model-based widget definitions with compile-time validation
- Auto-Discovery: Automatic widget registration from Django apps
- Zero Database Queries: Widget types loaded once at startup for optimal performance
- Generated Configuration UI: Auto-generated forms from Pydantic schemas
- Widget Inheritance: Inherit and override widgets from parent pages with granular control
- Version Control: Widget types tracked in Git alongside your code
- Developer Experience: Full IDE support, auto-completion, and type checking
- Hot Reload: Instant feedback during development
- Component Library: Comprehensive UI component system
- Type Safety: Full TypeScript support across frontend
- API Documentation: Interactive API docs with OpenAPI/Swagger
- Database Migrations: Zero-downtime schema evolution
- Django 4.2+ - Python web framework
- Django REST Framework - API development
- PostgreSQL 15 - Primary database
- Redis - Caching and session storage
- Celery - Background task processing
- HTMX - Server-side dynamic interactions
- React 19 - UI library
- Vite - Build tool and dev server
- Tailwind CSS - Utility-first styling
- React Router - Client-side routing
- React Query - Data fetching and caching
- Zustand - State management
- React Hook Form - Form handling
- Docker & Docker Compose - Containerization
- nginx - Web server (production)
- GitHub Actions - CI/CD (configured)
- PostgreSQL - Production database
- Model Context Protocol (MCP) - AI tool integration
- MCP Servers - Filesystem, Git, GitHub, Database operations
- Claude Desktop - AI assistant integration
- Cursor IDE - AI-powered development environment
The PageManagement component has been comprehensively refactored following clean code principles:
- 37% size reduction - From 730 to 459 lines in main component
- Component extraction - Created focused, single-responsibility components
- Custom hooks - Extracted business logic into reusable hooks
- Improved maintainability - Easier testing, debugging, and future enhancements
New Architecture:
PageFilters- Advanced search and filtering UIPageList- Paginated listing with action buttonsPageForm- Create/edit forms with validationPageDetails- Clean information displayusePageFilters- Filtering logic with memoizationusePageMutations- CRUD operations with error handling
See Frontend Refactoring Guide for detailed information.
| Service | URL | Purpose |
|---|---|---|
| Frontend | http://localhost:3000 | React application |
| Backend API | http://localhost:8000 | Django REST API |
| Admin Panel | http://localhost:8000/admin/ | Django admin interface |
| API Docs | http://localhost:8000/api/docs/ | Interactive API documentation |
| HTMX Examples | http://localhost:8000/htmx/ | Server-side interaction demos |
| Debug Toolbar | http://localhost:8000/__debug__/ | Django debug information |
| Silk Profiling | http://localhost:8000/silk/ | Performance profiling |
| Metrics | http://localhost:8000/metrics/ | Prometheus metrics |
- Host: localhost
- Port: 5432
- Database: eceee_v4
- Username: postgres
- Password: postgres
- Host: localhost
- Port: 6379
- Database: 0
eceee_v4/
βββ backend/ # Django application
β βββ config/ # Django project settings
β βββ templates/ # HTML templates
β βββ static/ # Static files
β βββ requirements.txt # Python dependencies
β βββ Dockerfile # Backend container config
βββ frontend/ # React application
β βββ src/ # Source code
β β βββ components/ # Reusable components
β β β βββ page-management/ # Refactored page components
β β βββ pages/ # Page components
β β βββ hooks/ # Custom React hooks (usePageFilters, etc.)
β β βββ stores/ # State management
β β βββ api/ # API integration
β β βββ utils/ # Utility functions
β βββ package.json # Node.js dependencies
β βββ Dockerfile # Frontend container config
βββ docker/ # Docker configurations
β βββ init-db.sql # Database initialization
β βββ mcp-servers/ # MCP server configurations
βββ scripts/ # Development scripts
β βββ start-dev.sh # Environment startup script
βββ docs/ # Project documentation
β βββ SYSTEM_OVERVIEW.md # System architecture
β βββ FRONTEND_REFACTORING_GUIDE.md # Clean code refactoring
βββ tests/ # Integration tests
βββ docker-compose.dev.yml # Multi-container orchestration
βββ .env.template # Environment variables template
βββ README.md # This file
# Start all services
docker-compose -f docker-compose.dev.yml up -d
# View logs
docker-compose -f docker-compose.dev.yml logs -f
# Stop all services
docker-compose -f docker-compose.dev.yml down
# Rebuild containers
docker-compose -f docker-compose.dev.yml up --build
# Remove volumes (reset database)
docker-compose -f docker-compose.dev.yml down -v# Django shell
docker-compose -f docker-compose.dev.yml exec backend python manage.py shell
# Create superuser
docker-compose -f docker-compose.dev.yml exec backend python manage.py createsuperuser
# Run migrations
docker-compose -f docker-compose.dev.yml exec backend python manage.py migrate
# Collect static files
docker-compose -f docker-compose.dev.yml exec backend python manage.py collectstatic
# Run tests
docker-compose -f docker-compose.dev.yml exec backend python manage.py test
# Django shell with enhanced features
docker-compose -f docker-compose.dev.yml exec backend python manage.py shell_plus# Install new package
docker-compose -f docker-compose.dev.yml exec frontend npm install <package-name>
# Run linting
docker-compose -f docker-compose.dev.yml exec frontend npm run lint
# Build for production
docker-compose -f docker-compose.dev.yml exec frontend npm run build# Access PostgreSQL shell
docker-compose -f docker-compose.dev.yml exec db psql -U postgres -d eceee_v4
# Backup database
docker-compose -f docker-compose.dev.yml exec db pg_dump -U postgres eceee_v4 > backup.sql
# Restore database
docker-compose -f docker-compose.dev.yml exec -T db psql -U postgres eceee_v4 < backup.sql# Run all tests
docker-compose -f docker-compose.dev.yml exec backend python manage.py test
# Run specific test file
docker-compose -f docker-compose.dev.yml exec backend python manage.py test apps.core.tests
# Run with coverage
docker-compose -f docker-compose.dev.yml exec backend coverage run --source='.' manage.py test
docker-compose -f docker-compose.dev.yml exec backend coverage report# Run Jest tests
docker-compose -f docker-compose.dev.yml exec frontend npm test
# Run tests with coverage
docker-compose -f docker-compose.dev.yml exec frontend npm run test:coverage
# Run E2E tests
docker-compose -f docker-compose.dev.yml exec frontend npm run test:e2eThis project is designed for AI-assisted development using:
- Filesystem Server: File operations and code exploration
- Git Server: Version control operations
- GitHub Server: Repository management and issue tracking
- PostgreSQL Server: Database queries and schema analysis
- Code Generation: Use AI assistants to generate boilerplate code
- Testing: AI-assisted test case generation and coverage analysis
- Documentation: Automated documentation generation and updates
- Debugging: AI-powered error analysis and solution suggestions
- Optimization: Performance analysis and improvement recommendations
This project is optimized for use with Cursor IDE:
- Open the project root in Cursor
- The AI will automatically understand the project structure
- Use Ctrl+K for AI-assisted code generation
- Use Ctrl+L for AI chat about the codebase
- CSRF protection enabled
- CORS configured for frontend integration
- Environment variable management
- SQL injection prevention
- XSS protection
- Secure headers configuration
- Use strong secret keys
- Enable HTTPS
- Configure proper firewall rules
- Regular security updates
- Database connection encryption
- Rate limiting implementation
- Django Debug Toolbar: Development debugging
- Silk Profiling: Performance analysis
- Prometheus Metrics: Application metrics
- PostgreSQL Performance: Query analysis
- Redis Monitoring: Cache performance
- Database query optimization
- Redis caching strategy
- Frontend code splitting
- Static file optimization
- Image optimization
- CDN integration (production)
The project includes production-ready configurations:
# Build production images
docker-compose -f docker-compose.prod.yml build
# Deploy to production
docker-compose -f docker-compose.prod.yml up -d
# Note: Use docker-compose.dev.yml for developmentCopy .env.template to .env and update:
# Database
POSTGRES_PASSWORD=secure_production_password
# Django
SECRET_KEY=your_secure_secret_key
DEBUG=False
ALLOWED_HOSTS=your-domain.com
# Security
SECURE_SSL_REDIRECT=True
SESSION_COOKIE_SECURE=True
CSRF_COOKIE_SECURE=True- Swagger UI: http://localhost:8000/api/docs/
- ReDoc: http://localhost:8000/api/redoc/
- OpenAPI Schema: http://localhost:8000/api/schema/
For comprehensive documentation including architecture, development guides, API references, and component libraries, see the Complete Documentation Index which organizes all project documentation by category and user role.
- Version Management API - Complete API documentation for version management endpoints
- Version Management UI Guide - Step-by-step user guide for the version management interface
- Widget System Documentation - Complete widget architecture and development guide
- System Architecture - Detailed breakdown of codebase organization and data flow
- Django Documentation
- React Documentation
- Tailwind CSS Documentation
- Model Context Protocol
- Docker Documentation
The project has been fully migrated to a code-based widget system with comprehensive test coverage:
# Run all backend tests
docker-compose -f docker-compose.dev.yml exec backend python manage.py test
# Test widget system specifically
docker-compose -f docker-compose.dev.yml exec backend python manage.py test webpages.tests.WidgetRegistryTest
docker-compose -f docker-compose.dev.yml exec backend python manage.py test webpages.tests.WidgetTypeAPITest# Run all frontend tests
docker-compose -f docker-compose.dev.yml exec frontend npm run test:run
# Test widget components specifically
docker-compose -f docker-compose.dev.yml exec frontend npm run test:run src/components/__tests__/WidgetLibrary.test.jsx
docker-compose -f docker-compose.dev.yml exec frontend npm run test:run src/components/__tests__/WidgetConfigurator.test.jsx- Backend: Widget types now reference by name instead of database ID
- Frontend: API responses are direct arrays instead of paginated results
- Validation: Pydantic models provide compile-time type safety
- Performance: Zero database queries for widget type definitions
For detailed testing documentation, see docs/CODE_BASED_WIDGET_SYSTEM_TESTING.md.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow PEP 8 for Python code
- Use ESLint/Prettier for JavaScript/React code
- Write tests for new features
- Update documentation for significant changes
- Use semantic commit messages
This project is licensed under the Server Side Public License (SSPL) v1.0.
- β Free to use, modify, and distribute for any purpose
- β Strong copyleft protection - derivatives must use the same license
β οΈ Service providers must share infrastructure code - If you offer this software as a service (SaaS), you must release all service infrastructure code under SSPL
The SSPL license protects open source projects from being exploited by cloud providers who offer the software as a service without contributing back to the community. It ensures that if someone builds a business around this software as a service, they must share their improvements and infrastructure.
- Open Source Projects: Use freely under SSPL terms
- Self-Hosting: No restrictions - host for yourself or your organization
- Commercial License: Contact for alternative licensing if SSPL Section 13 is incompatible with your use case
For full license text and terms, see the LICENSE file.
Copyright (C) 2025 Johan Mats Fred Karlsson
- Django Software Foundation
- React Team
- Tailwind CSS Team
- Anthropic (Claude AI)
- Model Context Protocol contributors
- Open source community
Built with β€οΈ using AI-assisted development workflows
For questions, issues, or contributions, please visit our GitHub repository.