DouMi blog platform
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:
- bcrypt + passport
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:
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
rootis 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' ```