E-commerce application REST API

E-commerce API Project

Max’s Sporting Goods Store

Here is my API for the E-commerce API project. I decided to base the store API on a sporting goods store as sports is a passion of mine. Although it was a challenging project, I loved researching on my own to solve issues and finding new ways to create an API. Finally, it was fulfilling to create the documentation following OpenAPI 3.0 specs and see the project deployed successfully with Heroku. As always I would love to hear your feedback and how to improve my code.

Heroku deployment

https://max-ecommerce-api.herokuapp.com/

Github link

1 Like

Here is my take on this project. I’ve used passport with bcrypt for login and register, i’ve also tried using crypto, but to no avail, actually I’ve wasted a lot of time trying to use it. I’ve also written tests for most of routes, excluding the ones for auth, didn’t know how to write test for it. Had a lot of issues on the way, but happily I was able to solve most of them. Documentation is still incomplete and I think of adding some more routes too.

Heroku : Heroku swagger docs
Github: Github

On first look the project seemed impossible , but i read the comments and moved on with the lessons until Common Attacks on Web Applications that helped a bit and also watched some extra videos.

Building REST API This one was particullarry helpful

I just missed one part in codecademys lessons which is putting everything together.
Took me 1 extra week for learning and after that it was 4-5 days to put it together hopefully it works as intended

Heroku :
Github :

Alright, finished this part of the project. My project is a streetwear-focused clothing store. I actually did it in tandem with the client side of the E-Commerce, but haven’t got it all deployed yet. Should get that done, hopefully soon. Once I do, I’ll post the link to the deployed site on the E-Commerce Client project forum.

Github Link (pertinent code for this project is in the server folder).

I’ve got here with this issue too, and now I am back to share my finding-out… this is the back-end, so we are not supposed to see a front-end, to check the endpoints, if you write for example http://localhost:yourport/products and you see , that means you are accessing the products database, but since the database is empty you won’t get info here, so just go to you products table and add some content to the table, when you run again you are supposed to see those products, you can do the same for example with users, add a user in the table and then run http://localhost:yourport/users/1 (the 1 is the automatic id generated by the table, if you create more than one user you can write another number).
So that was the end, now going to the beginning: 1. run npm install (I am using nvm to run node 14 and npm 6 versions to avoid errors, if you have vulnerabilities try solving them with npm audit fix, don’t use --force, because it may break something), 2. connect the database and be sure the server is running (I am using in VSCode, MySQL from Weijan Chen extension), 3. rename the file example.env with .env and change the information in this file with the actual information on your database and server (PGUSER=‘postgres’, PGPASSWORD=‘postgres’, PGPORT=5432, my examples) 4.run npm run create-db, 5. run npm run start and if you get the wonderful answer “Server listening on PORT…” go to the beginning of this answer…
Finally you can use postman to check also the responses to GETs an POSTs, etc.
Hopefully it is useful for someone…

Please give me your feedback. Thank you.

Deployed on render.com