Thank you for your interest in contributing to EcoSphere! This project is open to contributors of all skill levels — whether you're participating in an open-source program, Hacktoberfest, or just want to help build something meaningful.
EcoSphere is a supply-chain carbon intelligence platform built on a fully free and open-source stack. Contributions help sustainability teams everywhere get better tooling.
- Code of Conduct
- How to Get Started
- Project Structure
- How to Contribute
- Branch Naming
- Commit Messages
- Pull Request Process
- Automated Code Review
- Good First Issues
- Development Guidelines
- Getting Help
- Recognition
By participating in this project, you agree to abide by our Code of Conduct. Please read it before contributing. We are committed to making participation a welcoming, harassment-free experience for everyone.
- Node.js 18.18 or higher
- npm
- A free Neon Postgres database (free tier, no credit card needed)
- A GitHub account
Click the Fork button at the top right of this page. This creates your own copy of EcoSphere under your GitHub account.
git clone https://github.com/YOUR-USERNAME/EcoSphere.git
cd EcoSphereThis lets you pull in changes from the main repo later:
git remote add upstream https://github.com/arghya29/EcoSphere.gitnpm installcp .env.example .envFill in .env:
DATABASE_URL— from your Neon project dashboardNEXTAUTH_SECRET— generate withopenssl rand -base64 32NEXTAUTH_URL—http://localhost:3000for local dev- Google OAuth keys are optional — leave blank to skip Google sign-in
npm run db:push
npm run db:seednpm run devOpen http://localhost:3000. You should see the EcoSphere landing page.
Demo login (seeded): demo@ecosphere.dev / EcoSphereDemo123!
app/ — Next.js App Router pages and API routes
components/ — React components (ui/, auth/, shared/, dashboard/, graph/, map/, charts/, upload/, landing/)
lib/ — Core logic: emissions.ts, insights.ts, auth.ts, validations.ts, reports.ts
prisma/ — Schema and seed data
types/ — Shared TypeScript types
hooks/ — Custom React hooks
__tests__/ — Jest unit tests and Playwright E2E tests
public/templates/ — Downloadable CSV template files
docs/ — Additional documentation
For detailed documentation, see:
- Architecture Overview — Data flow, tech stack, and key decisions
- API Reference — All API route documentation with request/response examples
- Component Reference — UI component catalog and usage patterns
- Setup Guide — Detailed setup instructions and troubleshooting
- Look for issues labeled
good first issueif you're new — these are scoped small and have clear acceptance criteria. - If you want to work on something not listed, open an issue first to discuss it before writing code. This avoids duplicate work and ensures your effort lands as a merged PR.
Comment on the issue saying you'd like to work on it. A maintainer will assign it to you. Do not submit a PR for an issue that's already assigned to someone else.
Always branch off from dev (the default branch). Use this naming convention:
| Type | Format | Example |
|---|---|---|
| New feature | feat/short-description |
feat/dark-mode-toggle |
| Bug fix | fix/short-description |
fix/map-marker-overlap |
| Documentation | docs/short-description |
docs/update-setup-guide |
| Tests | test/short-description |
test/insights-edge-cases |
| Refactor | refactor/short-description |
refactor/emissions-engine |
| UI/styling | ui/short-description |
ui/mobile-nav-polish |
git checkout dev
git pull upstream dev
git checkout -b feat/your-feature-nameNote: The default branch is
dev, notmain. All contributor PRs should targetdev. Themainbranch reflects the latest stable production release and is only updated by maintainers.
Follow the Conventional Commits format:
type(scope): short description
Optional longer body explaining what and why (not how).
Types: feat, fix, docs, style, refactor, test, chore
Examples:
feat(insights): add carbon intensity per revenue metric
fix(map): prevent marker overlap when coordinates are identical
docs(contributing): clarify branch naming conventions
test(emissions): add edge cases for zero-amount activities
Keep the first line under 72 characters. Use the imperative mood ("add", not "added" or "adds").
-
Make sure your branch is up to date with
devbefore opening a PR:git fetch upstream git rebase upstream/dev
-
Run the full test suite before submitting:
npm test npm run lintFix any failures before opening the PR — PRs that fail CI won't be reviewed.
-
Open the PR against
devon the original repo (notmain). -
Fill in the PR template completely:
- What does this PR do?
- Which issue does it close? (use
Closes #123) - Screenshots/screen recordings for any UI changes
- Any breaking changes or migration notes
-
Keep PRs small and focused. One PR = one logical change. Large PRs that touch many unrelated files are hard to review and often get deprioritized.
-
A maintainer will review your PR within a few days. You may be asked to make changes — this is normal and not a rejection. Update your branch and push; the PR will update automatically.
-
Once approved, a maintainer will merge your PR. Do not merge your own PRs.
Every PR is automatically reviewed by CodeRabbit, an AI code reviewer. Within a few minutes of opening a PR you'll see a comment from coderabbitai[bot] with:
- A plain-English summary of what your PR does
- A walkthrough of every changed file
- Inline comments on specific lines flagging issues or suggesting improvements
- Pre-merge checks (e.g. missing tests, accessibility issues, type safety)
What to do with CodeRabbit feedback:
- Address any
❌(failing) checks before asking for a human review ⚠️warnings are suggestions — use your judgement- You can reply directly to CodeRabbit's comments to ask it to explain something or re-check after a fix
- Type
@coderabbitai helpin a comment to see all available commands
CodeRabbit does not replace human review — a maintainer will still look at your PR — but addressing its feedback first means faster human reviews.
If you're just getting started, here are the kinds of things typically labeled good first issue:
- Adding a new emission factor category (e.g. a new country's electricity grid factor)
- Improving accessibility of an existing component (better ARIA labels, keyboard nav)
- Adding a missing unit test for an edge case in
lib/emissions.tsorlib/insights.ts - Fixing a UI inconsistency on mobile
- Improving error messages shown to the user when CSV upload fails
- Adding a new insight rule in
lib/insights.ts - Adding a new chart type to the analysis page
- All new code must be TypeScript. No plain
.jsfiles inapp/,components/, orlib/. - Avoid
anytypes except where genuinely necessary. Add a comment explaining why if you do use it. - Run
npx tsc --noEmitto check for type errors before submitting.
- Follow the existing component patterns — shadcn/ui-style primitives in
components/ui/, page-specific components closer to the page. - Client components (
'use client') only where actually needed — prefer server components for anything that doesn't need interactivity or browser APIs. - All icons need
aria-hidden="true"when decorative, oraria-labelwhen they're the only content in a button.
- The app supports dark and light mode. If your change touches colours or backgrounds, test both themes.
- Use CSS variables (
hsl(var(--background)),hsl(var(--foreground))) rather than hardcoded colour values so both themes work correctly. - Never use
dark:Tailwind classes inline — use the CSS variable tokens defined inapp/globals.css.
- Changes to
lib/emissions.tsorlib/insights.tsmust come with corresponding test updates in__tests__/unit/. - Do not change existing emission factor values without a citation — every factor needs a source.
- Use Tailwind utility classes only. No inline styles, no external CSS files (except
app/globals.css). - Responsive first — test at 320px width and desktop. No horizontal scroll at 320px.
- New features should have at least one unit test if they touch calculation or business logic.
- Bug fixes should have a test that would have caught the bug.
- Run
npm testbefore submitting a PR. All tests must pass.
- Open a GitHub Discussion for general questions or "how should I approach this?" conversations.
- Comment on the issue you're working on if you get stuck mid-implementation.
- Do not open a new issue just to ask a question — use Discussions for that.
All contributors are listed in the project's GitHub contributor graph.
- Level 1 (easy): documentation, small UI fixes, new unit tests
- Level 2 (medium): new features, bug fixes with tests, new insight rules
- Level 3 (hard): architectural changes, new pages, performance improvements
Thank you for helping make supply-chain carbon data more accessible. 🌍