coffee shop on the cloud - 咖啡不只是咖啡
bash <(curl https://raw.githubusercontent.com/Luphia/SIMPLE/master/shell/install-simple.sh -kL)
sudo apt-get update
sudo apt-get install openssl libtool autoconf automake uuid-dev build-essential gcc g++ software-properties-common unzip make git libcap2-bin python -y
sudo mkdir /etc/Cafeca-Webapp
sudo chown ubuntu /etc/Cafeca-Webapp
sudo mkdir /etc/Cafeca-Backend
sudo chown ubuntu /etc/Cafeca-Backend
https://github.com/MerMerLtd/Cafeca-Webapp
https://github.com/MerMerLtd/Cafeca-Backend
cd /etc/Cafeca-Webapp && npm i && npm i webpack node-sass live-server --save-dev
cd /etc/Cafeca-Backend && npm i
...
"scripts": {
"compile:sass": "node-sass src/sass/main.scss dist/css/style.css",
"watch:sass": "node-sass src/sass/main.scss dist/css/style.css -w", // keep watching in the background whenever we change our sass code
"deserver" : "live-server dist/index.html"
},
...
npm i webpack webpack-cli --save-dev
const path = require("path");
module.exports = {
entry: "./src/js/index.js",
output: {
path: path.resolve(__dirname, "dist/js"),
filename: "bundle.js"
},
mode: "development"
};
...
"scripts": {
...
"dev": "webpack --mode development",
"build": "webpack --mode production",
"start": "webpack-dev-server --mode development --open"
//So a script start will always be a script that keeps running in the background and updates the browser as soon as we change our code.
},
...
npm run dev
npm install webpack-dev-server --save-dev
...
module.exports = {
output: {
// - path: path.resolve(__dirname, "dist/js"),
+ path: path.resolve(__dirname, "dist"),
// - filename: "bundle.js"
+ filename: "js/bundle.js"
},
- mode: "development"
+ devServer: {
contentBase: './dist'
},
};
npm install html-webpack-plugin --save-dev
...
module.exports = {
...
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: './src/index.html'
})
],
};
mkdir /etc/Cafeca-Backend/private/
cp /etc/Cafeca-Backend/sample.config.toml /etc/Cafeca-Backend/private/config.toml
vi /etc/Cafeca-Backend/private/config.toml
# CafecaBackend Default Config
title = "CafecaBackend"
[base]
folder = "CafecaBE"
static = "/etc/Cafeca-Webapp"
debug = false
[blockchain]
type = "ethereum"
[database]
type = "firebase"
[api]
pathname = [
"get | /,/version | Static.Utils.readPackageInfo",
"get | /api/questions | Bot.FindCafeca.getQuestions",
"get | /api/suggestion | Bot.FindCafeca.getSuggestion",
"get | /api/store/:storeID | Bot.FindCafeca.getStore",
"get | /policy/* | Static.Utils.readPackageInfo"
]
pm2 start /etc/Cafeca-Backend/ --name Cafeca