{"id":50664783,"url":"https://github.com/ghwmelite-dotcom/ohcs-elibrary","last_synced_at":"2026-06-08T05:03:59.620Z","repository":{"id":334265639,"uuid":"1123160250","full_name":"ghwmelite-dotcom/ohcs-elibrary","owner":"ghwmelite-dotcom","description":"AI-Powered Knowledge Management Platform for Ghana's Civil Service | Document Library, AI Assistants (Kwame \u0026 Ayo), Research Lab, LMS, Social Networking, Wellness Hub | Built with React, TypeScript, Cloudflare Workers","archived":false,"fork":false,"pushed_at":"2026-04-26T12:28:20.000Z","size":13419,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-26T13:09:12.583Z","etag":null,"topics":["ai","civil-service","cloudflare-workers","document-management","ghana","knowledge-management","learning-management-system","react","typescript","wellness"],"latest_commit_sha":null,"homepage":"https://ohcs-elibrary.pages.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghwmelite-dotcom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-26T09:51:24.000Z","updated_at":"2026-04-24T15:43:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ghwmelite-dotcom/ohcs-elibrary","commit_stats":null,"previous_names":["ghwmelite-dotcom/ohcs-elibrary"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ghwmelite-dotcom/ohcs-elibrary","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghwmelite-dotcom%2Fohcs-elibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghwmelite-dotcom%2Fohcs-elibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghwmelite-dotcom%2Fohcs-elibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghwmelite-dotcom%2Fohcs-elibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghwmelite-dotcom","download_url":"https://codeload.github.com/ghwmelite-dotcom/ohcs-elibrary/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghwmelite-dotcom%2Fohcs-elibrary/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34048707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","civil-service","cloudflare-workers","document-management","ghana","knowledge-management","learning-management-system","react","typescript","wellness"],"created_at":"2026-06-08T05:03:58.137Z","updated_at":"2026-06-08T05:03:59.606Z","avatar_url":"https://github.com/ghwmelite-dotcom.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OHCS E-Library\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"public/icons/icon-512x512.png\" alt=\"OHCS E-Library Logo\" width=\"120\" height=\"120\"\u003e\n\n### **AI-Powered Knowledge Management Platform for Ghana's Civil Service**\n\n[![Live Demo](https://img.shields.io/badge/Live_Demo-Visit_Site-success?style=for-the-badge\u0026logo=cloudflare)](https://ohcs-elibrary.pages.dev)\n[![Version](https://img.shields.io/badge/Version-2.0.0-blue?style=for-the-badge)](https://github.com/ghwmelite-dotcom/ohcs-elibrary/releases)\n[![Platform](https://img.shields.io/badge/Platform-Cloudflare-orange?style=for-the-badge\u0026logo=cloudflare)](https://workers.cloudflare.com)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue?style=for-the-badge\u0026logo=typescript)](https://www.typescriptlang.org/)\n[![React](https://img.shields.io/badge/React-18-61DAFB?style=for-the-badge\u0026logo=react)](https://react.dev)\n[![License](https://img.shields.io/badge/License-Proprietary-red?style=for-the-badge)](#license)\n\n**[Live Demo](https://ohcs-elibrary.pages.dev)** | **[Try Demo Access](#demo-access)** | **[Features](#-features)** | **[Tech Stack](#-technology-stack)** | **[Getting Started](#-getting-started)**\n\n\u003c/div\u003e\n\n---\n\n## Overview\n\nThe **OHCS E-Library** is a comprehensive digital knowledge management and collaboration platform designed for Ghana's Office of the Head of Civil Service (OHCS). It empowers over 500,000 civil servants with AI-powered tools for document management, research, learning, wellness support, and professional networking.\n\n### Highlights\n\n- **40+ API Endpoints** - Comprehensive REST API powering all features\n- **25+ Database Migrations** - Robust data architecture\n- **100+ React Components** - Modern, accessible UI components\n- **2 AI Assistants** - Kwame (Knowledge) \u0026 Ayo (Wellness)\n- **Full LMS** - Complete learning management system with courses, quizzes, and certificates\n\n---\n\n## Demo Access\n\nTry the platform without registration using our **Demo Access** feature:\n\n1. Visit [ohcs-elibrary.pages.dev](https://ohcs-elibrary.pages.dev)\n2. Click **\"Try Demo Access\"** on the login screen\n3. Explore all features with a 24-hour demo session\n\nDemo users get access to:\n- Document library with AI analysis\n- Kwame AI Knowledge Assistant\n- Ayo Wellness Counselor\n- Research Lab with Kofi AI\n- Learning Management System\n- Community forums and groups\n- And much more!\n\n---\n\n## Features\n\n### AI-Powered Assistants\n\n| Assistant | Purpose | Capabilities |\n|-----------|---------|--------------|\n| **Kwame** | Knowledge Assistant | RAG-powered Q\u0026A on civil service policies, procedures, HR matters. Cites official documents. |\n| **Ayo** | Wellness Counselor | Anonymous mental health support, stress management, mood tracking, crisis resources. |\n| **Kofi** | Research Partner | Policy brief generation, data analysis, literature review, research insights. |\n\n### Core Modules\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n#### Document Library\n- PDF, Word, Excel, PowerPoint support\n- AI-powered search \u0026 summarization\n- Category \u0026 MDA organization\n- Version history tracking\n- Bookmarks \u0026 annotations\n- Google Drive integration\n\n#### Learning Management System\n- Course creation \u0026 enrollment\n- Video lessons \u0026 materials\n- Quizzes with auto-grading\n- Progress tracking \u0026 certificates\n- Learning paths\n- Admin analytics\n\n#### Research Lab\n- Project management with phases\n- Literature linking \u0026 citations\n- Collaborative discussions\n- Milestone tracking\n- 12+ research templates\n- Export to PDF, DOCX, Markdown\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n#### Social Networking\n- Professional profiles\n- Connection requests \u0026 following\n- Activity wall \u0026 posts\n- Direct messaging with reactions\n- Presence indicators\n- User mentions\n\n#### Wellness Hub\n- Mental health resources\n- Anonymous AI counseling\n- Mood tracking \u0026 analytics\n- Breathing exercises\n- Crisis support hotlines\n- Counselor escalation\n\n#### Community Features\n- Discussion forums with voting\n- Professional groups\n- Real-time chat rooms\n- Voice messages\n- File sharing\n- Gamification \u0026 badges\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n### Additional Features\n\n- **News Aggregation** - Curated Ghanaian news with AI summaries\n- **Notifications** - Real-time alerts and email digests\n- **Calendar \u0026 Events** - Personal and organization events\n- **E-Shop** - Internal marketplace for supplies\n- **Peer Recognition** - Kudos and appreciation system\n- **Two-Factor Auth** - TOTP-based security\n- **Audit Logging** - Complete activity tracking\n- **Admin Dashboard** - 15+ admin pages with analytics\n\n---\n\n## Technology Stack\n\n### Frontend\n| Technology | Version | Purpose |\n|------------|---------|---------|\n| React | 18.x | UI framework with concurrent features |\n| TypeScript | 5.x | Type-safe development |\n| Vite | 5.x | Build tool \u0026 dev server |\n| Tailwind CSS | 3.x | Utility-first styling |\n| Framer Motion | 10.x | Animations \u0026 transitions |\n| Zustand | 4.x | State management |\n| React Router | 6.x | Client-side routing |\n| React Hook Form | 7.x | Form handling |\n| Zod | 3.x | Schema validation |\n\n### Backend\n| Technology | Purpose |\n|------------|---------|\n| Cloudflare Workers | Serverless edge computing |\n| Hono | Lightweight web framework |\n| D1 Database | SQLite-based serverless DB |\n| R2 Storage | Object storage for documents |\n| KV Namespace | Session \u0026 cache storage |\n| Workers AI | LLM \u0026 embedding inference |\n\n### AI Models (Cloudflare Workers AI)\n| Model | Tier | Purpose |\n|-------|------|---------|\n| `@cf/qwen/qwq-32b` | Heavy | Research, counseling (Dr. Sena), Ozzy RAG, document Q\u0026A |\n| `@cf/meta/llama-4-scout-17b-16e-instruct` | Light | Document summaries, topic extraction, news summarization |\n| `@cf/baai/bge-m3` | Embedding | Multilingual document embeddings for RAG search (1024-dim) |\n\n### Research Hub Enhancements\n- **Full-Text Search**: FTS5-powered search across projects, notes, and literature with ranked results\n- **File Attachments**: Upload and manage research documents via R2 storage (50MB limit)\n- **Export Generation**: Compile research into Markdown/HTML with R2 storage and download\n- **Advanced AI Analysis**: Literature gap analysis, question refinement, methodology suggestions, auto-tagging, cross-project insights\n- **Research Notifications**: Team alerts for reviews, discussions, mentions, milestones, and phase approvals\n- **Phase Approval Gates**: Formal approval workflow for advancing project phases\n- **Ethics Tracking**: IRB/ethics approval records with status tracking\n- **Audit Trail Export**: CSV export of all project activities for compliance\n- **Contribution Tracking**: Points-based tracking of team member contributions\n\n### Email Services\n- **Gmail API** - OAuth2-based email delivery\n- **Resend API** - Transactional email fallback\n\n---\n\n## System Architecture\n\n```\n┌─────────────────────────────────────────────────────────────────────────┐\n│                          CLIENT LAYER                                    │\n│  ┌───────────────────────────────────────────────────────────────────┐  │\n│  │                    React SPA (Vite + TypeScript)                   │  │\n│  │  • 100+ Components    • Zustand Stores    • Dark/Light Theme      │  │\n│  └───────────────────────────────────────────────────────────────────┘  │\n└─────────────────────────────────────────────────────────────────────────┘\n                                    │\n                                    ▼\n┌─────────────────────────────────────────────────────────────────────────┐\n│                       EDGE LAYER (Cloudflare)                            │\n│  ┌─────────────────────────┐    ┌─────────────────────────────────┐    │\n│  │   Cloudflare Pages      │    │     Cloudflare Workers (API)    │    │\n│  │   • Static hosting      │    │     • Hono framework            │    │\n│  │   • Global CDN          │    │     • JWT authentication        │    │\n│  │   • Auto HTTPS          │    │     • Rate limiting             │    │\n│  └─────────────────────────┘    └─────────────────────────────────┘    │\n└─────────────────────────────────────────────────────────────────────────┘\n                                    │\n                                    ▼\n┌─────────────────────────────────────────────────────────────────────────┐\n│                          DATA LAYER                                      │\n│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐  ┌────────────┐  │\n│  │ D1 Database  │  │  R2 Storage  │  │   KV Cache   │  │ Workers AI │  │\n│  │  (SQLite)    │  │ (Documents)  │  │  (Sessions)  │  │  (LLM/RAG) │  │\n│  └──────────────┘  └──────────────┘  └──────────────┘  └────────────┘  │\n└─────────────────────────────────────────────────────────────────────────┘\n```\n\n---\n\n## Getting Started\n\n### Prerequisites\n\n- **Node.js** 18+\n- **npm** 9+\n- **Git**\n- **Cloudflare Account** (for deployment)\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/ghwmelite-dotcom/ohcs-elibrary.git\ncd ohcs-elibrary\n\n# Install frontend dependencies\nnpm install\n\n# Install worker dependencies\ncd workers \u0026\u0026 npm install \u0026\u0026 cd ..\n\n# Start frontend dev server\nnpm run dev\n\n# In another terminal, start worker\ncd workers \u0026\u0026 npm run dev\n```\n\nThe application runs at `http://localhost:5173`\n\n### Environment Configuration\n\n**Frontend** (`.env`):\n```env\nVITE_API_URL=http://localhost:8787/api/v1\n```\n\n**Workers** (`workers/wrangler.toml`):\n```toml\n[vars]\nENVIRONMENT = \"development\"\nJWT_SECRET = \"your-secret-key\"\n\n# Email (Gmail API recommended for .gov.gh delivery)\nGMAIL_CLIENT_ID = \"...\"\nGMAIL_CLIENT_SECRET = \"...\"\nGMAIL_REFRESH_TOKEN = \"...\"\n\n# Google Drive Integration (optional)\nGOOGLE_DRIVE_CLIENT_ID = \"...\"\nGOOGLE_DRIVE_CLIENT_SECRET = \"...\"\nGOOGLE_DRIVE_REDIRECT_URI = \"...\"\n```\n\n---\n\n## Project Structure\n\n```\nohcs-elibrary/\n├── public/                      # Static assets \u0026 PWA icons\n├── src/\n│   ├── components/              # React components (100+)\n│   │   ├── auth/                # Authentication UI\n│   │   ├── kwame/               # Kwame AI chat components\n│   │   ├── wellness/            # Ayo counselor components\n│   │   ├── research/            # Research Lab components\n│   │   ├── lms/                 # Learning system components\n│   │   ├── social/              # Social networking components\n│   │   └── ...\n│   ├── pages/                   # Page components\n│   │   ├── admin/               # Admin panel (15+ pages)\n│   │   ├── Kwame.tsx            # AI Knowledge Assistant\n│   │   ├── WellnessChat.tsx     # Ayo Wellness Counselor\n│   │   ├── ResearchLab.tsx      # Research workspace\n│   │   ├── LMS.tsx              # Learning system\n│   │   └── ...\n│   ├── stores/                  # Zustand state stores\n│   ├── types/                   # TypeScript definitions\n│   └── utils/                   # Utility functions\n├── workers/\n│   ├── src/\n│   │   ├── routes/              # API routes (40+ endpoints)\n│   │   │   ├── auth.ts          # Authentication + Demo login\n│   │   │   ├── kwame.ts         # Kwame AI API\n│   │   │   ├── counselor.ts     # Ayo counselor API\n│   │   │   ├── research.ts      # Research Lab API (3800+ lines)\n│   │   │   ├── lms.ts           # LMS API\n│   │   │   └── ...\n│   │   └── services/            # AI services (RAG, embeddings)\n│   └── migrations/              # Database migrations (25+)\n└── docs/                        # Documentation\n```\n\n---\n\n## API Endpoints\n\n### Authentication\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| POST | `/auth/register` | Register with .gov.gh email |\n| POST | `/auth/login` | Login with email/password |\n| POST | `/auth/demo` | **Demo access** (24hr session) |\n| POST | `/auth/logout` | End session |\n| POST | `/auth/forgot-password` | Request reset code |\n\n### AI Assistants\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| POST | `/kwame/sessions` | Create Kwame chat session |\n| POST | `/kwame/sessions/:id/messages` | Send message to Kwame |\n| GET | `/kwame/suggestions` | Get suggested questions |\n| POST | `/counselor/sessions` | Start Ayo counseling (supports anonymous) |\n| POST | `/counselor/sessions/:id/messages` | Message Ayo |\n\n### Documents, Forum, Chat, Groups, Research, LMS, Wellness\nSee [full API documentation](docs/API.md) for 40+ endpoints.\n\n---\n\n## User Roles\n\n| Role | Access Level |\n|------|--------------|\n| `super_admin` | Full system access |\n| `admin` | Administrative functions |\n| `director` | Department management |\n| `librarian` | Document management |\n| `counselor` | Wellness dashboard access |\n| `moderator` | Forum/chat moderation |\n| `contributor` | Content creation |\n| `civil_servant` | Standard user |\n| `guest` | Limited read-only |\n\n---\n\n## Security\n\n- **JWT Authentication** - Secure token-based auth with refresh tokens\n- **Two-Factor Authentication** - TOTP with backup codes\n- **Role-Based Access Control** - Granular permissions system\n- **Rate Limiting** - API abuse prevention\n- **HTTPS Everywhere** - TLS encryption in transit\n- **Input Validation** - Zod schemas on all inputs\n- **SQL Injection Prevention** - Parameterized queries\n- **XSS Protection** - Content sanitization\n- **Audit Logging** - Complete activity trail\n\n---\n\n## Deployment\n\n### Frontend (Cloudflare Pages)\n```bash\nnpm run build\nnpx wrangler pages deploy dist --project-name=ohcs-elibrary\n```\n\n### Backend (Cloudflare Workers)\n```bash\ncd workers\nnpm run deploy\n```\n\n### Database Migrations\n```bash\nnpx wrangler d1 execute ohcs-elibrary --file=migrations/XXXX_migration.sql\n```\n\n---\n\n## Design System\n\n| Element | Color |\n|---------|-------|\n| Primary (Green) | `#006B3F` - Ghana flag |\n| Accent (Gold) | `#FCD116` - Ghana flag |\n| Danger (Red) | `#CE1126` - Ghana flag |\n| Black Star | `#000000` - National symbol |\n\n- **Light/Dark Mode** - Full theme support\n- **Responsive** - Mobile-first design\n- **Accessible** - WCAG 2.1 compliance\n- **Animations** - Framer Motion transitions\n\n---\n\n## Version History\n\n| Version | Date | Highlights |\n|---------|------|------------|\n| 2.0.0 | Jan 2026 | Demo access, Kwame/Ayo AI fixes, Google Drive integration |\n| 1.5.0 | Jan 2026 | LMS, Social networking, Peer recognition |\n| 1.1.0 | Dec 2025 | Research Lab Phase 4, Wellness Hub |\n| 1.0.0 | Dec 2025 | Initial release |\n\nSee [CHANGELOG.md](CHANGELOG.md) for detailed history.\n\n---\n\n## Contributing\n\nThis is a proprietary project for Ghana's Office of the Head of Civil Service. Contributions are limited to authorized personnel.\n\n### Development Guidelines\n1. Follow TypeScript best practices\n2. Write clean, documented code\n3. Test thoroughly before committing\n4. Use conventional commit messages\n\n---\n\n## License\n\n**Proprietary License**\n\nCopyright (c) 2025-2026 Office of the Head of Civil Service, Ghana. All rights reserved.\n\nUnauthorized copying, distribution, or use of this software is strictly prohibited.\n\n---\n\n## Contact\n\n**Developer:** Osborn Hodges\n**Email:** davies.hodges@ohcs.gov.gh\n**Organization:** Office of the Head of Civil Service, Ghana\n\n**Live Platform:** [ohcs-elibrary.pages.dev](https://ohcs-elibrary.pages.dev)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Built with pride for Ghana's Civil Service**\n\n\u003cimg src=\"https://flagcdn.com/w80/gh.png\" alt=\"Ghana Flag\" width=\"40\"\u003e\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghwmelite-dotcom%2Fohcs-elibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghwmelite-dotcom%2Fohcs-elibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghwmelite-dotcom%2Fohcs-elibrary/lists"}