This project is a simple TODO application built with NestJS, Prisma, and MySQL. It includes basic authentication and a TODO management system.
You are tasked with reviewing, improving, and fixing this codebase. This application intentionally contains poor practices, missing features, and bugs. Your goal is to refactor and enhance the project while following modern backend development best practices.
Your submission must include the following:
- Refactor the codebase to follow clean architecture and modular design principles.
- Ensure proper error handling (e.g., try-catch blocks, meaningful HTTP response codes).
- Implement middleware for authentication and JWT validation.
- Use DTOs and validation pipes for incoming requests.
- Avoid hardcoded values (e.g.,
.env
for sensitive information). - Improve database queries to handle edge cases and optimize performance.
- Add meaningful comments where necessary.
- Write unit tests for critical services (e.g., authentication, TODO management).
- Write at least one integration test to validate the API behavior end-to-end.
- Create documentation for the APIs using Postman and put the exported collection as json in the
documentation/api
folder. - Provide instructions for setting up and running the project locally.
- Handle edge cases such as invalid user input, empty TODO lists, invalid authentication tokens, etc.
Ensure you have the following tools installed:
- Node.js (v16 or higher)
- MySQL (local instance or Docker)
- npm
- Git
- Clone the repository:
git clone https://github.com/rafayeljamalyandev/Interview-ToDo-App.git
- Install dependencies:
npm install
- Set up the .env file:
DATABASE_URL="mysql://root:password@localhost:3306/todoapp"
JWT_SECRET="some_secret_key"
- Apply Prisma migrations:
npx prisma migrate dev
- Start the application:
npm run start:dev
- Create a Fork • Fork this repository to your personal GitHub account.
- Create a Feature Branch • Create a new branch for your work:
git checkout -b candidate-improvements
- Make Changes • Commit your improvements and push them to your branch.
- Open a Merge Request (MR) • Submit a pull request (PR) from your feature branch to the main branch of this repository.
- Provide a Summary • In your MR description, include: • A brief overview of the changes. • Key improvements and fixes. • Instructions for testing your changes.
Your submission will be evaluated based on the following:
- Code quality and readability.
- Adherence to best practices.
- Error handling and edge case management.
- Test coverage and quality of tests.
- Proper use of Prisma and database handling.
- Documentation and clarity of instructions.
Tips • Focus on making the code modular and maintainable. • Write meaningful commit messages. • Don’t overcomplicate — aim for clarity and maintainability.
Good luck! 🚀
Let me know if you need further customization for the README.md
file or assistance!