Skip to content

MinhhTien/ShopP

 
 

Repository files navigation

ShopP Project

Author:

  • Le Thanh Long - Project Leader
  • Pham Cong Minh - Front-End Leader
  • Vo Minh Tien - Back-End Leader
  • Thai Thi Ngoc Kim - Front-End Developer
  • Bui Phan Long - Front-End Developer
  • Nguyen Gia Linh - Back-End Developer
  • Tran Van Tho - Back-End Developer

Created day: 04/08/2022

Build with Docker

docker compose --env-file .env.deploy build
docker compose --env-file .env.deploy up -d

How It Work?

This is a Typescript web application server powered by Express framework.

  • First copy the .env.local to .env at the same folder (don't remove the .env.local).

  • Create a MySQL database and specify the configuration in the .env file.

  • Run the project by the following terminal command:

npm install
npm run build
npm run init-database
npm start

Prerequisites

Organization

The root dir of the project is the src folder which has the following structure:

  • index.ts - the main file to be started.
  • data.ts - contains the data source of the project.
  • utils - contains utilies of the project.
  • routes - where to specify routes.
  • middlewares - place to push middlewares.
  • entities - contains the specifications of models (TypeOrm Entity).
  • migrations - contains the migrations.
  • models - contains the models.

Outside the src dir, we also want to specify the .env which contains the environment variables.

NOTE:

  • Always have the .env up-to-dated with the .env.local.
  • Update the .env.local (if necessary) before pushing again.

CLI

npm run <cli>
  • build - build the project.
  • start - start the project.
  • init-database - synchronize the database with the entities.
  • generate-migration - generate migration files with schema changes.
  • run-migration - execute all pending migrations.
  • revert-migration - revert the changes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%