Code Monkey home page Code Monkey logo

explorekoa's Introduction

简体中文 | English

Koa2 + Typescript 构建的后端项目,全栈工程师必学(嘘!防止后端人员跑路时,没人写接口的尴尬局面)!!!

前端项目地址:https://github.com/supervons/ExploreRN

已完成

  • 项目基础搭建
  • 登录注册
  • 接口鉴权 - JWT
  • 修改密码、用户信息
  • 头像、皮肤、签名等 profile 相关信息 CURD 接口
  • WebSocket 接口编写

待开发

  • 发送邮件
  • log4j 日志中间件
  • 基于 redis 列表查询加速

项目启动-开发

npm install
npm run start

项目 pm2 部署

npm run build
npm run pro

项目结构

.
├── src
│   ├── controller        //controller层
│   ├── entity            //实体类
│   ├── redis             //redis相关配置及工具类
│   ├── router            //路由配置
│   ├── service           //service层
│   ├── config.ts         //配置文件
│   ├── constants.ts      //项目常量
│   └── index.ts          //项目入口index.js
├── .env                  //配置文件
├── ecosystem.config.js   //pm2配置
├── ormconfig.json        //数据库 ORM 配置文件
├── nodemon.json          //nodemon配置
├── package.json          //npm 安装包
└── tsconfig.json         //ts配置文件

数据库表结构

表结构

运行前准备

  • MySQL
  • Redis

建议使用 Docker 进行安装,方便快捷

启动前配置项

Redis 配置

.env 中进行配置

  • PORT_REDIS Redis 端口
  • HOST_REDIS Redis HOST
  • PASSWORD_REDIS Redis password

MySQL 数据库配置

ormconfig.ts中进行配置:

  • type 数据库类型
  • host主机名

具体参考 https://github.com/typeorm/typeorm

邮件服务配置

src/utils/email.ts 中进行配置

  • host 主机名
  • port 端口
  • auth 认证信息
    • user 邮件用户,将会以此进行发送
    • pass 通行证,一般在邮件供应商设置中获取

数据库文件位置

./public/mysql.sql

explorekoa's People

Contributors

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