Project
UniCore Community Platform
A modern developer community platform designed to support the UniCore Framework ecosystem.
Overview
A modern developer community platform designed to support the UniCore Framework ecosystem. Built with security, scalability, stability, sustainability, and performance at its core, this platform provides knowledge sharing, documentation, and development tools for software developers working with Rust, Python, Perl, Java, and other languages supported by UniCore.
๐ฏ Project Vision
Primary Goals
- Community Hub : Central gathering place for UniCore Framework adoption and support
- Knowledge Sharing : Multi-language developer platform for best practices and solutions
- Framework Showcase : Demonstrate UniCore's consistent API philosophy and performance benefits
- Feedback Loop : Testing ground for framework features with real-world developer feedback
Target Audience
- Primary : Experienced developers and beta testers working with UniCore Framework
- Secondary : General developers discovering the platform organically
- Growth : Framework adopters and contributors as UniCore matures
๐๏ธ Architecture
Technology Stack
| Component | Technology | Purpose |
|---|---|---|
| Backend | FastAPI (Python) | Rapid development, async support, auto-documentation |
| Database | PostgreSQL | ACID compliance, security, JSON support |
| Real-time | WebSockets | Live forum discussions and notifications |
| Code Execution | Judge0 API | Sandboxed multi-language code testing |
| Authentication | Custom + OAuth | Secure user management with provider integration |
| Frontend | React + TypeScript | Modern responsive web application |
Core Principles
- Security : Encrypted data storage, input validation, secure code execution
- Scalability : Horizontal scaling ready, microservices architecture
- Stability : ACID transactions, comprehensive testing, error handling
- Sustainability : Cost-optimized infrastructure, efficient resource usage
- Performance : < 200ms API response time, async processing, optimized queries
๐ Features
Core Platform Features
๐ User Management System
- Custom authentication with username/email + password
- OAuth integration (GitHub, GitLab, Google)
- Role-based access control (Admin, Moderator, User)
- Comprehensive user profiles with technology preferences
- Encrypted vault for sensitive user settings
๐ฌ Forum System
- Technology-specific forums (Rust, Python, Perl, Java, etc.)
- Unified category structure for cross-cutting topics
- Threaded discussions with real-time updates
- Advanced full-text search across all content
- WebSocket-powered live discussions
๐ Blog Platform
- Technology-filtered articles with tagging system
- Draft/published workflow with content moderation
- Category-based organization for content discovery
- Community engagement through comment system
- Rich text editor with Markdown and syntax highlighting
๐ Interactive Features
- Community polls with multiple choice options
- Syntax-highlighted code sharing (GitHub Gists style)
- Collaborative documentation wiki
- Performance benchmarking tools for code comparison
๐ง UniCore Integration
- Integrated framework API documentation
- UniCore-specific code runners and validators
- Version compatibility tracking and guides
๐ Prerequisites
- Python 3.11 or higher
- PostgreSQL 13 or higher
- Node.js 18+ (for frontend development)
- Git
โก Quick Start
1. Clone the Repository
git clone https://github.com/unicorefw-org/unicorefew-cms.git
cd unicorefw-cms
2. Set Up Python Environment
# Create virtual environment
python -m venv venv
# Activate virtual environment
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
3. Database Setup
# Start PostgreSQL service
sudo systemctl start postgresql # Linux
# or
brew services start postgresql # Mac
# Create database
createdb unicore_cms
# Set up environment variables
cp .env.example .env
# Edit .env with your database credentials
4. Database Migration
# Initialize Alembic
alembic init alembic
# Run migrations
alembic upgrade head
5. Start Development Server
# Run FastAPI development server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
The API will be available at http://localhost:8000 with automatic documentation at http://localhost:8000/docs.
๐ง Configuration
Environment Variables
Create a .env file in the project root:
# Database Configuration
DATABASE_URL=postgresql+asyncpg://username:password@localhost/unicore_cms
DATABASE_POOL_SIZE=20
DATABASE_MAX_OVERFLOW=30
# Security Settings (CHANGE IN PRODUCTION!)
SECRET_KEY=your-super-secret-key-change-this-in-production
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
ENCRYPTION_KEY=your-encryption-key-for-vault-data
# Application Settings
APP_NAME=UniCore Community Platform
APP_VERSION=1.0.0
DEBUG=False
CORS_ORIGINS=["http://localhost:3000", "https://yourdomain.com"]
# External Services
JUDGE0_API_URL=https://judge0-ce.p.rapidapi.com
JUDGE0_API_KEY=your-judge0-api-key
# Email Configuration
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=your-email@gmail.com
SMTP_PASSWORD=your-app-password
๐๏ธ Database Schema
The platform uses a robust PostgreSQL schema with the following core tables:
- users : User accounts and authentication
- roles/users_roles : Role-based access control system
- profiles : Extended user information and preferences
- forums/forum_threads/forum_posts : Complete forum discussion structure
- blog_posts/blog_categories/blog_comments : Blog platform with moderation
- polls/poll_votes : Community polling and voting system
- sessions : Secure user session management
- vault : Encrypted storage for sensitive user data

๐ API Endpoints
Authentication
POST /api/v1/auth/register- User registrationPOST /api/v1/auth/login- User loginGET /api/v1/auth/me- Current user infoPOST /api/v1/auth/refresh- Token refreshPOST /api/v1/auth/logout- User logout
Users
GET /api/v1/users/profile- User profilePUT /api/v1/users/profile- Update profile
Forums
GET /api/v1/forums- List all forumsGET /api/v1/forums/{forum_id}/threads- Forum threadsPOST /api/v1/forums/threads/{thread_id}/posts- Create post
Blogs
GET /api/v1/blogs/posts- List blog postsPOST /api/v1/blogs/posts- Create blog postGET /api/v1/blogs/posts/{post_id}- Get specific post
Polls
GET /api/v1/polls- List pollsPOST /api/v1/polls/{poll_id}/vote- Submit voteGET /api/v1/polls/{poll_id}/results- Poll results
๐งช Testing
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=app --cov-report=html
# Run specific test categories
pytest tests/test_auth.py -v
pytest tests/test_forums.py -v
Test Configuration
The test suite includes comprehensive coverage for:
- Authentication and authorization workflows
- Forum and blog functionality
- User management and profiles
- Polling system operations
- API endpoint validation
๐ Deployment
Phase 1: Development Deployment
# Using Docker Compose (recommended)
docker-compose up -d
# Or manual deployment
uvicorn app.main:app --host 0.0.0.0 --port 8000
Phase 2: Production Deployment
- Load-balanced architecture with nginx
- PostgreSQL with connection pooling
- Redis caching layer
- SSL/TLS encryption
- Monitoring and logging
Phase 3: Enterprise Scale
- Container orchestration (Kubernetes/Docker Swarm)
- Microservices architecture
- Horizontal scaling with auto-scaling groups
- Advanced monitoring and alerting
๐ Performance Targets
Technical Metrics
- API Response Time : < 200ms for all endpoints
- Database Query Time : < 50ms for standard operations
- WebSocket Latency : < 100ms for real-time updates
- Code Execution : < 5 seconds for test snippets
- Uptime Target : 99.9% availability
Scalability Goals
- Phase 1 : 100-500 concurrent users
- Phase 2 : 1,000-5,000 concurrent users
- Phase 3 : 10,000+ concurrent users
๐ Security Features
Authentication & Authorization
- Argon2 password hashing with salt
- JWT token-based authentication
- Role-based permission system
- OAuth 2.0 integration with PKCE
- Secure session management
Data Protection
- Encrypted sensitive data storage (vault table)
- SQL injection prevention through parameterized queries
- XSS protection with input sanitization
- CORS configuration for cross-origin security
- Rate limiting on API endpoints
Code Execution Security
- Sandboxed execution environment via Judge0
- Resource limits (CPU/memory constraints)
- Network isolation for executed code
- Input validation and sanitization
๐ ๏ธ Development
Project Structure
unicorefw-cms/
โโโ app/
โ โโโ api/v1/endpoints/ # API route handlers
โ โโโ models/ # SQLAlchemy database models
โ โโโ schemas/ # Pydantic request/response schemas
โ โโโ services/ # Business logic layer
โ โโโ utils/ # Common utilities and helpers
โโโ tests/ # Comprehensive test suite
โโโ alembic/ # Database migration scripts
โโโ docs/ # Project documentation
Key Dependencies
- FastAPI 0.104.1 : Modern Python web framework
- SQLAlchemy 2.0 : Async ORM for database operations
- Pydantic : Data validation and serialization
- UniCoreFW 1.1.4 : Utility functions
- AsyncPG : High-performance PostgreSQL adapter
- Passlib : Secure password hashing
- WebSockets : Real-time communication
Code Quality
# Format code
black app/ tests/
# Sort imports
isort app/ tests/
# Lint code
flake8 app/ tests/
# Type checking
mypy app/
๐ค Contributing
We welcome contributions from the developer community! Please see our Contributing Guidelines for details on:
- Code style and standards
- Pull request process
- Issue reporting
- Security vulnerability disclosure
- Community guidelines
Development Setup for Contributors
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes following our coding standards
- Add tests for new functionality
- Run the test suite and ensure all tests pass
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License.
๐ Support
Getting Help
- Documentation : Community Wiki
- Issues : GitHub Issues
- Discussions : GitHub Discussions
- Email : support@unicorefw.org
Bug Reports
When reporting bugs, please include:
- Operating system and version
- Python version
- Steps to reproduce the issue
- Expected vs actual behavior
- Relevant log output
๐ Acknowledgments
- UniCore Framework : The foundation that inspired this community platform
- FastAPI : For providing an excellent modern Python web framework
- PostgreSQL : For robust, secure database capabilities
- Judge0 : For secure code execution infrastructure
- Open Source Community : For the tools and libraries that make this project possible
Built with โค๏ธ for the UniCore Framework Community
For more information about UniCore Framework, visit unicorefw.org