APPROACH TO SOLUTION
- Spinned up a simple Express server.
- Used SQLite library to handle database management.
- Created a server.js file to delegate database initialization.
- Used a separate file for routes to handle all CRUD operations on /todos route.
POSTMAN Documentation for the API - https://documenter.getpostman.com/view/11144274/2s9YBxZbXq
CHALLENGES FACED
- Since this is my second or third time working with TypeScript, I did have some problems getting used to the strict typing and different style of exporting and importing modules.
- Writing POSTMAN documentation was something new to me, but a helpful guide was able to guide me through all steps with relative ease.
FEATURES I WOULD HAVE ADDED IF THERE WAS MORE TIME
- Would have worked on request query management to efficiently handle chunks of large data (For example: /todos?limit=50 which would generate less responses, etc.)
- Worked on some form of basic authentication to help protect the routes from unauthorized access.
- Would have split the code into better chunks to make the code prettier.
STEPS TO SETUP THE PROJECT
- Use
npm install
to install all required dependencies. - Once done, use
npm start
on the terminal to compile TS and run the project.