Giter Club home page Giter Club logo

book's Introduction

##运行方式

以生产环境启动:

Mac:$ export NODE_ENV=production

windows: set NODE_ENV=production

开发前请绑定本地host为uxx.etao.net,访问uxx.etao.net:端口/book.目前远程数据库使用mongolab,并在server.js同级目录下添加config.js,内容为

var mongo = require("mongoskin");
module.exports = {
    db: '',
    port: 8012,
    dburl: "远程数据库地址",
    switchToLocal: function () {
        this.port = 8080;
        this.dburl = ":@127.0.0.1:27017/books";
    },
    start: function (local) {
        if (local) {
            this.switchToLocal();
        }
        this.db = mongo.db(this.dburl);
    }
};

##图书管理系统设计说明 ###1、数据库设计 本系统数据使用Nosql型数据库mongodb将数据存储于books数据库中,自PHP+Mysql之后Nodejs+Mongodb可谓是新生技术中的又一黄金搭档。本系统设计了三个集合(collection),分别是:books(存储图书相关信息)、users(存储用户相关信息)、lendhistory(存储借/还书历史)。 #####1.1 books集合 books集合用于存储图书相关信息,其中包含以下文档(字段):bookname(图书名称)、pic(图书缩略图)、author(图书作者)、publish_house(出版社)、publish_date(出版日期)、borrow_times(借阅次数)、score(总体评分)、recommend(推荐阅读信息)、book_cate(图书分类)、isbn(图书ISBN编码)、book_total(图书总册数)、book_borrowed(已借册数)。

其中,以下文档需做特殊说明:

  • booknamebook_cateisbnbook_total为必填字段;
  • borrow_times是非固定字段,可以在图书第一次被借阅时加入集合;
  • book_cate字段非常关键,将用于与管理员关联,以便管理员按类别分类管理图书增删及借换情况;
  • book_totalbook_borrowed分别记录总数和已借出数量,同时可用于计算可借数量;
  • isbn字段用于图书去重;

表格(省去可扩展字段)展示形式如下:

|bookname|pic|author|publish_house|publish_date|recommend|book_cate| |:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---|:---:| |PS教程|http://....png|XXX|邮电出版社|2013-01-01|推荐阅读|1|

isbn book_total book_borrowed
123456789 3 0

取值说明:

  • book_cate: 可取值1、2、3、4,分别代表用研、交互、视觉、前端四类书籍。

#####1.2 users集合 users集合数据本身不由本系统创建,该集合数据由ark登录成功后返回用户信息写入,这样可以保证登入用户都是有效的系统内部用户,避免外部用户干扰。该集合包含以下文档(字段):nick(用户昵称/旺旺)、email(用户邮箱)、work_id(工号)、isadmin(是否管理员标记)。

其中,以下文档需做特殊说明:

  • email字段可用于从gravatar获取用户头像;
  • work_id字段可用于用户去重处理;
  • isadmin字段用于标记改用户是否管理员,标记值使用图书类别,这样就可以让管理员与其所管理的图书类别自然关联;

表格展示形式如下:

nick email work_id isadmin
乐淘 [email protected] 12345 0/1/2/3

取值说明:

  • isadmin: 可取0、1、2、3、4,分别代表非管理员、用研管理员、交互管理员、视觉管理员、前端管理员。

#####1.3 lendhistory集合 lendhistory集合用于存储用户借书/还书的整个过程,也兼任查询借阅历史的角色,该集合包含以下文档(字段):nick(用户昵称)、isbn(图书标识)、bookname(图书名称)、borrom_time(借阅时间)、return_time(规定的还书时间)、status(接/还书状态标识)、book_cate(图书类别)。

其中,以下需做特殊说明:

  • 可通过nickisbn对应,查阅用户借书史/图书借阅史。
  • borrow_timereturn_time之间是合理的借阅时间,即将达到规定还书时间还未还书的将给予邮件提醒;
  • status: 可取1、2、3、4、5,分别代表申借、取消、已借、拒借、管还五种状态;
  • book_cate用于管理员分类审核自己管理类别的图书借阅状态;

表格展示形式如下:

nick isbn bookname borrow_time return_time status book_cate
乐淘 123456789 jQuery 2013-01-01 2013-02-01 1/2/3/4 1

取值说明:

  • status: 可取1、2、3、4、5,分别代表申借、取消、已借、拒借、管还五种状态。

###2.时序图 添加图书 编辑图书 删除图书 借书 还书

###3.一些资料

book's People

Contributors

naeteerada avatar mailzwj avatar

Watchers

James Cloos avatar  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.