A NestJS-based API that celebrates the extraordinary qualities of everyday team members by tracking their superpowers and humility scores.
- Add new superheroes with their unique powers and humility scores
- Fetch a sorted list of superheroes based on their humility
- Input validation and error handling
- Pagination support
- Request logging with Morgan
- NestJS
- TypeScript
- Jest for testing
- Morgan for logging
- Class Validator
- Node.js
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd eJam-test-assignment- Install dependencies:
yarn install- Start the development server:
yarn start:devThe API will be available at http://localhost:3000.
POST /superheroesRequest body:
{
"name": "The Listener",
"superpower": "Understanding complex problems",
"humilityScore": 9
}GET /superheroes?page=1&limit=5Response:
{
"data": [
{
"id": "uuid",
"name": "The Listener",
"superpower": "Understanding complex problems",
"humilityScore": 9
}
],
"meta": {
"total": 1,
"page": 1,
"lastPage": 1,
"limit": 5
}
}# Unit tests
yarn testHere's how I envision collaborating with teammates on this project:
-
Code Review Process
- Regular pull request reviews
- Pair programming sessions for complex features
- Documentation updates for any new endpoints
-
Potential Areas for Collaboration
- Implementing additional superhero attributes
- Adding role-based access control
- Creating team-based superhero groups
-
Best Practices
- Following NestJS best practices and patterns
- Maintaining consistent code style
- Regular updates to documentation
-
Technical Improvements
- Implement proper database storage (PostgreSQL/MongoDB)
- Add authentication and authorization
- Create detailed API documentation using Swagger
- Add more comprehensive error handling
- Add rate limiting for API endpoints
-
Feature Enhancements
- Add superhero categories/teams
- Implement a rating system for superpowers
- Add historical tracking of humility scores
- Create superhero achievement tracking
- Add image upload for superhero profiles
-
Testing & Quality
- Add more integration tests
- Implement load testing
- Set up CI/CD pipeline
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request