Skip to Content
Contributing

Source: Jolli-sample-repos/url-shortener  Last Updated: 4/8/2026


Contributing

Guidelines for contributing to the URL shortener project.

Development Workflow

  1. Make changes in backend/src/ or frontend/
  2. Test locally - Backend auto-reloads with nodemon
  3. Build - npm run build (backend only)
  4. Commit - Standard git workflow

Your First Contribution

Smallest possible change to get familiar:

  1. Add a new field to health check response in backend/src/index.ts:
app.get('/health', (req, res) => { res.json({ status: 'healthy', timestamp: new Date().toISOString(), version: '1.0.0' // Add this line }); });
  1. Test: curl http://localhost:3001/health
  2. Verify new version field appears in response

Adding API Endpoints

Create endpoint in backend/src/routes.ts:

/** * @openapi * /api/v1/your-endpoint: * get: * summary: Your endpoint description */ router.get('/your-endpoint', (req, res) => { // Implementation });

OpenAPI docs auto-generate from JSDoc comments.

Code Style

  • TypeScript: Strict mode enabled
  • Formatting: Follow existing patterns
  • Validation: Use Zod schemas for input validation
  • Errors: Return proper HTTP status codes (400, 404, 410, 500)

File Organization

  • models.ts - TypeScript interfaces
  • storage.ts - Data operations
  • validator.ts - Zod schemas
  • routes.ts - API endpoints
  • generator.ts - Short code generation

Testing

No automated tests currently. Manual testing:

  1. Start backend + frontend
  2. Test via frontend UI
  3. Test via API with curl/Postman