Compare commits
1 Commits
30961714fb
...
04c3c926ff
Author | SHA1 | Date | |
---|---|---|---|
04c3c926ff |
@ -10,9 +10,9 @@ steps:
|
|||||||
- name: frontend
|
- name: frontend
|
||||||
image: node:13.8.0
|
image: node:13.8.0
|
||||||
commands:
|
commands:
|
||||||
- npm install yarn
|
- cd frontend
|
||||||
- yarn install
|
- npm install
|
||||||
- yarn build
|
- npm run-script build
|
||||||
|
|
||||||
- name: backend
|
- name: backend
|
||||||
image: golang:1.14.0-alpine3.11
|
image: golang:1.14.0-alpine3.11
|
||||||
|
@ -1,17 +1,10 @@
|
|||||||
## Install dependencies
|
## Install dependencies
|
||||||
|
|
||||||
### Install node
|
### Install node and npm
|
||||||
|
|
||||||
You'll need node v6+, here's a link to install it:
|
You'll need node v6+, here's a link to install it:
|
||||||
https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
|
https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
|
||||||
|
|
||||||
### Install yarn and dependencies
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo npm install -g yarn
|
|
||||||
yarn install
|
|
||||||
```
|
|
||||||
|
|
||||||
## Dev
|
## Dev
|
||||||
|
|
||||||
#### Check your config.yml file
|
#### Check your config.yml file
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
root: .
|
||||||
|
valid_ext: .go
|
||||||
|
colors: 1
|
||||||
build_name: dev-build
|
build_name: dev-build
|
||||||
build_log: dev-build.log
|
build_log: dev-build.log
|
||||||
tmp_path: ./build
|
tmp_path: ../build
|
||||||
valid_ext: .go
|
|
||||||
root: ./backend
|
|
||||||
colors: 1
|
|
@ -4,7 +4,7 @@ authorizer:
|
|||||||
cost: 10
|
cost: 10
|
||||||
pgdsn: postgres://test:test@127.0.0.1:5432/dev?sslmode=disable
|
pgdsn: postgres://test:test@127.0.0.1:5432/dev?sslmode=disable
|
||||||
listen_port: 3000
|
listen_port: 3000
|
||||||
public_dir: build/public
|
public_dir: ../build/public
|
||||||
# default prefix, will be served by the go http server
|
# default prefix, will be served by the go http server
|
||||||
img_url_prefix: img/
|
img_url_prefix: img/
|
||||||
periodic_refresh:
|
periodic_refresh:
|
||||||
|
7
dev.sh
7
dev.sh
@ -65,7 +65,7 @@ _migrate() {
|
|||||||
|
|
||||||
_ensure_command jq
|
_ensure_command jq
|
||||||
_ensure_command go
|
_ensure_command go
|
||||||
_ensure_command yarn
|
_ensure_command npm
|
||||||
|
|
||||||
_check_command migrate || {
|
_check_command migrate || {
|
||||||
_log_info "Installing migrate"
|
_log_info "Installing migrate"
|
||||||
@ -135,7 +135,7 @@ case $1 in
|
|||||||
# Apply the migrations
|
# Apply the migrations
|
||||||
_migrate -path "$MIGRATION_SCHEMA" up
|
_migrate -path "$MIGRATION_SCHEMA" up
|
||||||
|
|
||||||
CONFIG_FILE="./config.yml" fresh -c fresh.conf
|
(cd backend && CONFIG_FILE="../config.yml" fresh -c fresh.conf)
|
||||||
;;
|
;;
|
||||||
docker-db)
|
docker-db)
|
||||||
_ensure_command docker
|
_ensure_command docker
|
||||||
@ -144,8 +144,7 @@ case $1 in
|
|||||||
docker-compose -f "$DOCKER_COMPOSE_FILE" "$@"
|
docker-compose -f "$DOCKER_COMPOSE_FILE" "$@"
|
||||||
;;
|
;;
|
||||||
front)
|
front)
|
||||||
yarn install
|
(cd frontend && npm install && npm run-script start)
|
||||||
yarn start
|
|
||||||
;;
|
;;
|
||||||
db-init)
|
db-init)
|
||||||
_ensure_command jq
|
_ensure_command jq
|
||||||
|
@ -10,7 +10,7 @@ const protectedRoute = ({
|
|||||||
isActivated,
|
isActivated,
|
||||||
isTokenSet,
|
isTokenSet,
|
||||||
setUserToken,
|
setUserToken,
|
||||||
...otherProps,
|
...otherProps
|
||||||
}) => {
|
}) => {
|
||||||
const isAuthenticated = () => {
|
const isAuthenticated = () => {
|
||||||
if (isTokenSet) {
|
if (isTokenSet) {
|
||||||
|
13566
frontend/package-lock.json
generated
Normal file
13566
frontend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "NODE_ENV=development ./node_modules/webpack/bin/webpack.js -d --progress --colors --watch",
|
"start": "NODE_ENV=development ./node_modules/webpack/bin/webpack.js -d --progress --colors --watch",
|
||||||
"build": "NODE_ENV=production ./node_modules/webpack/bin/webpack.js -p --progress --colors",
|
"build": "NODE_ENV=production ./node_modules/webpack/bin/webpack.js -p --progress --colors",
|
||||||
"lint": "./node_modules/eslint/bin/eslint.js frontend/."
|
"lint": "./node_modules/eslint/bin/eslint.js ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap": "^4.3.1",
|
"bootstrap": "^4.3.1",
|
@ -5,18 +5,18 @@ var HtmlWebpackPlugin = require("html-webpack-plugin");
|
|||||||
var { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
var { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
||||||
|
|
||||||
var mode = "development";
|
var mode = "development";
|
||||||
var BUILD_DIR = path.resolve(__dirname, "build/public/");
|
var BUILD_DIR = path.resolve(__dirname, "../build/public/");
|
||||||
|
|
||||||
if (process.env.NODE_ENV === "production") {
|
if (process.env.NODE_ENV === "production") {
|
||||||
mode = "production";
|
mode = "production";
|
||||||
BUILD_DIR = path.resolve(__dirname, "canapeapp/public/");
|
BUILD_DIR = path.resolve(__dirname, "../canapeapp/public/");
|
||||||
}
|
}
|
||||||
|
|
||||||
var SRC_DIR = path.resolve(__dirname, "frontend/js");
|
var SRC_DIR = path.resolve(__dirname);
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
mode: mode,
|
mode: mode,
|
||||||
entry: path.join(SRC_DIR, "app.js"),
|
entry: path.join(SRC_DIR, "js/app.js"),
|
||||||
output: {
|
output: {
|
||||||
path: BUILD_DIR,
|
path: BUILD_DIR,
|
||||||
filename: "[contenthash]-app.js",
|
filename: "[contenthash]-app.js",
|
||||||
@ -77,7 +77,7 @@ const config = {
|
|||||||
cleanOnceBeforeBuildPatterns: ["**/*", "!img/**/*", "!img"],
|
cleanOnceBeforeBuildPatterns: ["**/*", "!img/**/*", "!img"],
|
||||||
}),
|
}),
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: path.join(SRC_DIR, "../index.html"),
|
template: path.join(SRC_DIR, "index.html"),
|
||||||
}),
|
}),
|
||||||
new WebpackPwaManifest({
|
new WebpackPwaManifest({
|
||||||
fingerprints: true,
|
fingerprints: true,
|
||||||
@ -96,11 +96,11 @@ const config = {
|
|||||||
start_url: "/",
|
start_url: "/",
|
||||||
icons: [
|
icons: [
|
||||||
{
|
{
|
||||||
src: path.resolve(__dirname, "frontend/img/android-chrome-512x512.png"),
|
src: path.resolve(__dirname, "img/android-chrome-512x512.png"),
|
||||||
sizes: [96, 128, 192, 256, 384, 512],
|
sizes: [96, 128, 192, 256, 384, 512],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: path.resolve(__dirname, "frontend/img/apple-touch-icon.png"),
|
src: path.resolve(__dirname, "img/apple-touch-icon.png"),
|
||||||
sizes: [80, 120, 152, 167, 180],
|
sizes: [80, 120, 152, 167, 180],
|
||||||
ios: true
|
ios: true
|
||||||
},
|
},
|
Loading…
x
Reference in New Issue
Block a user