How probasibanagli/website works
Purpose and Runtime
ProbasiBangali is a community-services platform for Bengali residents and visitors in Tamil Nadu: discovery (stay, food, travel), emergency help, community/matrimony, government and legal services, content, and administration. It is a TypeScript Next.js App Router application, deployed/configured for Vercel and Firebase Functions. Key entry points: src/app/layout.tsx, src/app/page.tsx, src/proxy.ts, functions/src/index.ts.
Application Shell and Public Route Domains
The root layout establishes shared application UI; navigation, footer, global loading, blocked-user checks, language, alerts, and chat are cross-cutting client-side concerns. Public domains are implemented as route segments rather than a separate backend/frontend split:
• src/app/explore/stay/page.tsx
• src/app/emergency/hospitals/page.tsx
• src/app/community/matrimonial/page.tsx
• src/app/services/government/page.tsx
• src/app/blog/page.tsx
Identity, Authorization, and User State
Authentication supports login, registration, password recovery, OTP flows, sessions, and admin checks. Firebase appears to be the active data/auth boundary in the repository despite the README describing Supabase: client/admin SDK wrappers and Firestore collection abstractions are present. Authorization gates separate normal users, blocked users, and administrative operations.
• src/lib/firebase.ts
• src/lib/firebase-admin.ts
• src/lib/auth/AuthContext.tsx
• src/app/api/auth/session/route.ts
• src/app/api/auth/check-admin/route.ts
Data Access and API Boundary
Next route handlers form the server boundary for browser clients. Generic admin APIs expose module and record operations; dedicated endpoints handle user administration, CSV import, public Firestore access, matrimony interest, transit data, maps, and chat. Firestore-oriented services/types centralize data contracts, while seed/import scripts populate operational datasets.
• src/app/api/admin/[module]/route.ts
• src/app/api/public/firestore/route.ts
• src/lib/firestore/collections.ts
• src/lib/matrimony-service.ts
• src/lib/firestore/import_csv.ts
Administration and Content Operations
/admin is a module-oriented back-office area for users and service datasets: hospitals/emergency resources, travel, food, stays, community, events, legal/government services, blogs, and matrimony. Shared admin UI suggests these modules use common CRUD workflows against the generic admin API.
• src/app/admin/layout.tsx
• src/app/admin/page.tsx
• src/components/admin/AdminModulePage.tsx
• src/app/admin/users/page.tsx
• src/app/api/admin/import-csv/route.ts
External Integrations and Specialized Flows
Google Maps is proxied through server endpoints for place lookup/photos and map resolution, avoiding direct feature coupling in page routes. The chatbot has a server endpoint and widget; README identifies Groq/Llama as its intended AI service. Firebase Functions provide an additional deployed server runtime. Transit content combines static CSV/PDF assets and typed local datasets with an MTC API route.
• src/app/api/maps/places/route.ts
• src/app/api/public/place-photo/route.ts
• src/app/api/chat/route.ts
• functions/src/index.ts
• src/app/api/mtc-bus/route.ts
• src/data/transport-data.ts
Main entry points: route.ts Server API boundary · layout.tsx Application shell · firebase-admin.ts Firebase Admin SDK · page.tsx Public service domains
Components 21
Next.js application
App Router UI and server route handlers.
- Application shell · Shared navigation, user-state UI, alerts, and chat.
src/app/layout.tsx - Public discovery
src/app/page.tsx - Public service domains · Stay, emergency, community, government, and blog sections.
src/app/explore/stay/page.tsx - Auth user state · Provides authentication and authorization state to UI.
src/lib/auth/AuthContext.tsx - Request proxy
src/proxy.ts - Server API boundary · Browser-facing endpoints for application features.
src/app/api/public/firestore/route.ts - Generic admin CRUD · Module and record operations for back-office datasets.
src/app/api/admin/[module]/route.ts - Admin back office · Module-oriented administration for users and service content.
src/app/admin/page.tsx - Shared admin module UI
src/components/admin/AdminModulePage.tsx - Maps proxy endpoints · Server-side place lookup, photos, and map resolution.
src/app/api/maps/places/route.ts - Chat endpoint
src/app/api/chat/route.ts - Transit data flow · Typed transport data feeds the MTC route.
src/data/transport-data.ts - Matrimony service · Handles matrimony interest workflows.
src/lib/matrimony-service.ts
Firebase boundary
Authentication, Firestore, and deployed functions.
- Firestore collections · Central collection abstractions and data access contracts.
src/lib/firestore/collections.ts - Firebase client SDK
src/lib/firebase.ts - Firebase Admin SDK
src/lib/firebase-admin.ts - Firebase Auth and Firestore
- Firebase Functions · Additional deployed backend runtime.
functions/src/index.ts - CSV import pipeline · Populates operational Firestore datasets.
src/lib/firestore/import_csv.ts
External services
- Google Maps
- Groq / Llama · Intended chatbot model provider.
Connections 19
- Request proxy → Application shell: guards requests
- Application shell → Auth user state: uses
- Public discovery → Public service domains: links to
- Public service domains → Server API boundary: reads services
- Auth user state → Firebase client SDK: authenticates with
- Firebase client SDK → Firebase Auth and Firestore: connects to
- Server API boundary → Firebase Admin SDK: uses server access
- Firebase Admin SDK → Firebase Auth and Firestore: admin access
- Server API boundary → Firestore collections: uses contracts
- Admin back office → Shared admin module UI: renders modules
- Shared admin module UI → Generic admin CRUD: performs CRUD
- Generic admin CRUD → Firebase Admin SDK: persists records
- CSV import pipeline → Firebase Auth and Firestore: seeds datasets
- Server API boundary → Matrimony service: handles interests
- Maps proxy endpoints → Google Maps: proxies requests
- Chat endpoint → Groq / Llama: sends prompts
- Application shell → Chat endpoint: hosts chat UI
- Server API boundary → Transit data flow: serves transit data
- Firebase Functions → Firebase Auth and Firestore: runs on