Skip to content

Commit

Permalink
Merge branch 'main' of github.com:kerriestauffer/indiv-berner-rundgae…
Browse files Browse the repository at this point in the history
…nge into main
  • Loading branch information
kerriestauffer committed May 12, 2023
2 parents b512210 + 6a59764 commit 2ac3c85
Show file tree
Hide file tree
Showing 18 changed files with 371 additions and 110 deletions.
File renamed without changes.
Empty file added .vscode/settings.json
Empty file.
30 changes: 30 additions & 0 deletions Dockerfile
@@ -0,0 +1,30 @@
# We label the images in order to easily clear them after.
# clear images with `docker image prune --filter label=stage=build`.
# to look which ones are there: `docker image ls --filter label=stage=build`.

# We may not use the alpine image since it uses musl but our production image may need another c standard lib.
FROM node:19 as build
LABEL stage=build

COPY backend/ /build/backend
COPY frontend /build/frontend

WORKDIR /build/backend

RUN npm install && npm run build

WORKDIR /build/frontend

RUN npm install && npm run build

FROM node:19 as prod

COPY --from=build /build/backend/build /app/dist

COPY --from=build /build/backend/node_modules/ /app/dist/node_modules

COPY --from=build /build/frontend/client /app/client

WORKDIR /app/dist/

CMD ["node", "main.js"]
37 changes: 36 additions & 1 deletion README.md
@@ -1 +1,36 @@
# indiv-berner-rundgaenge
# indiv-berner-rundgaenge

To install all the dependencies, run the script:

```sh
./setup.sh
```

# frontend

The frontend is an [angular](https://angular.io/) single page application.

It needs a build step for two reasons:

- To turn the angular code into a bundle that can be served by a web server
- To turn typescript code into pure javascript code that runs in the browser

To start it, do the following:

```sh
cd frontend
npm run start
```

# backend

The backend is a [nest](https://nestjs.com/) node application.

It needs a build step to transpile typescript into javascript.

To start it, do the following:

```sh
cd backend
npm run start:dev # will also start a mongo database in a docker container
```
6 changes: 6 additions & 0 deletions backend/.env
@@ -0,0 +1,6 @@
# Development config
PRODUCTION=false # Sets some prod specific things and makes seeding impossible
SEED_MONGO=false # Seeds the mongo database
MONGO_URL=/
#PORT=3000 # Optional
#API_PREFIX=api # Optional
73 changes: 0 additions & 73 deletions backend/README.md

This file was deleted.

120 changes: 118 additions & 2 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion backend/package.json
Expand Up @@ -9,7 +9,7 @@
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:dev": "./start.sh start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
Expand All @@ -21,8 +21,11 @@
},
"dependencies": {
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.3.1",
"@nestjs/core": "^9.0.0",
"@nestjs/platform-express": "^9.0.0",
"@nestjs/serve-static": "^3.0.1",
"joi": "^17.9.2",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.2.0"
},
Expand Down

0 comments on commit 2ac3c85

Please sign in to comment.