How chandel-aman/talawa-admin works
Project type and purpose
• Talawa-Admin is a single-page web application (SPA) written in React + TypeScript, built with Vite.
• Its purpose is to provide a browser-based administrative portal that consumes a GraphQL API (talawa-api) for managing membership, events, venues, tags, recurring meetings, etc.
File structure
• Top-level config and tooling:
• vite.config.ts, babel.config.cjs → front-end build tool configuration
• .eslintrc.json, .prettierrc → code style
• .husky, scripts/githooks → Git hooks
• GitHub/workflows → CI/CD pipelines (lint, tests, code scanning)
• Public assets: public/ (images, locales, manifest.json)
• GraphQL schema: schema.graphql (used for type generation)
• src/
• src/index.tsx, src/App.tsx → SPA entry point
• src/GraphQl/Queries & Mutations → all client GraphQL operations
• src/state → Redux-style store, reducers, action-creators, hooks
• src/components & src/screens → presentational and container components following a folder-per-feature pattern
• src/utils, src/setup → helpers, environment checks, recaptcha, local storage, testing utilities
README for additional insights
• Confirms this is a “web based administrative portal,” part of a modular ecosystem (mobile app, API, docs).
• Calls out core features like membership management and event registrations, which correspond to GraphQL queries/mutations under src/GraphQl.
a. Main components:
1) Browser-based SPA (React + TypeScript + Vite)
2) GraphQL Client (within the SPA, using generated types against schema.graphql)
3) talawa-api (GraphQL server)
4) Backend Data Stores (e.g., user DB, event DB – represented as abstract storage)
5) Third-party services:
– reCAPTCHA (via src/setup/validateRecaptcha)
– Authentication / OAuth if applicable
– CDN (serving public/ assets)
b. Relationships & data flow:
• User → SPA UI → Redux store ← GraphQL client
• GraphQL client → HTTP POST/GET → talawa-api → persistence (DB)
• SPA reads/writes local storage (useLocalstorage hook) for session tokens
• i18n subsystem loads locale JSON from public/locales
c. Architectural patterns & design principles:
• Container–Presentational (screens vs. components)
• Unidirectional data flow (React → Redux-style store → UI)
• Code-gen for GraphQL types (schema.graphql → src/GraphQl types)
• Feature-based folder structure (e.g., src/screens/EventVolunteers, src/components/AddOn)
d. Key technologies/frameworks:
• Frontend: React, React Router (inferred from SecuredRoute), TypeScript, Vite
• State: Redux-style (custom minimal store in src/state)
• Data fetching: GraphQL (queries & mutations under src/GraphQl)
• Build & Test: Husky, ESLint, Prettier, Jest, GitHub Actions
Final advice
• Every architectural element you see in the file tree (build tools, config, testing harness) by grouping them into “Dev Tooling” section.
• Separate the runtime components (SPA, GraphQL client, API, DB, third-party) as distinct clusters.