AMP version of qmau.me
Branch: master
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.
models
public
routes
templates
updates
.gitignore
LICENSE
Procfile
README.md
keystone.js
package-lock.json
package.json

README.md

qmau.me-amp ⚡

AMP version of qmau.me

Site: https://qmau.me

Responsive design blog using Google AMP (Accelerated Mobile Pages) to speed up page load-time for mobile users.

In case you want to run or customize this project

Install node.js and mongodb

  1. Node.js v8.x
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install -y build-essential
  1. Mongodb v3.6
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
sudo apt-get update
sudo apt-get install -y mongodb-org
  1. Nginx
sudo apt-get update
sudo apt-get install nginx

sudo ufw allow 'Nginx Full'
  1. pm2 (OPTIONAL for Node.js monitoring and process management)
npm install pm2 -g

gist for ubuntu16.04

Run this project

  1. Clone this project
git clone git@github.com:qmau-me/qmau.me-amp.git
  1. Update admin account
vi updates/0.0.1-admins.js
exports.create = {
	User: [
		{ 'name.first': 'Admin', 'name.last': 'User', 'email': [YOUR_EMAIL], 'password': [YOUR_PASSWORD], 'isAdmin': true },
	],
};
  1. Create .env file
vi .env
COOKIE_SECRET= [YOUR_SECRET_CODE]
PORT = [PORT] #default port is 3000
  1. Start keystone.js
node keystone.js
#pm2
pm2 start keystone.js
  1. Deploy
vi /etc/nginx/conf.d/blog.conf

blog.conf

server {
    server_name [DOMAIN] default_ server;
    listen 80;

    access_log /var/log/nginx/blog-access.log;
    error_log /var/log/nginx/blog-error.log;

    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://127.0.0.1:3000; #default port is 3000
    }

}
  1. Restart and enjoy
sudo service nginx restart

License

qmau.me-amp is licensed under the Apache License, Version 2.0.