How kothakula-sagar/abra-logistics-crm works
Abra Logistics CRM is a browser-based, role-aware logistics sales and marketing application backed by Firebase, with an Express server for protected APIs and external delivery integrations. A CRM user initiates the principal workflow by signing in through the browser, then uses the application to manage leads, customers, staff workflows, campaigns, and SEO content. For email campaigns, the user selects a provider and sends from the campaign; the documented providers are an authorized Gmail account and Gmail API with OAuth 2.0. The repository also contains SEO generation and performance-analysis features, but the sampled inputs do not establish their complete orchestration.
Components
Browser shell and identity
• CRM browser entry — index.html: Main login/application page; the sign-in and password-reset flows are implemented in the authentication module.
• Role-based application shell — js/app.js: Maintains current user and view state, builds navigation, switches views, and loads selected domain renderers.
• Authentication and authorization — js/auth.js: Signs users in and out through Firebase Authentication, checks their Firestore user profile, and handles password resets and authenticated access.
• Shared Firebase client — js/firebase.js: Initializes Firebase Authentication, Firestore, and Storage and exposes a shared client API used by browser modules.
• Shared UI helpers — js/ui.js: Provides DOM-facing helpers for toasts, loading indicators, modals, tabs, and sidebar behavior.
Sales operations and workforce
• Lead pipeline and assignment — js/leads.js: Implements the substantial lead-management surface; assignment and related logic are also present in the separate assignment module.
• Assignment workflow — js/assignment.js: Implements lead assignment behavior as a distinct domain module.
• Customer management — js/customers.js: Implements customer-facing CRM workflows.
• Accounts and user administration — js/accounts.js: Lets administrators review and update Firestore user records.
• HR and staff operations — js/hr-transfers.js: Implements HR transfer workflows; js/leave.js separately implements leave management.
• Training management — js/training.js: Implements training workflows; js/training-admin.js provides the administrative counterpart.
• Operational audit and reporting — js/call-audit.js: Implements call-audit workflows; js/report.js provides reporting, and js/history.js implements the SEO-generation history dashboard.
Marketing, content, and analysis
• Campaign and product marketing — js/marketing.js: Manages marketing products and campaigns, including campaign content and recipient tracking.
• Marketing channels — js/marketing-channels.js: Implements channel-specific marketing workflows.
• Campaign analytics and reports — js/campaign-analytics.js: Analyzes campaign performance; js/campaign-reports.js supplies campaign reporting.
• SEO generation and AI — js/ai.js: Implements AI-related functionality; the available excerpts do not establish its full call flow. SEO history and generated content are represented in the history module.
• Performance analysis — js/performance-ai.js: Turns PageSpeed Insights audit data into recommendations using configured Groq, Gemini, or OpenRouter APIs.
• Application dashboards — js/dashboard.js: Calculates dashboard statistics using product and marketing data; js/super-dashboard.js supplies a separate super-admin dashboard.
Server and external interfaces
• Express API and integrations — server.js: Runs the Express server and contains protected API routes and server-side integration logic, including Telegram-related operations and email endpoints documented by the README.
• CRM user — *(external; no repository path)*: The human actor who signs in, navigates CRM views, and initiates campaign sends.
• Firebase services — *(external; no repository path)*: Provide browser authentication, Firestore persistence, and file storage; the server also imports Firebase Admin.
• Email delivery providers — *(external; no repository path)*: The README documents Email Marketing through an authorized Gmail account and Gmail API delivery through OAuth 2.0.
• Google OAuth — *(external; no repository path)*: Authorizes Gmail API access through the documented callback flow.
• Telegram Bot API — *(external; no repository path)*: The server code includes Telegram operations, but the sampled material does not establish the complete trigger path.
Relationships
• CRM user -> CRM browser entry: opens the CRM to sign in; evidence: README.md (documents opening the CRM to authorize Gmail; the login entry is indicated by index.html).
• CRM browser entry -> Authentication and authorization: provides the login surface; evidence: index.html (entry-to-script wiring was not sampled).
• Authentication and authorization -> Shared Firebase client: performs sign-in and reads the user profile; evidence: js/auth.js (excerpt).
• Role-based application shell -> Shared Firebase client: reads lead, assignment-queue, and leave data for application statistics; evidence: js/app.js (excerpt).
• Role-based application shell -> Lead pipeline and assignment: selects and loads domain views; evidence: js/app.js (excerpt shows view dispatch for leave and HR transfers; lead-view dispatch is not shown).
• Lead pipeline and assignment -> Assignment workflow: ownership relationship only; evidence: none (inferred).
• Accounts and user administration -> Shared Firebase client: reads and updates user documents; evidence: js/accounts.js (excerpt).
• Application dashboards -> Campaign and product marketing: loads product and meta-campaign data for dashboard calculations; evidence: js/dashboard.js (excerpt).
• Campaign and product marketing -> Shared UI helpers: displays feedback through toast helpers; evidence: js/marketing.js (excerpt).
• CRM user -> Campaign and product marketing: selects a campaign email provider and sends; evidence: README.md.
• Campaign and product marketing -> Email delivery providers: sends via the campaign’s selected provider; evidence: README.md (the specific frontend-to-endpoint call is not established).
• Google OAuth -> Express API and integrations: returns authorization to the documented Gmail callback endpoint; evidence: README.md.
• Express API and integrations -> Firebase services: accesses Firestore-backed user and delivery records; evidence: server.js (excerpt).
• Express API and integrations -> Telegram Bot API: performs Telegram API operations; evidence: server.js (excerpt).
• Performance analysis -> Groq, Gemini, or OpenRouter: sends analysis requests to the selected provider; evidence: js/performance-ai.js (excerpt).
Coverage limits
The source sample does not include HTML script wiring, most module implementations, or the server’s complete route definitions. Consequently, exact browser-to-server email call sites, view-to-module dispatch for many domains, and the trigger for server-side Telegram notifications could not be verified. Connections marked inferred or described only as documented should not be treated as confirmed runtime wiring.
Main entry points: marketing.js Campaign and product marketing · server.js Express API and integrations · firebase.js Shared Firebase client · app.js Role-based app shell
Components 18
Browser and identity
CRM entry, application shell, authentication, and shared browser services.
- CRM browser entry
index.html - Role-based app shell
js/app.js - Authentication and authorization
js/auth.js - Shared Firebase client
js/firebase.js - Shared UI helpers
js/ui.js
CRM operations
Lead assignment and account administration.
- Lead pipeline
js/leads.js - Assignment workflow
js/assignment.js - Accounts administration
js/accounts.js
Marketing and analysis
Campaign workflows, dashboards, and performance analysis.
- Application dashboards
js/dashboard.js - Campaign and product marketing
js/marketing.js - Performance analysis
js/performance-ai.js
Server integrations
Protected APIs and server-side integrations.
- Express API and integrations
server.js
External systems
Human actors and third-party services.
- CRM user
- Firebase services
- Gmail delivery providers · Authorized Gmail account and Gmail API delivery through OAuth 2.0.
- Google OAuth
- Telegram Bot API
- Groq, Gemini, OpenRouter
Connections 15
- CRM user → CRM browser entry: opens CRM
README.md - CRM browser entry → Authentication and authorization: provides login
- Authentication and authorization → Shared Firebase client: authenticates and reads profile
js/auth.js - Role-based app shell → Shared Firebase client: reads application data
js/app.js - Role-based app shell → Lead pipeline: loads domain views
js/app.js - Lead pipeline → Assignment workflow: ownership · Inferred; not shown in the code that was read.
- Accounts administration → Shared Firebase client: reads and updates users
js/accounts.js - Application dashboards → Campaign and product marketing: loads campaign data
js/dashboard.js - Campaign and product marketing → Shared UI helpers: shows feedback
js/marketing.js - CRM user → Campaign and product marketing: selects and sends campaign
README.md - Campaign and product marketing → Gmail delivery providers: sends campaign email · Provider delivery is documented; the specific frontend-to-endpoint call is not established.
README.md - Google OAuth → Express API and integrations: returns authorization
README.md - Express API and integrations → Firebase services: accesses records
server.js - Express API and integrations → Telegram Bot API: performs API operations
server.js - Performance analysis → Groq, Gemini, OpenRouter: sends analysis requests
js/performance-ai.js