Skip to content

Commit

Permalink
Initial content
Browse files Browse the repository at this point in the history
todo: istio,
  • Loading branch information
TobiasOetzel committed Jun 26, 2024
0 parents commit c503855
Show file tree
Hide file tree
Showing 60 changed files with 14,676 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*

!frontend/package.json
!frontend/package-lock.json
!frontend/src/**

!backend/package.json
!backend/package-lock.json
!backend/src/**


!tsconfig.app.json
!tsconfig.json
!angular.json
15 changes: 15 additions & 0 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: pipe
on: [push]

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
pipe:
uses: openmfp/gha/.github/workflows/pipeline-node-app.yml@main
secrets: inherit
with:
imageTagName: ghcr.io/openmfp/demo-content
componentVersionKey: demo-content
release_branch: main
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db

node_modules
dist
.angular
4 changes: 4 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
"recommendations": ["angular.ng-template"]
}
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "ng serve",
"type": "chrome",
"request": "launch",
"preLaunchTask": "npm: start",
"url": "http://localhost:4200/"
},
{
"name": "ng test",
"type": "chrome",
"request": "launch",
"preLaunchTask": "npm: test",
"url": "http://localhost:9876/debug.html"
}
]
}
42 changes: 42 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "start",
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "(.*?)"
},
"endsPattern": {
"regexp": "bundle generation complete"
}
}
}
},
{
"type": "npm",
"script": "test",
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "(.*?)"
},
"endsPattern": {
"regexp": "bundle generation complete"
}
}
}
}
]
}
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:20.11 as build

COPY frontend/package.json frontend/package-lock.json /app/frontend/
COPY backend/package.json backend/package-lock.json /app/backend/

WORKDIR /app/backend
RUN npm ci

WORKDIR /app/frontend
RUN npm ci

COPY /frontend ./
RUN npm run build

WORKDIR /app/backend
RUN npm run build

FROM node:20.11.0-alpine

# Applications
COPY --from=build /app /app

WORKDIR /app/backend
EXPOSE 8080

CMD ["node", "dist/index"]
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# ExampleContent

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.3.8.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
23 changes: 23 additions & 0 deletions backend/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
var finalhandler = require('finalhandler')
var http = require('http')
var serveStatic = require('serve-static')

var serve = serveStatic('../frontend/dist/example-content/browser', {
index: false,
setHeaders: setHeaders
})

// Set header to force download
function setHeaders (res, path) {
res.setHeader('Access-Control-Allow-Origin', '*')
}

// Create server
var server = http.createServer(function onRequest (req, res) {
serve(req, res, finalhandler(req, res))
})

// Listen
let PORT = process.env.PORT || 8080;
server.listen(PORT)
console.log(`Server listening on port ${PORT}`)
Loading

0 comments on commit c503855

Please sign in to comment.