Skip to content

Commit

Permalink
Collective commit:
Browse files Browse the repository at this point in the history
- Adding backend for

Enabling synchronization between multiple clients

Collective commit:
- Adding beckend
- Extending mmp functionality to support synchronization
- Adding docker development setup
  • Loading branch information
JannikStreek authored and gerardo-navarro committed Dec 5, 2021
1 parent 198dc08 commit 9377b43
Show file tree
Hide file tree
Showing 264 changed files with 63,274 additions and 18,321 deletions.
27 changes: 27 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.dockerignore
.editorconfig
.env*
.git
.github
.gitignore
.prettier*
.vscode
ca/*.crt
ca/*.key
ca/*.pem
ca/*.req
docker-compose*
Dockerfile*
LICENSE
mindmapper-backend/client-build
mindmapper-backend/dist
mindmapper-backend/LICENSE
mindmapper-backend/node_modules
mindmapper-backend/npm-debug.log
mindmapper-backend/README.md
mindmapper-frontend/dist
mindmapper-frontend/LICENSE
mindmapper-frontend/node_modules
mindmapper-frontend/npm-debug.log
mindmapper-frontend/README.md
README.md
25 changes: 25 additions & 0 deletions .env.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Environment Variables DEVELOPMENT
APP_BACKEND_PORT=3000
APP_FRONTEND_PORT=4200

POSTGRES_DB=mindmapper-backend-dev
POSTGRES_PASSWORD=mindmapper-password
POSTGRES_PORT=5432
POSTGRES_USER=mindmapper-user

DOCKER_COMPOSE_APP_ENV_POSTGRES_TEST_DATABASE=mindmapper-backend-test
DOCKER_COMPOSE_APP_ENV_POSTGRES_TEST_HOST=postgres
DOCKER_COMPOSE_APP_ENV_POSTGRES_TEST_PASSWORD=mindmapper-password
DOCKER_COMPOSE_APP_ENV_POSTGRES_TEST_PORT=5432
DOCKER_COMPOSE_APP_ENV_POSTGRES_TEST_USER=mindmapper-user

# Environment Variables PRODUCTION
APP_PROD_PORT=3011

POSTGRES_PROD_DB=mindmapper-backend-prod
POSTGRES_PROD_PASSWORD=mindmapper-password
POSTGRES_PROD_PORT=5433
POSTGRES_SSL_REJECT_UNAUTHORIZED=true
POSTGRES_PROD_USER=mindmapper-user
# PROD Requires SSL Connection Support. Use DEV if not available.
PROD_MODE=PROD
10 changes: 0 additions & 10 deletions .github/FUNDING.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@ testem.log
# System Files
.DS_Store
Thumbs.db
docker-compose.override.yml
.env

ca/*.crt
ca/*.pem
ca/*.key
ca/*.req
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/*
!README.md
50 changes: 50 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM node:16.9.1-alpine3.14 as base
# Ensuring that all npm packages and commands are executed with a non-root user
USER node

ENV APP_PATH=/home/node/app
ENV APP_BACKEND_PATH=${APP_PATH}/mindmapper-backend
ENV APP_FRONTEND_PATH=${APP_PATH}/mindmapper-frontend

RUN mkdir -p $APP_PATH
WORKDIR $APP_PATH

FROM base as production_buildstage
USER node

COPY --chown=node:node mindmapper-backend/package.json mindmapper-backend/package-lock.json $APP_BACKEND_PATH/
RUN npm --prefix mindmapper-backend install

COPY --chown=node:node mindmapper-frontend/package.json mindmapper-frontend/package-lock.json $APP_FRONTEND_PATH/
RUN npm --prefix mindmapper-frontend install

COPY --chown=node:node package.json $APP_PATH/

COPY --chown=node:node mindmapper-backend $APP_BACKEND_PATH/
RUN npm run build:backend:prod

COPY --chown=node:node mindmapper-frontend $APP_FRONTEND_PATH/
RUN GENERATE_SOURCEMAP=false npm run build:frontend:prod

FROM base as production
USER node

COPY --chown=node:node package.json $APP_PATH/

COPY --chown=node:node mindmapper-backend/package.json mindmapper-backend/package-lock.json $APP_BACKEND_PATH/
RUN npm --prefix mindmapper-backend install --production

COPY --chown=node:node --from=production_buildstage $APP_BACKEND_PATH/dist $APP_BACKEND_PATH/dist
COPY --chown=node:node --from=production_buildstage $APP_FRONTEND_PATH/dist $APP_BACKEND_PATH/client

COPY --chown=node:node entrypoint.prod.sh $APP_PATH/
CMD ["./entrypoint.prod.sh"]

FROM base as development
USER node

COPY --chown=node:node mindmapper-frontend/package.json mindmapper-frontend/package-lock.json $APP_FRONTEND_PATH/
RUN npm --prefix mindmapper-frontend install

COPY --chown=node:node mindmapper-backend/package.json mindmapper-backend/package-lock.json $APP_BACKEND_PATH/
RUN npm --prefix mindmapper-backend install
4 changes: 3 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ The MIT License (MIT)

Copyright (c) 2019 Omar Desogus

Copyright (c) 2021 b310 digital gmbh

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 9377b43

Please sign in to comment.