Task for recruitment process at Ejam
Create a simple API that lets users:
- Add a new superhero, specifying their name, superpower, and a "humility score" showing how humble they are.
- Fetch the list of superheroes, ordered by their humility score in descending order.
- Framework: NestJS
- Database: In-memory database
- Endpoints:
POST /superheroes
: Add a new superhero (name, superpower, and humility score required).GET /superheroes
: Fetch the list of superheroes sorted by humility score.
- Framework: React
- Features:
- Add superheroes
- See the sorted list in real-time
- Zod validation for humility
- Framework: NestJS
- Files:
src/app.controller.ts
: Handles the API endpoints.src/app.service.ts
: Contains the business logic.src/superhero.model.ts
: Defines the data models.
- Framework: React
- UI Components: Radix
- Files:
src/App.tsx
: Main application component.src/components/SuperheroesCard.tsx
: Displays the list of superheroes.src/components/AddSuperheroCard.tsx
: Form to add a new superhero.
This will install dependencies for both the client and the server and then launch both apps with one command.
- Navigate to the
root
directory containingclient
andserver
directories. - Install dependencies:
npm install
- Start the server:
npm run dev
If I had more time, I would:
- Implement more comprehensive validation and error handling.
- Add more unit and integration tests.
- Improve the UI/UX of the frontend application.
- Implement a persistent database instead of an in-memory database.
- Add authentication and authorization.
- Host the application.
To collaborate with a teammate, I would:
- Use Git for version control and create feature branches for new tasks.
- Conduct code reviews to ensure code quality and share knowledge.
- Hold regular stand-up meetings to discuss progress and blockers.
- Use a project management tool like Jira or Trello to track tasks and progress.
This project demonstrates the ability to build a simple yet functional API and frontend application, adhering to best practices and showcasing a collaborative and humble approach to software development.