-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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
1 parent
198dc08
commit 9377b43
Showing
264 changed files
with
63,274 additions
and
18,321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
**/* | ||
!README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.