豆米博客-Sailsjs版,个人博客系统,使用SailsJs,MongoDb,Bootstrap,marked,SASS,swig等
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
api
assets
config
services
tasks
test
views
.bithoundrc
.bowerrc
.coveralls.yml
.editorconfig
.gitignore
.jshintignore
.jshintrc
.sailsrc
.travis.yml
CHANGELOG.md
Gruntfile.js
README.md
app.js
bower.json
cacert.pem
gitChangeOldUserNameOnCommit.sh
newHeaderAfterNginx.txt
package-lock.json
package.json
run.sh

README.md

DouMi blog platform

Build Status Coverage Status Analytics stable

bitHound Overall Score bitHound Dependencies bitHound Dev Dependencies bitHound Code MIT Licence

A Sails application. It is used for recording the process from the loving to marriage, all happiness and happy time are showing with only five pages. Each pages has the unique theme:

This blog platform is based on the sailsjs web framework. It contains three parts:

  • blog index page. It shows the navigation of blog platform and some key information about DouMi blog.
  • blog show page. It shows all posts which were published in this blog platform.
  • about DouMi page. It will introduce the DouMi in details.

This blog platform has following tech stack:

  • SailsJs
  • MongoDb
  • Async
  • RequireJs
  • Jquery
  • Bootstrap
  • bcrypt + passport
  • swig
  • SASS
  • grunt
  • marked
  • node-schedule

Now DouMi blog has been deployed in the AliYun, you can visit it via: http://blog.5udou.cn

How to contribute

If you has intrested in developing this project, your correction/addition is so welcome.Just fork it and the pull a new request.

How to deploy it in the local environment

Step 1 Install nodejs and npm:

https://nodejs.org/download/

And npm has been imbedded with nodejs, and it will be installed with nodejs installation.

Step 2 Install sails:

$ npm -g install sails

Step 3 Clone the codes from gitlab:

$ git clone https://github.com/linxiaowu66/sails-blog-platform.git

Step 4 Install Dependency and devDependency packages:

Move to the project root directory, and run below commands to install other packages, it is because in this project we also used some third-party package. Bower is an enhanced package management tool which can handle the package dependence well.

$ npm -g install bower
$ npm i
$ bower i

This project is dependence with the SASS, so you should install the ruby and compass before run the app. Install steps as follow(AliYun--Ubuntu):

# apt-get install Python-software-properties
# apt-add-repository ppa:brightbox/ruby-ng
# apt-get update
# apt-get install ruby2.1 ruby2.1-dev
# gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/
# gem install compass

NOTE: If you can assess the http://rubygem.org, you can add the taobao mirrors to gem source just as step 3.

deploy it under root is really a bad idea, but in case you're basted, try:

# npm install --unsafe-perm
# bower i --allow-root

Step 5 In development mode, you can use 'localDiskDb'. Then no need to install database in development mode. But in production mode, MongoDb is used in this project.

Running the mongoDb,you can type these:

mongod -fork --dbpath=/home/mongodb_data/ --logpath=/home/mongodb_log/mongodb.log --logappend &

Then forever run the sails app:

cd yourProject

NODE_ENV=production forever start app.js

Step 6 In this project, we use mocha [ http://mochajs.org/ ] for unit test. Unit test is a good way to protect your code. To install mocha:

$ npm install -g mocha

Step 7 In local, you can run 'sails lift' or 'sails console' in the root directory of this project to startup the server. Suppose the port 1337 used by server to listen the connect request, then you can visit the server in browser with url 'http://localhost:1337'.

You can run 'sails lift --silly', then all detail log will be printed in console. Also for troubleshooting, it is better to use the interactive mode with 'sails conole' ```