How ganzafrica-org/ganzafrica works
Project Type & Purpose
• The platform is a full-stack web application dedicated to supporting GanzAfrica’s mission. It features a public-facing website that highlights fellowship programs, projects, and community initiatives, as well as an admin portal used for management tasks including user applications, fellow management, and CRM.
• The README clearly describes two primary domains: the public website (apps/web) and the admin portal (apps/portal), along with a shared backend API (packages/api) that drives business logic and data access.
File Structure
• Top-Level Separation:
• “apps/portal” for the administrative portal.
• “apps/web” for the public website.
• “packages/api” which contains all the server-side logic, configuration, and database interaction files using DrizzleORM.
• “packages/ui” holds shared UI components built using shadcn/ui and Tailwind CSS.
• Additional packages like “packages/eslint-config” and “packages/typescript-config” provide project-wide configuration consistency.
• Within each application, files and subdirectories are organized by feature or functionality. For example, in “apps/portal”, the “app/(auth)” directories indicate modular, route-based authentication pages. Similarly, “apps/web” organizes localized pages under subfolders corresponding to different locales.
• The backend API in “packages/api” is modularized into configuration, database, and business logic modules (partials like auth, email, etc.) and also integrates tRPC routers for type-safe API interactions.
Identifying Main Components
a. Frontend Components:
• Public Website (“apps/web”): Represents the user-facing website with localized content, static pages, interactive sections, and pages for fellowship programs, events, projects, etc.
• Admin Portal (“apps/portal”): The secured area for administrative tasks including fellow management, application tracking, and CRM functionalities.
b. Backend API (“packages/api”):
• Implements core business logic, authentication (using a custom PASETO-based system), and structured database interactions via DrizzleORM.
• Contains modules for authentication, email services, and database schema management.
c. Shared Components:
• UI Library (“packages/ui”): Contains reusable UI components such as buttons, cards, dialogs, and more that help maintain a consistent look and feel across both applications.
• Configuration Packages: ESLint and TypeScript configurations provided in separate packages to ensure code quality and type safety across the codebase.
d. Data & External Systems:
• Database: PostgreSQL (with migrations and Drizzle ORM configurations).
• Deployment & Infrastructure: Uses Cloudflare Pages for frontend deployments, Cloudflare Workers for backend deployments, Cloudflare R2 for storage, and DigitalOcean for hosting the PostgreSQL database.
Relationships & Interactions
• Shared UI components are used in both frontend applications. This can be represented by a central “UI Library” that both “apps/web” and “apps/portal” reference.
• Deployment infrastructure (Cloudflare Workers/Pages, DigitalOcean) can be shown as external systems that host and manage application runtime and data persistence.
Architectural Patterns & Technical Details
• Next.js is used consistently across applications—hinting at a server-side rendering and possibly a file-based routing methodology.
• tRPC provides end-to-end type safety for API calls.
• The custom PASETO-based authentication system details are part of the API’s auth module.
• The modular structure (with distinct directories for authentication and database logic) follows separation of concerns, ensuring maintainability.
• The use of Tailwind CSS and shadcn/ui establishes a component-driven styled UI.