Giter Club home page Giter Club logo

bullet-backend's Introduction

Bullet弹幕记忆仓库、

Demo视频

https://www.bilibili.com/video/BV19A411E7GY/

前端网页端Github仓库

https://github.com/qidian99/Bullet-Frontend

前端浏览器插件端Github仓库

https://github.com/qidian99/Bullet-Extension

后端部署文档

后端的所有对象模型和API文档,包括 User用户对象, Room房间对象, Bullet弹幕对象, Resource资源对象, Tag标签对象, Invitation房间邀请, Friend好友邀请

技术

  1. node. JS的后端server
  2. GraphQL. Facebook的Graph API server, 比REST不知道强到哪里去了
  3. ApolloServer. 与前端的ApolloClient连接,以后加Socket只需要几秒钟。
  4. MongoDB. NoSQL,存非结构数据和进行Aggregation完爆SQL,慢点就慢点吧

项目结构

  1. controllers/: 为以后Email或者SMS验证留下来的REST API

  2. graphql/

    1. schema/: GraphQL所有的模式定义, 将MongoDB的模式暴露给API
    2. resolvers/: GraphQL所有的处理器定义,从数据库请求数据并返回
  3. middlewares/: CORS、异常处理等中间件

  4. model/: MongoDB所有的模式定义

  5. util/: 功能函数,比如封装从JWT获取当前用户

  6. doc/: 后端所有API的文档,从index.html进入

安装

  1. 本地下载MongoDB。如果是Macbook可以brew install;如果是Windows建议安装MongoDB Compass Community版本。如果是其他电脑建议买一台Macbook或者Windows。

    • 本项目同样部署有MongoDB Atlas数据库,需要Demo可以联系我
  2. npm install,会下载所有的依赖

  3. 启动

    • 在项目根目录创建.env文件,里面随便给个JWT_SECRET=爱给啥给啥,用于JWT加密解密。
    • npm start
    • npx nodemon index.js
  4. GraphQL起步

    • 所有GraphiQL API起步文件都在Query这个目录下面
    • 本机启动后直接访问localhost:4000进入GraphiQL界面
    • 可以选择复制Query文件夹下的Queries和Mutations,也可以自己写。

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.