基本階段

以下會用截圖搭配文字簡單描述每個功能的實作

在頁面上主要是參考Facebook排版(如有不妥煩請通知)
這是WELCOME social web 的主頁,同時也是登入註冊的地方
這是功能主頁

主要用的工具有

  1. NodeJS(V4.3.2) + ExpressJS(V4.X)
  2. MongoDB / Redis(for session)
  3. 前端:
    a.JQuery
    b.Bootstrap
  4. NodeJS module:
    a.express-session
    b.connect-redis
    c.node-sass-middleware
    d.nodemailer

安裝流程

  1. NodeJS on ubuntu:
    ---curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
    ---sudo apt-get install -y nodejs
  2. Redis on ubuntu:
    ---sudo apt-get install redis-server
  3. MongoDB on ubuntu:
    ---sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
    ---echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
    ---sudo apt-get install mongodb-org
  4. Pull down project from GitHub
  5. 修改AJAX URL(詳見chapter1.7) ---./init.sh (如果遇到權限不足問題,-> bash init.sh) ---如果在AWS以外的平台,使用 node myURL.js server_ip

主頁流程:

A用戶註冊後->到信箱獲取驗證碼->輸入驗證後進入個人主頁(Server保存Session,使用Redis)
在功能主頁->新增/更新/刪除 文章與留言->在SearchBox搜尋其他用戶->在其他人牆上留言

主要檔案路徑圖:

-module:DB Schema
---user.js
---artilce.js
---comment.js
-public
---javascripts
------viewIndex.js:Index頁面的相關JS檔
------viewResetPwd.js:ResetPwd頁面的相關JS檔
------viewUsers.js:Users頁面的相關JS檔
-routes
------index.js ------users.js -sass
-views
---index
------index_layout.jade
------index_resetpwd.jade
------index.jade
---user
------user_layout.jade
------user_person.jade
------user_wall.jade:not implement yet
-app.js