Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

allisonvp/api-store

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Store REST API with Node.js and Express

This project consists of building an online store, where the user can initially see all the products, can search for them, sort them in ascending or descending order and can also filter the products by category. In addition, the user can see the products with the discount applied in case they have a discount.

It is requested to build separately Backend (REST API) and Frontend (application that consumes it).

The REST API was developed with Node.js and Express. The REST API connects and makes SQL queries to a MySQL database deployed in AWS RDS. This database has two tables: products and categories. To request the data, the REST API was developed with the following endpoints that can be viewed and executed in Postman: API Documentation.

Built with

Node.js - JavaScript environment
Express - The web framework used
Vercel - Cloud Application Platform for deploy
MySQL - Relational database

API Documentation

Get products

  GET https://api-store-seven.vercel.app/api/products?ordering=desc&category=5
Params Type Description
ordering string Optional can be asc or desc
search string Optional filter by name
category integer Optional filter by category

List products. You can use query params to filter them by category, ordering and search.

Get categories

  GET https://api-store-seven.vercel.app/api/categories

List categories.

Run Locally

Click on Code

Copy the repository URL.

Open Git Bash and change the current working directory to the location where you want to clone the project.

  git clone https://github.com/allisonvp/api-store.git

Go to the project directory

  cd api-store/

Open the project and create the .env file. You will need to add the following environment variables to your .env file.

Install dependencies

  npm install

Start the server

  npm run start

Open a web browser and access to the localhost API endpoint with the port 3000: http://localhost:3000/api/products.

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

DB_NAME

DB_HOST

DB_USER

DB_PASSWORD

Releases

No releases published

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.