Giter Site home page Giter Site logo

ts-code-test-frontend's Introduction

Introduction

Create an end-to-end web application that allows the user to read, create and delete a to-do list of duties of any kind. This project is for frontend.

If you are interested in backend project, please refer to the Github Repo.

Prerequisites

(1) Node.js(Version>=16) installed on your operating system.

(2) Backend service and database are ready.

Install Dependencies

npm install

Or

yarn

Running Service Locally

Running with hot reload:

npm run start:dev

Running other environment locally:

Update the database config in .env.qa or .env.preprod and then run the following command:

npm run build
npm run start:qa / npm run start:preprod

Due to the security issue, it's not recommended to run production in local. If you want to run production service, please refer to the next section of the document.

The website will host on http://localhost:3000

Running Service In the Server

It's better to run with Docker container for non-local environment.

Build Docker Image

docker build -f Dockerfile.ENV_NAME -t ts-code-test-frontend:latest .

Run Docker Container

docker run --rm \
    --name ts-code-test-frontend \
    -p 3000:3000 \
    -d \
    ts-code-test-frontend:latest

Alternatively, we could also host frontend project in Object Storage Service for cloud service after building service, such as AWS S3.

Unit Test

If you want to run unit test with jest and @testing-library/react, please run the following command:

npm run test

Running with coverage report.

The result will generate to /coverage folder and then you could check the report in /coverage/lcov-report/index.html

npm run test:cov

ts-code-test-frontend's People

Contributors

llkevin13579 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.