Skip to content
Snippets Groups Projects
Commit 98d193a8 authored by Joel Suter's avatar Joel Suter
Browse files

moved and deleted unused folders

parent c156286b
No related branches found
No related tags found
No related merge requests found
Pipeline #265453 failed
Showing
with 112 additions and 160 deletions
...@@ -11,4 +11,13 @@ ...@@ -11,4 +11,13 @@
.git/* .git/*
/Code/**/node_modules/ /Code/**/node_modules/
.idea .idea
/test-sample/node_modules /test-sample/node_modules
\ No newline at end of file */node_modules/
.idea/
data
*.log
todo
notes
note
*/.nyc_output
*/coverage
\ No newline at end of file
File moved
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
*/node_modules/
.idea/
data
*.log
todo
notes
note
*/.nyc_output
*/coverage
\ No newline at end of file
## Prototype using Node API and Postgres Database
`http://localhost/` - default application page
`http://localhost:3000` - direct API access (dev only)
`http://localhost:8080/docs` - API Specification based on swagger
`psql -h localhost -U parking -d parkingslotsharingtool_db` to connect to database.
Project folder structure:
```bash
├── node-api
| ├── helpers
| | ├── ...
| ├── queries
| | ├── ...
│ ├── Dockerfile
| ├── index.js
| ├── package.json
│ ...
├── node-frontend
| ├── src
| | ├── controller
| | ├── ...
| | ├── public
| | ├── ...
| | ├── routes
| | ├── ...
| | ├── utils
| | ├── ...
| | ├── views
| | ├── ...
| ├── Dockerfile
| ├── index.js
| ├── package.json
├── openapi-nodejs
| ├── ...
├── docker-compose.yaml
├── postgres
│ ├── db
| | ├── createSchema.sql
| | ├── insertData.sql
| | ├── queries.sql
│ └── init
| ├── runAllScripts.sql
└── README.md
```
[docker-compose.yaml](docker-compose.yaml)
```yaml
services:
node-api:
container_name: node-api
restart: always
build: node-api
ports:
- 3000:3000 # used to make api available to host
...
depends_on:
- postgres
postgres:
container_name: postgres
restart: always
ports:
- 5432:5432 # used to make ports available to host - testing only!
...
expose: 5432 # used to make port available within docker-network
```
The compose file defines an application with two services `node-api` and `postgres`.
When deploying the application, docker-compose maps port 3000 of the frontend service container to port 3000 of the host as specified in the file.
Make sure port 3000 on the host is not already being in use.
## Deploy with docker-compose
To start the application, navigate to the express-postgres folder and run
```bash
$ sudo docker-compose up
```
to show all docker container log output.
To run the application in the background, use the switch -d:
```bash
$ sudo docker-compose up -d
```
## Check running application
Listing containers using `sudo docker ps` must show containers running and the port mapping as below:
```bash
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
06e606d69a0e node-api "docker-entrypoint.s…" 23 minutes ago Up 23 minutes 0.0.0.0:3000->3000/tcp node-api
a1f321f06490 postgres:alpine "docker-entrypoint.s…" 23 minutes ago Up 23 minutes 0.0.0.0:27017->27017/tcp postgres
```
## Stop and remove the containers
Use __Ctrl+C__ if the application has started in the foreground. This stops all running containers.
```bash
Stopping node-frontend ... done
Stopping node-api ... done
Stopping openapi-nodejs ... done
Stopping postgres ... done
```
To recreate containers use `docker-compose down`, which will remove them entirely.
```bash
Removing node-frontend ... done
Removing node-api ... done
Removing openapi-nodejs ... done
Removing postgres ... done
Removing network express-postgres_frontend-api
Removing network express-postgres_api-postgres
```
## Rebuild an Image
To rebuild an image use `sudo docker-compose build` or `sudo docker-compose up --build`.
\ No newline at end of file
# ParkingSlotSharingTool ## Prototype using Node API and Postgres Database
![Logo](Documentation/src/resources/signage.png) `http://localhost/` - default application page
`http://localhost:3000` - direct API access (dev only)
`http://localhost:8080/docs` - API Specification based on swagger
## Ordner Code / express-postgres `psql -h localhost -U parking -d parkingslotsharingtool_db` to connect to database.
Beinhaltet die Applikation. Weitere Informationen in separatem README File im Ordner.
## Ordner Project Management Project folder structure:
Beinhaltet verschiedene Dokumente, die zur Projektplanung beigetragen haben, aber nicht direkt in der Dokumentation Platz gefunden haben. ```bash
├── node-api
## Ordner Documentation | ├── helpers
Beinhaltet die Dokumentation. Build via "make doc" Befehl im Verzeichnis. | | ├── ...
| ├── queries
| | ├── ...
│ ├── Dockerfile
| ├── index.js
| ├── package.json
│ ...
├── node-frontend
| ├── src
| | ├── controller
| | ├── ...
| | ├── public
| | ├── ...
| | ├── routes
| | ├── ...
| | ├── utils
| | ├── ...
| | ├── views
| | ├── ...
| ├── Dockerfile
| ├── index.js
| ├── package.json
├── openapi-nodejs
| ├── ...
├── docker-compose.yaml
├── postgres
│ ├── db
| | ├── createSchema.sql
| | ├── insertData.sql
| | ├── queries.sql
│ └── init
| ├── runAllScripts.sql
└── README.md
```
__Notiz:__ ich habe im main.tex folgende drei Linien zur Bibliography vorerst mal auskommentiert, da bei mir immer wieder Kompilierungsfehler aufgetreten sind: [docker-compose.yaml](docker-compose.yaml)
```yaml
services:
node-api:
container_name: node-api
restart: always
build: node-api
ports:
- 3000:3000 # used to make api available to host
...
depends_on:
- postgres
postgres:
container_name: postgres
restart: always
ports:
- 5432:5432 # used to make ports available to host - testing only!
...
expose: 5432 # used to make port available within docker-network
```
The compose file defines an application with two services `node-api` and `postgres`.
When deploying the application, docker-compose maps port 3000 of the frontend service container to port 3000 of the host as specified in the file.
Make sure port 3000 on the host is not already being in use.
%\addcontentsline{toc}{chapter}{Bibliography} ## Deploy with docker-compose
%\bibliographystyle{alpha} To start the application, navigate to the express-postgres folder and run
%\bibliography{bibliography} ```bash
$ sudo docker-compose up
```
to show all docker container log output.
To run the application in the background, use the switch -d:
```bash
$ sudo docker-compose up -d
```
## LaTeX Tips ## Check running application
Listing containers using `sudo docker ps` must show containers running and the port mapping as below:
```bash
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
06e606d69a0e node-api "docker-entrypoint.s…" 23 minutes ago Up 23 minutes 0.0.0.0:3000->3000/tcp node-api
a1f321f06490 postgres:alpine "docker-entrypoint.s…" 23 minutes ago Up 23 minutes 0.0.0.0:27017->27017/tcp postgres
```
### Positioning floats ## Stop and remove the containers
Use __Ctrl+C__ if the application has started in the foreground. This stops all running containers.
Tables, Images etc. sind sogenannte float-Objekte und werden von LaTeX scheinbar nach Lust und Laune platziert. ```bash
Am exaktesten da wo es hingehört scheint es jeweils mit dem Schalter [H] zu verbleiben. Stopping node-frontend ... done
```LaTeX Stopping node-api ... done
\begin{figure}[H] Stopping openapi-nodejs ... done
Stopping postgres ... done
``` ```
### Links auf Objekte im Dokument To recreate containers use `docker-compose down`, which will remove them entirely.
Im Text ein __ref__: ```bash
```latex Removing node-frontend ... done
bla text siehe Figure \ref{fig:usecasediagram} bla text.. Removing node-api ... done
``` Removing openapi-nodejs ... done
Im Figure Objekt ein __label__ am besten direkt nach der Caption: Removing postgres ... done
```latex Removing network express-postgres_frontend-api
\caption{Use Case} Removing network express-postgres_api-postgres
\label{fig:usecasediagram}
``` ```
## Rebuild an Image
To rebuild an image use `sudo docker-compose build` or `sudo docker-compose up --build`.
\ No newline at end of file
File moved
File moved
File moved
File moved
File moved
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment