Skip to content

fac29/gaf-back

Repository files navigation

GAF Backend

TypeScript Node.js License

An ecommerce web app. Built with typescript, node deployed on AWS. Tested with POSTMAN.

Table of Contents

Functionality

  • See all products
  • Search products
  • Add to cart

Installation

  1. Clone the repository:

    git clone
    cd
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    Create a .env file in the root directory and add your configuration settings.

    PORT=3000
    DB_FILE=gaf_database.sqlite
  4. Create and Seed the database:

    node database/db.js
    node database/seed.js
    

Usage

Running the Server

To start the server, use the following command:

npm start

The server will run on the port specified in the .env file. If no port is specified, it will default to 3000.

API Endpoints

Products:

  • GET /products - Retrieve a list of all available products
  • GET /products/random - Retrieve details of a specific product with ID 123
  • GET /products/ - Search (Request body: ['iphone']) Hardcoded at present.
  • GET /product/123 - Retrieve details of a specific product with ID 123
  • DELETE /product/123 - Deletes a specific product with ID 123

DB Diagram

Example Image

About

Backend of FAC Project 2 (Weeks 4-6)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published