Center for Entrepreneurship & Business Incubators - Misurata
Affiliated with Misurata College of Industrial Technology
Production-Ready | Bilingual (AR/EN) | Cost-Optimized | Secure
- 100% deployment-ready for Virtuozzo Application Platform
- Comprehensive deployment documentation
- Production secrets generated and secured
- 40% infrastructure cost reduction achieved
- 97% storage cost savings - S3 migration complete (AWS/Cloudflare R2)
- 15-20% hosting cost reduction - Redis removed, optimized architecture
- Enterprise-grade security - RBAC with automated integrity verification
- Professional UX - Multi-page forms with validation and persistence
- Bilingual platform - Full Arabic (RTL) / English (LTR) support
- Features
- Tech Stack
- Getting Started
- Production Deployment
- Project Structure
- Development
- Testing
- Documentation
- License
Professional 4-step workflows with smart validation and auto-save:
Innovators & Creators:
- Personal Information (name, contact, location)
- Project Overview (title, description, category)
- Project Details (goals, stage, funding)
- Review & Submit
Collaborators & Supporters:
- Company Information (name, contact, website)
- Industry & Expertise (sector, capabilities)
- Resources & Support (services, funding)
- Review & Submit
Features:
- β Form state persistence (localStorage)
- β Step-by-step validation (React Hook Form + Zod)
- β Progress indicators
- β File uploads (images, documents) β S3
- β Bilingual forms (Arabic/English)
- β Mobile-responsive design
- News & Activities - Latest updates and events
- Strategic Plans - College and center goals/milestones
- FAQ Section - Quick answers and knowledge base
- About Pages - Entrepreneurship center, Business incubators
- Full bilingual support (Arabic default, English)
- RTL (Right-to-Left) layout for Arabic
- LTR (Left-to-Right) layout for English
- Automatic locale detection
- URL-based routing (
/ar/*,/en/*)
- Analytics overview (pending approvals, user stats)
- Quick actions and shortcuts
- Notification center
- News Management - Create, edit, publish articles
- FAQ Management - Organize Q&A content
- Strategic Plans - Publish goals and strategies
- Innovators - Review and approve/reject projects
- Collaborators - Review and approve/reject sponsors
- Status updates with email notifications
- Role-Based Access Control (RBAC)
- User invitations
- Permission management
- 4 System Roles:
- Super Admin (full access)
- Admin (content + submissions)
- Editor (content only)
- Viewer (read-only)
- Customizable email templates
- Bilingual support
- Preview before send
- NextAuth.js v5 with database sessions
- Credentials authentication
- OAuth providers (Google, GitHub)
- Two-factor authentication (2FA)
- Password reset flow
- Resource-action permission model
- Role inheritance
- Middleware-based route protection
- RBAC Integrity Verification β
- Automated verification script
- 6 security checks
- Command:
bun run rbac:verify
- 97% cost reduction vs database BLOBs
- AWS S3 support (Free Tier Year 1)
- Cloudflare R2 support (Free 10GB forever)
- MinIO support (local development)
- Automatic image optimization
- CDN-ready URLs
- Transactional emails (submission confirmations, status updates)
- React Email templates
- SMTP configuration (Gmail, SendGrid)
- Email logging and tracking
- MySQL 8.0 (production)
- Prisma ORM with type safety
- Automated migrations
- Seed scripts for development
- Framework: Next.js 16.1.1 (App Router)
- UI Library: React 19
- Language: TypeScript (strict mode)
- Styling: Tailwind CSS + shadcn/ui
- Forms: React Hook Form + Zod validation
- State: Zustand + TanStack Query
- i18n: next-intl (bilingual support)
- API: Hono.js (lightweight, fast)
- ORM: Prisma (type-safe database access)
- Database: MySQL 8.0
- Auth: NextAuth.js v5 (Credentials + OAuth + 2FA)
- Storage: AWS S3 / Cloudflare R2 / MinIO (Replaced DB BLOBs)
- Email: Nodemailer + React Email (Direct SMTP)
- Cache: Redis (Caching Layer)
- i18n: next-intl (Arabic/English with RTL support)
- Containerization: Docker (multi-stage builds)
- Deployment: Virtuozzo Application Platform
- CI/CD: GitHub Actions (ready)
- Testing: Jest + React Testing Library
| Component | Before | After v2.0 | Impact |
|---|---|---|---|
| Storage | Database BLOBs | S3 (AWS/R2) | -97% cost |
| Database | MariaDB 10.11 | MySQL 8.0 | Production compatible |
| Queue | Redis + BullMQ | Direct SMTP | -20% cost |
| Total Savings | - | - | -40% infrastructure cost |
- Node.js v18+ (v20 recommended)
- Package Manager: bun (recommended) or npm
- Database: MySQL 8.0
- S3 Provider: AWS S3, Cloudflare R2, or MinIO
git clone https://github.com/mohammed3200/website.git
cd website# Using bun (recommended)
bun install
# OR using npm
npm install# Copy template
cp .env.example .env
# Edit .env with your configuration
# See "Environment Variables" section below# Generate Prisma Client
bunx prisma generate
# Run migrations
bunx prisma migrate deploy
# Seed database (optional)
bun run seed
# Seed RBAC system (required)
bun run seed:rbac
# Verify RBAC integrity
bun run rbac:verifyOption A: MinIO (Local Development)
# Start MinIO with docker-compose
docker-compose up -d minio
# Create bucket
bun run setup:minioOption B: AWS S3 (Production)
# Create S3 bucket in AWS Console
# Get access credentials
# Add to .env: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEYOption C: Cloudflare R2 (Production)
# Create R2 bucket in Cloudflare Dashboard
# Get access credentials
# Add to .env with S3_ENDPOINTbun run dev
# Visit http://localhost:3000Create .env file with the following (see .env.production.template for all options):
# Database
DATABASE_URL="mysql://root:password@localhost:3306/citcoder_eitdc"
# Auth
NEXTAUTH_SECRET="your-secret-here" # Generate: bunx tsx -e "console.log(require('crypto').randomBytes(48).toString('base64'))"
NEXTAUTH_URL="http://localhost:3000"
# Admin
INIT_ADMIN_EMAIL="admin@example.com"
INIT_ADMIN_PASSWORD="SecurePassword123!"
# Email (Gmail example)
SMTP_HOST="smtp.gmail.com"
SMTP_PORT=587
SMTP_USER="your-email@gmail.com"
SMTP_PASS="app-specific-password" # Not your Gmail password!
EMAIL_FROM="your-email@gmail.com"
# S3 Storage (MinIO for development)
AWS_REGION="us-east-1"
AWS_ACCESS_KEY_ID="minioadmin"
AWS_SECRET_ACCESS_KEY="minioadmin"
S3_ENDPOINT="http://localhost:9000"
S3_BUCKET_NAME="ebic-media"
S3_PUBLIC_ACCESS="true"-
Push to Git Repository
git push origin main
-
Deploy via Virtuozzo
- New Environment β Docker β "From Git"
- Repository: Your GitHub repo URL
- Branch:
main - Dockerfile:
./Dockerfile - Auto-rebuild: Enable
-
Add Services
- MySQL 8.0 database node
- (Optional) MinIO or configure external S3
-
Configure Environment Variables
- Copy from
.env.production.template - Set production secrets
- Configure S3 credentials
- Copy from
-
Initialize Database
# SSH into container bunx prisma migrate deploy bunx tsx prisma/seed-rbac.ts bunx tsx scripts/verify-rbac.ts -
Configure Domain & SSL
- Point DNS to Virtuozzo IP
- Enable Let's Encrypt SSL
- Complete Deployment Guide:
docs/Final_Production_Deployment_Checklist.md - Alternative Strategies:
docs/Alternative_Deployment_Strategies.md - Secrets Management:
docs/Production_Secrets.md
src/
βββ app/ # Next.js App Router
β βββ [locale]/ # Internationalized routes (ar/en)
β β βββ (public)/ # Public pages (home, news, faq)
β β βββ innovators/ # Innovator registration
β β βββ collaborators/ # Collaborator registration
β βββ admin/ # Admin dashboard (protected)
β βββ api/ # API routes (Hono.js)
βββ features/ # Domain modules
β βββ auth/ # Authentication & RBAC
β βββ collaborators/ # Collaborator submissions
β βββ innovators/ # Innovator projects
β βββ email/ # Email service
β βββ news/ # News articles
β βββ strategic-plan/ # Strategic plans
βββ components/ # Reusable UI components
β βββ ui/ # shadcn/ui components
β βββ forms/ # Form components
β βββ layout/ # Layout components
βββ lib/ # Utilities
β βββ db.ts # Database client
β βββ auth/ # Auth utilities
β βββ email/ # Email templates & service
β βββ s3/ # S3 storage service
β βββ forms/ # Form utilities
β βββ rbac.ts # RBAC definitions
βββ i18n/ # Internationalization
β βββ routing.ts # i18n configuration
β βββ request.ts # Server-side i18n
βββ middleware.ts # Route protection & i18n
βββ prisma/ # Database
βββ schema.prisma # Database schema
βββ migrations/ # Migration history
βββ seed-rbac.ts # RBAC initialization
# Development
bun run dev # Start dev server (http://localhost:3000)
bun run build # Build for production
bun run start # Start production server
# Database
bun run db:push # Push schema changes (dev)
bun run db:migrate # Create migration
bun run db:studio # Open Prisma Studio
bun run db:seed # Seed sample data
bun run seed:rbac # Seed RBAC system (required)
# Verification
bun run rbac:verify # Verify RBAC integrity
# S3 Setup
bun run setup:minio # Create MinIO bucket (local)
# Testing
bun test # Run tests
bun test:watch # Run tests in watch mode
bun test:coverage # Generate coverage report
# Code Quality
bun run lint # Run ESLint
bun run format # Format code with Prettier# Start all services (MySQL + MinIO)
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down# Run all tests
bun test
# Run specific test file
bun test src/features/auth/__tests__/rbac.test.ts
# Watch mode
bun test:watch
# Coverage report
bun test:coveragesrc/features/
βββ [feature]/
βββ __tests__/
β βββ components.test.tsx
β βββ api.test.ts
β βββ utils.test.ts
βββ ...
- CHANGELOG.md - Version history and changes
- PROJECT_TASKS_ROADMAP.md - Development roadmap (22 tasks)
- PROJECT_ANALYSIS.md - Architecture analysis
- Email System - Email templates and configuration
- More documentation in
docs/folder
- 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
- TypeScript strict mode
- ESLint + Prettier
- Test coverage for new features
- Documentation for significant changes
Distributed under the MIT License. See LICENSE for details.
Center for Entrepreneurship & Business Incubators
Misurata College of Industrial Technology
Misurata, Libya
- Email: ebic@cit.edu.ly
- Website: https://ebic.cit.edu.ly
- Misurata College of Industrial Technology
- Next.js and Vercel teams
- All open-source contributors
Made with β€οΈ for entrepreneurs and innovators in Libya