- README.md - Main project documentation
- API_REFERENCE.md - Complete API documentation
- DEPLOYMENT_GUIDE.md - Deployment and scaling guide
- TROUBLESHOOTING.md - Troubleshooting common issues
- Interactive API Docs: http://localhost:5000/docs (Swagger UI)
- ReDoc Documentation: http://localhost:5000/redoc
- OpenAPI Specification: http://localhost:5000/api/v1/openapi.json
- Environment Variables: See
.env.examplefor all configuration options - Database Schema: See
database/schema.sqlfor complete database structure - Docker Configuration: See
docker-compose.ymlfor service orchestration - Testing: Run
python run_tests.py --helpfor testing options
discord-bot-platform/
βββ frontend/ # React web application
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β βββ contexts/ # React contexts
β β βββ services/ # API services
β β βββ utils/ # Utility functions
β βββ public/
β βββ package.json
βββ backend/
β βββ api/ # Flask API server
β β βββ app/ # Application code
β β βββ requirements.txt
β β βββ Dockerfile
β βββ bot/ # Discord bot worker
β βββ bot/ # Bot code
β βββ requirements.txt
β βββ Dockerfile
βββ database/ # Database schema and migrations
βββ docker/ # Docker configuration
βββ docs/ # Documentation
βββ tests/ # Test suite
βββ shared/ # Shared utilities
# Install frontend dependencies
cd frontend && npm install
# Start development servers
docker-compose -f docker-compose.dev.yml up
# Run tests
python run_tests.py --unit
# Format code
black backend/ tests/
npx prettier --write frontend/src/
# Lint code
flake8 backend/
npx eslint frontend/src/- Black: Python code formatting
- Flake8: Python linting
- ESLint: JavaScript/TypeScript linting
- Prettier: Code formatting
- MyPy: Type checking
- Bandit: Security linting
# Production deployment
docker-compose up -d
# With custom configuration
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
# Scale services
docker-compose up -d --scale api=3
# Update deployment
docker-compose pull && docker-compose up -d- AWS: ECS, EKS, or Elastic Beanstalk
- Google Cloud: Cloud Run, GKE, or App Engine
- Azure: Container Instances, AKS, or App Service
- DigitalOcean: App Platform or Droplets with Docker
# Run complete test suite
python run_tests.py --all
# Run specific test types
python run_tests.py --unit
python run_tests.py --integration
python run_tests.py --security
# Generate coverage report
python run_tests.py --coveragetests/
βββ conftest.py # Test configuration and fixtures
βββ test_security.py # Security and input validation tests
βββ test_api_integration.py # API endpoint integration tests
βββ test_models.py # Database model tests
βββ test_auth.py # Authentication tests
βββ test_bot.py # Discord bot tests
- Unit Tests: Individual function/component testing
- Integration Tests: API endpoint and service interaction testing
- Security Tests: Input validation and security feature testing
- End-to-End Tests: Complete user workflow testing
- Discord OAuth2: Secure authentication with PKCE
- JWT Tokens: Stateless authentication with refresh tokens
- Role-Based Access Control: Server role-based permissions
- Session Management: Secure session handling
- SQL Injection Prevention: Parameterized queries and input validation
- XSS Protection: HTML sanitization and content security policy
- Input Length Limits: Maximum length validation for all inputs
- Type Validation: Strict type checking for API inputs
- Content Security Policy: XSS protection and resource restrictions
- HSTS: HTTP Strict Transport Security
- X-Frame-Options: Clickjacking protection
- X-Content-Type-Options: MIME type sniffing protection
- API Rate Limits: Configurable per-endpoint limits
- Authentication Limits: Stricter limits for auth endpoints
- Redis Backend: Distributed rate limiting support
- 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 existing code style and patterns
- Write tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting PR
- Use conventional commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
- Database Connection: Check PostgreSQL container is running
- Bot Connection: Verify Discord token and permissions
- API Errors: Check logs with
docker-compose logs api - Frontend Issues: Clear browser cache and rebuild
- Documentation: Check docs/ directory
- Issues: Create GitHub issue with detailed description
- Discussions: Use GitHub Discussions for questions
- Logs: Include relevant logs when reporting issues
For detailed troubleshooting guides, see:
- TROUBLESHOOTING.md - Common issues and solutions
- DEPLOYMENT_GUIDE.md - Deployment troubleshooting
- Logs:
docker-compose logs -ffor real-time monitoring
Happy coding! π
For more information, visit the documentation or create an issue for support.# deckhand