# Profile Service Intro

Recently I worked on a backend which is known as a profile service. It is **NodeJs** backend based upon **express js**. This service gives us 3 endpoints that are **health**, **profile** and **verification**. I have used **yarn package manager** to make it. Yarn helps in keeping my packages global so that I can use it afterwards.

![nodejs-light.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651524448866/4E4QZ8nDR.png align="left")

I deployed this service on **Heroku**. Health endpoint tells you whether the service is running or not. Profile endpoint gives you data about the person whom this service belongs to, to verify and keep updating the details. Verification endpoint is used to confirm the secret chain code provided to a particular user and hence verify a user. This service is a part of a bigger service in RDS.

![heroku.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651524560636/VmMO_Uqbk.png align="left")

I have implemented **testing** using **mocha and chai** in js. This helps me to check either my service is working or not without making calls to deployment. Also it helps me assess all the edge cases I could think of and make my service more reliable. I also added **Joi validation** so that if body of any request is not correct then it will not call the route make our calls more stable.

![mocha-chai.webp](https://cdn.hashnode.com/res/hashnode/image/upload/v1651524599428/GWMOytkpR.webp align="left")

