GithubHelp home page GithubHelp logo

hhy5277 / rap2-delos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thx/rap2-delos

0.0 1.0 0.0 274 KB

阿里妈妈前端团队出品的开源接口管理工具RAP第二代

Home Page: http://rap2.taobao.org

License: MIT License

Dockerfile 0.11% HTML 1.21% JavaScript 19.01% TypeScript 78.30% AppleScript 1.36%

rap2-delos's Introduction

RAP2-DELOS 开源社区版本 (后端API服务器)

Build Status

RAP2是在RAP1基础上重做的新项目,它包含两个组件(对应两个Github Repository)。

  • rap2-delos: 后端数据API服务器,基于Koa + MySQLlink
  • rap2-dolores: 前端静态资源,基于React link

Resources

部署

环境要求

  • Node.js 8.9.4+
  • MySQL 5.7+
  • Redis 4.0+

开发模式

安装MySQL和Redis服务器

请自行查找搭建方法,mysql/redis配置在config.*.ts文件中,在不修改任何配置的情况下, redis会通过默认端口 + 本机即可正常访问,确保redis-server打开即可。

启动redis-server

redis-server

后台执行可以使用nohup或pm2,这里推荐使用pm2,下面命令会安装pm2,并通过pm2来启动redis缓存服务

npm install -g pm2
npm run start:redis

先创建创建数据库

mysql -e 'CREATE DATABASE IF NOT EXISTS RAP2_DELOS_APP DEFAULT CHARSET utf8 COLLATE utf8_general_ci'

初始化

npm install

confirm configurations in /config/config.dev.js (used in development mode),确认/config/config.dev.js中的配置(.dev.js后缀表示用于开发模式)。

安装 && TypeScript编译

npm install -g typescript
npm run build

初始化数据库表

npm run create-db

执行mocha测试用例和js代码规范检查

npm run check

启动开发模式的服务器 监视并在发生代码变更时自动重启

npm run dev

生产模式

# 1. 修改/config/config.prod.js中的服务器配置
# 2. 启动生产模式服务器
npm start

Dockerfile (本地源码通过docker运行)

# 1. 安装docker
# 2. 修改docker-compose.xml中的配置。默认使用mysql和redis的镜像。可修改为自己的配置
# 3. 通过源码运行。
        docker-compose up -d
# 4. 第一次运行需要手动初始化mysql数据库。分别执行以下命令:
        docker exec -it rap2-delos sh
    // 登录成功以后执行:
        node scripts/init
    // 执行完毕后退出
        exit
    // 如果仍然有问题,重新启动
        docker-compose down
    // 重新运行
        docker-compose up -d

Author

Tech Arch

  • 前端架构(rap2-dolores)
    • React / Redux / Saga / Router
    • Mock.js
    • SASS / Bootstrap 4 beta
    • server: nginx
  • 后端架构(rap2-delos)
    • Koa
    • Sequelize
    • MySQL
    • Server
    • server: node

rap2-delos's People

Contributors

bosn avatar charmfocus avatar codefine avatar ganl avatar sea13502 avatar shangwenhe avatar stpice avatar zhcsyncer 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.