Skip to content

A fullstack application featuring a Dockerized Node/Typescript REST API connected to a PostgreSQL Database. The frontend is built using Typescript and the Next.js framework for React.

License

Notifications You must be signed in to change notification settings

AnthonyGress/E-Commerce-Fullstack

Repository files navigation

E-Commerce-Fullstack

This fullstack application features a PostgreSQL Database connected to a Dockerized Node/Typescript REST API. The frontend is built using Typescript and the Next.js framework for React.

From the root directory, you can run all commands for both the backend and the frontend.

  • Install npm run install
  • Lint npm run lint
  • Test npm run test
  • Build npm run build
  • Start (Locally) npm run dev

Screenshots

ecommerce-home ecommerce-shop

Backend

Technologies:

  • Node.js
  • Typescript
  • Docker
  • PostgreSQL
  • Express.js

The backend of this application has endpoints to manage products and orders for an ecommerce site. You can Create, Update, Read, and Delete from the PostgreSQL database via the API endpoints. This is intended to be hosted in AWS and follow the architecture outlined below.

Installation

npm install

Tests

npm run test

Usage

The default port for the backend is run on 3001, so running locally, calls should be made to http://localhost:3001/{ENDPOINT} This project assumes the PostgreSQL database is already running and configured correctly.

To create the required database tables, install knex and run the following command

cd ./backend/src/db && knex migrate:up

To get started run:

npm run dev

Environment Variables

Name Default Value Description
DATABASE_HOST localhost database host
DATABASE_PASSWORD N/A password to your database
WHITELIST_ORIGINS N/A list of domains which have access to the API via CORS

Architecture

infrastructure

Database Design

product table

type property
PK uuid id
text name
text description
enum category
text vendor
bigint price
bigint quantity

order table

type property
PK uuid id
bigint amount
enum order_status
text array order_items
text account_id
text tracking_company
text tracking_number

order_items table

type property
PK uuid id
FK(product.id) text product
bigint price
bigint quantity

Frontend

Technologies:

  • Typescript
  • Next.js
  • React
  • NextUI
  • Tailwind CSS

Installation

npm install

Tests

npm run test

Environment Variables

N/A

Usage

The default port for the frontend is on 3000, so running locally, open your browser to http://localhost:3000

To get started run:

npm run dev

About

A fullstack application featuring a Dockerized Node/Typescript REST API connected to a PostgreSQL Database. The frontend is built using Typescript and the Next.js framework for React.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published