The “Brgy. San Antonio Community Hub” is a comprehensive web application designed to serve as the main online platform for Barangay San Antonio, Candon City. It aims to enhance communication, streamline services, and improve community engagement between residents and barangay officials. The project incorporates modern web technologies, AI-powered features, and accessibility options to cater to a diverse user base.
The system employs a client-server architecture with a clear separation of concerns between the frontend and backend.
A Single-Page Application (SPA) built with React, located in the client/
directory. The structure is organized for scalability:
components/
: Contains reusable UI elements like layouts, navigation, and widgets.pages/
: Holds the main application screens (Admin, Public, User).api/
: Manages client-side API call functions that interact with the Express backend.contexts/
: Manages global state, such as AuthContext
for user authentication.hooks/
: Contains custom React hooks like useApi
and useAuth
to abstract complex logic.App.js
: The main application component that defines routing and the overall layout.A Node.js Express application located in the server/
directory. Key files and logic include:
app.js
: Initializes the Firebase Admin SDK and sets up all middleware and routes.authenticate
middleware to verify Firebase ID tokens on protected routes, and isAdmin
/ isEmployeeOrAdmin
for role-based authorization./api/v1/
for Authentication, Content Management (pages, articles), a Ticket System, User Management, and the AI Chatbot.ManagementPage
React component is used for CRUD operations across different content types (articles, pages, forms), promoting code reusability. A rich text editor (react-quill
) is integrated for dynamic content creation.