Compare commits

...

1 Commits

Author SHA1 Message Date
30961714fb Update files locations
All checks were successful
continuous-integration/drone/push Build is passing
* use npm instead of yarn
* group frontend stuff
* group backend stuff
2020-02-26 14:31:28 +01:00
10 changed files with 13585 additions and 8011 deletions

View File

@ -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 build
- name: backend - name: backend
image: golang:1.14.0-alpine3.11 image: golang:1.14.0-alpine3.11

View 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

View File

@ -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
View File

@ -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 start)
yarn start
;; ;;
db-init) db-init)
_ensure_command jq _ensure_command jq

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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
}, },

7991
yarn.lock

File diff suppressed because it is too large Load Diff