bhanukaManesha / ilume-skills-assesment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Backend Skill Assesment

πŸ‘‹ Codebase for the Ilume backend skill assesment test

🚚 The link to the heroku deployment : https://ilume-backend-service.herokuapp.com/

🧐 Assumptions

  • Each dog will only have one owner
  • Each dog will be one breed
  • DOB cannot be in the future
  • DOB can be any date in the past

🌈 How to run the code

  1. Install nodejs on your system.
  2. Run npm install to install dependencies.
  3. Take a copy of .env.example and rename it to .env. Update the MONGO_URI and TOKEN_KEY with a mongo db uri and a random string respectively.
  4. Run npm start to run the server. The server should start on http://localhost;8080. You should see a Welcome πŸ™Œ on the home route. You should be able to test all the api's from the postman collection below.

πŸ’½ How to seed the database

  1. After setting up the project, run ts-node src/seed/breed.ts to seed the Breed types into the database. Only do this, if the database is a setup fresh.

πŸš€ API Documentation

The api documentation is hosted here as a postman collection.

drawing

πŸ› Known Bugs

  • No email and password validation done, only checking whether they are not null.
  • For some errors, the apis return a generic error message such as Unable to <task>. Please check logs. These can be better wrapped into pre-defined error categories.
  • Instead of deleteing the dog, we can have another field to specify if the dog is active or not. This allows us to safely delete the dog without dependency issues in the future.

About


Languages

Language:TypeScript 99.6%Language:Shell 0.4%