Thanks for your interest in contributing! This guide covers everything you need to get started.
- Node.js 24+
- Docker (optional, for container testing)
# Clone the repo
git clone https://github.com/312-dev/scrolly.git
cd scrolly
# Install dependencies
npm install
# Copy environment template
cp .env.example .env
# Edit .env with your values
# Start dev server
npm run devWe use ESLint for linting and Prettier for formatting. Both run automatically on staged files via Husky pre-commit hooks.
npm run lint # Run ESLint
npm run lint:strict # Lint with zero warnings allowed
npm run format # Format with Prettier
npm run format:check # Check formatting without writingnpm run type-check # Run svelte-check + TypeScriptnpm run test # Run unit tests
npm run test:watch # Watch mode
npm run test:coverage # With coverage reportHusky runs automatically:
- Pre-commit:
lint-staged(ESLint fix + Prettier on staged.ts/.svelte/.cssfiles) - Pre-push: Type check + production build
Use descriptive prefixes:
feature/*— New featuresupdate/*— Enhancements, refactors, dependency updatesfix/*— Bug fixes
Follow Conventional Commits:
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only |
style |
Formatting, no code change |
refactor |
Code restructuring |
test |
Adding/updating tests |
chore |
Build, CI, tooling |
deps |
Dependency updates |
Example: feat: add comment threading to video posts
- Create a branch from
mainusing the naming convention above - Make your changes and ensure all checks pass locally:
npm run lint:strict npm run format:check npm run type-check npm run test npm run build - Push your branch and open a PR against
main - Fill out the PR template completely
- Wait for CI and security checks to pass
- Squash merge after approval
All PRs must pass:
- CI — Lint, format, type check, tests, build
- Security — CodeQL, Gitleaks, npm audit, Trivy, OWASP ZAP
- Strict mode enabled
- No
anytypes (warn level — work toward eliminating) - Use
$state,$props,$effect,$derived(Svelte 5 runes) - Avoid legacy
let/export letpatterns
- Scoped
<style>blocks — no global CSS beyond body resets - Use CSS custom properties from
docs/design-guidelines.md - Mobile-first: design for 375px, scale up
- Max 500 lines per file (warning threshold)
- All endpoints return JSON
- Use Drizzle ORM for all database queries
- Place server-only code in
src/lib/server/
src/
├── routes/ # SvelteKit file-based routing
│ ├── (app)/ # Authenticated route group
│ └── api/ # REST API endpoints
├── lib/
│ ├── components/ # Reusable Svelte components
│ ├── server/ # Server-only code (db, sms, auth)
│ └── stores/ # Client state stores
docs/ # Design & planning docs
static/ # PWA manifest, icons
data/ # Runtime SQLite + videos (gitignored)
By contributing, you agree that your contributions will be licensed under the MIT License.