This document provides a high-level overview of the EcoVerse codebase to help contributors quickly understand the project structure and navigate the repository efficiently.
The app directory contains the main application routing, pages, layouts, and views.
Responsibilities include:
- Application routing
- Page rendering
- Layout management
- Navigation flow
- Feature-specific pages
This directory serves as the primary entry point for the Next.js application.
The components directory contains reusable UI components used throughout the application.
Examples include:
- Navigation bars
- Buttons and form controls
- Custom input fields
- Scanner interface components
- Shared UI elements
Using reusable components helps maintain consistency and reduces code duplication.
The models directory contains MongoDB schema and model definitions used by the application.
Examples include:
User.ts- Future product-related models
These models define how data is structured and stored within MongoDB.
The lib directory stores shared utilities, helper functions, and configuration files used throughout the project.
Examples include:
- MongoDB connection helpers
- Firebase configuration
- Carbon footprint calculations
- Packaging analysis utilities
- Reward system logic
- General helper functions
Keeping shared logic in one place improves maintainability and reusability.
This directory is used for Firebase synchronization workflows and related build outputs.
Important Notes
- May contain compiled JavaScript (
.js) files - May contain source map (
.js.map) files - Generated during build or synchronization processes
Always modify the original source files whenever changes are required.
This directory contains scripts used to synchronize Firebase and MongoDB data.
Examples include:
- User synchronization scripts
- Firestore migration utilities
- Database synchronization helpers
Important Notes
- Some files may be generated or compiled outputs
- Do not directly edit compiled
.jsor.js.mapfiles - Update the original source files whenever applicable
EcoVerse is built using:
- Next.js – Application framework and routing
- TypeScript – Type-safe development
- Tailwind CSS – Utility-first styling framework
- MongoDB – Database layer
- Firebase Auth – User authentication and identity management
-
Fork this repository to your GitHub profile.
-
Clone your forked repository to your local system.
-
Create a new feature branch:
git checkout -b docs/architecture-guide
-
Add the required documentation file.
-
Commit your work with a meaningful commit message:
git commit -m "docs: add central codebase architecture guide" -
Push your branch to your fork.
-
Open a Pull Request (PR) against the main repository.
- Fork this repository to your GitHub profile.
- Open your fork on GitHub.
- Click Add file → Create new file.
- Name the file
ARCHITECTURE.md. - Paste your documentation into the editor.
- Commit the changes.
- Create a new branch and open a Pull Request.
- Follow the existing project structure when adding new features.
- Reuse components and utilities whenever possible.
- Write documentation in clear, beginner-friendly language.
- Prefer using backticks when referencing folder paths and file names.
- Do not modify, delete, or refactor existing code unless the issue specifically requires it.
- Do not edit generated build outputs directly.
- Keep documentation updated when introducing major architectural changes.
This guide serves as a starting point for contributors and should be updated as the project evolves.