项目作者: wwwenjie

项目描述 :
Back end of Movie Paradise
高级语言: TypeScript
项目地址: git://github.com/wwwenjie/Movie-Paradise-Koa.git
创建时间: 2020-05-05T09:58:54Z
项目社区:https://github.com/wwwenjie/Movie-Paradise-Koa

开源协议:GNU General Public License v3.0

下载


Movie Paradise Koa

warning: this repo is deprecated, move to Movie Paradise to check latest update

Back end of Movie Paradise

Introduction

Movie Paradise Koa is a RESTful style back end built by Koa and TypeORM.
You can visit online Swagger API Doc

Features

  • TypeScript
  • RESTful
  • Swagger
  • MySQL and MongoDB

Development

You may need to set up your database first, set in src/config/config.json, you can also create config.local.json. By default, program will load config.local.json if it exsits. Trun sync on and program will create data structure. Note: sync will drop all the data exist in the database, make sure trun it off after structure is created.

  1. # clone this repo
  2. > git clone https://github.com/wwwenjie/Movie-Paradise-Koa.git
  3. # install the dependencies
  4. > yarn
  5. # run with ts-node
  6. > yarn serve

Structure

  1. __tests__ / unit test
  2. config / config
  3. controller / request and response
  4. core / middleware and initialize operation
  5. entity / entity
  6. error / global error handle
  7. service / database operation
  8. util / utils
  9. app.ts / startup script

Deploying

This project is written in TypeScript, so you need to compile to JavaScript and run with node.
Here is an example of update and deploy shell.

  1. # update code
  2. > git pull
  3. # kill node, here port is 3000, change it to the port node used
  4. > kill $(lsof -i:3000 -t)
  5. # install new dependencies
  6. > yarn
  7. # compile to JavaScript
  8. > yarn build
  9. # copy ./src/config.local.json to dist
  10. > cp src/config/config.local.json dist/config/config.local.json
  11. # run under nohup, the console log in ./nohup.out, logger in ./log
  12. > nohup node dist/app.js &

Contributing

Welcome to report bug or add new features. You can know what we are going to do in Projects