Thank you for your interest in contributing to ShelfTrade! This guide will help you get started.
- Node.js 20 (see
.nvmrc) — use nvm to install - npm (comes with Node.js)
# Clone the repository
git clone https://github.com/your-org/shelftrade.git
cd shelftrade
# Install dependencies
npm install
# Start the development server
npm run devThe app will be available at http://localhost:3000. A local SQLite database (shelftrade.db) is created automatically on first run with seed data.
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Production build |
npm run start |
Start production server |
npm run lint |
Run ESLint |
npm run typecheck |
Run TypeScript type checker |
npm run format |
Format code with Prettier |
npm run format:check |
Check formatting without modifying files |
-
Ensure your code passes all checks:
npm run lint npm run typecheck npm run format:check npm run build
-
Write clear, descriptive commit messages.
-
Keep PRs focused — one feature or fix per PR.
src/
├── app/ # Next.js App Router pages and API routes
│ ├── api/ # REST API endpoints
│ ├── dashboard/ # Private user dashboard
│ ├── games/[id]/ # Game market detail pages
│ ├── listings/ # Listing detail + create wizard
│ ├── marketplace/ # Browse & search listings
│ ├── profile/[username]/ # Public user profiles
│ └── trade/ # Trade matching
├── components/ # React components
│ └── listing-create/ # Multi-step listing wizard steps
├── hooks/ # Custom React hooks
└── lib/ # Shared logic
├── db/ # Database connection, repositories, mappers
├── api.ts # API response helpers and param parsers
├── seed.ts # Seed data for development
├── types.ts # TypeScript interfaces and constants
└── utils.ts # Formatting and utility functions
- TypeScript strict mode — no
anytypes, no unsafe casts - Parameterized SQL — always use
?or@namebindings, never string interpolation - API responses — use
jsonSuccess()/jsonError()from@/lib/apifor consistent{data, error}shape - Input validation — use
parseEnum(),parseNumber(),parseEnumArray()from@/lib/api - Component files — PascalCase filenames, one component per file
- Tailwind CSS — use semantic color tokens defined in
tailwind.config.ts
When filing an issue, please include:
- Steps to reproduce
- Expected vs actual behavior
- Node.js version and OS
- Browser (if UI-related)