GithubHelp home page GithubHelp logo

nguyenhoaiphuoc1995 / rest-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from misostack/rest-api

0.0 0.0 0.0 301 KB

REST API Blueprint with Clean Architecture

JavaScript 4.07% TypeScript 94.96% Dockerfile 0.97%

rest-api's Introduction

REST API Blueprint

Architecture

Clean Architecture

document

Design Pattern

  • Factory
  • DIP : Dependency inversion principle

Rules

  • SOLID

Layers

Application: api Domain : entities, contracts, services, factories, repositories (abstract) Persistence: repositories, orm entities Config: configuration class Shared: shared functions Tools: other tools

Getting start

  • Configuration: copy and replace related env
cp .env.sample .env

Production

touch .env.production
echo "DATABASE_URL=mysql://root:123456@db/rest_api" > .env.production

DB Migration

yarn typeorm migration:generate -n CreateUserTable
yarn typeorm migration:run
yarn typeorm migration:show

Docker

docker-compose -f ./docker-compose.dev.yml up
docker container exec -it rest-api-restapi-1 sh
yarn typeorm migration:show
yarn typeorm migration:run
docker-compose up -d
docker container exec -it rest-api-restapi-1 sh

docker-compose down
docker rmi $(docker images -aq --filter=reference='restapi')
docker volume rm rest-api_db_data

MYSQL

docker run --name jsguru-db -p 3307:3306 -e MYSQL_ROOT_PASSWORD=123456 -e MYSQL_DATABASE=rest-api -e MYSQL_USER=jsguru -e MYSQL_PASSWORD=123456 mysql:8.0.28 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci

rest-api's People

Contributors

misostack 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.