How debeshghorui/econirvana works
Main components and their roles
• Frontend Interface – Represented by the Next.js application (folder: src/app). This includes pages for:
• Home, About, Blog, Contact, Dashboard, and other user-interactive pages.
• Specialized areas like Recycling (with sub-pages for business, drop-off, mail-in, and scheduling pickups), Rewards, and Services (e.g., Data Destruction).
• Reusable UI Components – Located in the src/components directory (Navbar, Footer, UI elements like Button, Card, etc.). These provide a consistent look and feel across pages.
• Authentication & Context Management – Handled via React Context providers in the src/context directory (e.g., AuthContext.tsx) and components in src/app/login and src/app/signup.
• Utility and Library Integration – The src/lib directory includes key integrations such as Firebase initialization and the Gemini (EcoBot AI) integration, which add dynamic functionalities (authentication, chat functionality, etc.).
• Static Assets – Served from the public directory for images and other assets.
• Configuration & Build Tools – Files like next.config.mjs, tailwind.config, package.json, and various ESLint/TS configuration files which outline build settings, style rules, and deployment configuration (e.g., Vercel via vercel.json).
Relationships and interactions between components
• User Interaction Flow – Rendered through the Next.js app’s folder structure. The layout.tsx files in src/app and src/app/about (and others) indicate shared layouts (with consistent Header, Footer, Navbar).
• Data and Authentication Flow – User data managed via Firebase as indicated by .env.local configuration settings and firebase integration code in src/lib/firebase.ts. The AuthContext supplies global authentication state to the app.
• External Service Integration – The Gemini API, referenced in src/lib/gemini.ts, is likely used by the EcoBot chat component (see src/components/chat/ChatBot.tsx) to provide intelligent responses.
• Internal Communication – Components interact with one another (for instance, layout components wrapping content pages) and may leverage context providers to share state.
• Recycle Services – The recycling service pages (in src/app/recycle) suggest distinct flows for different recycling options, each representing a focused service within the overall system.
Important architectural patterns and design principles
• Modular Design – The structure emphasizes modularity with clear separation between pages (views) and reusable components.
• Component-Based Architecture – Even within pages, the use of smaller UI and layout components (as seen in src/components/ui and src/components/layout) follows React’s component-based design, making the system scalable and maintainable.
• Context API – Use of React Context (see src/context) for global state management (e.g., authentication and chat state).
• Integration with External Services – Leveraging cloud-based services (Firebase and Gemini) to handle backend-as-a-service functions and AI capabilities.
• Responsive Design – TailwindCSS is used to ensure responsiveness and a modern UI design.