Contributing
How to contribute code, docs, and feedback to SubsTrack.
Contributing
SubsTrack is open source. Contributions to code, documentation, and design are welcome.
Getting started
- Fork the repository and clone your fork.
- Install dependencies:
npm install. - Copy
.env.exampleto.env.localand set at leastMONGODB_URIandNEXTAUTH_SECRET. - Run MongoDB locally (e.g. Docker:
docker run -d -p 27017:27017 mongo:7). - Run the app:
npm run dev. - Open http://localhost:3000.
Project structure
src/app/— Next.js App Router (pages, API routes).src/lib/— Core logic (db, auth, email, telegram, billing, notifications).src/models/— Mongoose models.src/jobs/— Cron job definitions.docs/— Architecture and API design (source of truth for the plan).content/docs/— User and technical docs (rendered at/docs).
See AGENTS.md in the repo for a fuller map and conventions.
Conventions
- Comments — Start with a lowercase letter; no trailing period.
- TypeScript — Strict mode; prefer
const; use Zod for request validation. - API — Return
{ data }on success,{ error: { code, message } }on failure. - Commits — Clear, concise messages. Prefer “feat: …”, “fix: …”, “docs: …”.
Pull requests
- Create a branch from
main(e.g.feat/telegram-linkorfix/reminder-timezone). - Make your changes; keep PRs focused.
- Ensure the app builds:
npm run build. - Run the linter:
npm run lint. - Open a PR with a short description and, if relevant, a link to an issue.
- Address review feedback; maintainers will merge when ready.
Documentation
- User-facing docs — Edit or add Markdown under
content/docs/user-guide/orcontent/docs/technical/. They are rendered at/docson the same site. - Technical design — Update
docs/PLAN.md,docs/api-design.md, ordocs/data-models.mdin the repo when you change architecture or APIs. - README — Update the main README if you change setup, env, or deployment.
Reporting issues
Use the repository’s issue tracker. Include:
- SubsTrack version or commit.
- What you did, what you expected, what happened.
- Relevant logs or screenshots (redact secrets).
Feature ideas
Open an issue with the “enhancement” or “feature” label. Describe the use case and, if you have one, a proposed approach. Discussion there helps before a PR.
Code of conduct
Be respectful and constructive. The project maintainers reserve the right to moderate discussions and PRs.
Thank you for contributing.