Source: Jolli-sample-repos/url-shortener Last Updated: 4/8/2026
Contributing
Guidelines for contributing to the URL shortener project.
Development Workflow
- Make changes in
backend/src/orfrontend/ - Test locally - Backend auto-reloads with nodemon
- Build -
npm run build(backend only) - Commit - Standard git workflow
Your First Contribution
Smallest possible change to get familiar:
- 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
});
});- Test:
curl http://localhost:3001/health - Verify new
versionfield 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 interfacesstorage.ts- Data operationsvalidator.ts- Zod schemasroutes.ts- API endpointsgenerator.ts- Short code generation
Testing
No automated tests currently. Manual testing:
- Start backend + frontend
- Test via frontend UI
- Test via API with curl/Postman