To develop the backend of the application I used Nodejs and Expressjs framework to develop the REST apis.
For database I used MongoDB.
I used cloudinary for file storage.(To store images in cloud.)
I created 2 routes.
Route 1: http://localhost:4000/api/v1/inventory/grocery/addItem This is a POST route that is used to add item into the database. It takes name, description, quantity and a image file as input from frontend form.
Route 2: http://localhost:4000/api/v1/inventory/grocery/all This is a GET route that is used to get all the items from the database and send it in json format to the frontend.
-
Perform npm i command inside the api folder which will download the node_modules folder for the api.
-
Then inside the api repository type npm run dev (for development) or npm run start.
-
Two endpoints: i. POST endoint: http://localhost:4000/api/v1/inventory/grocery/addItem
ii. GET endpoint: http://localhost:4000/api/v1/inventory/grocery/all
To develop the frontend of the application I have used ReactJs for the frontend library and Tailwind CSS for styling.
-
Inside the client repository type npm i to downlaod the node_modules folder for the client.
-
Inside the client repository type npm run dev.
-
Frontend url: http://localhost:5173.