Skip to content

Commit

Permalink
feat: Added monorepo and semantic-release (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsrickert authored Mar 16, 2022
1 parent 3d12ad3 commit 304087f
Show file tree
Hide file tree
Showing 476 changed files with 62,674 additions and 14,801 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FRONTEND_DOMAIN=dhbw.rickstack.de
BACKEND_DOMAIN=api.rickstack.de
33 changes: 33 additions & 0 deletions .github/workflows/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Semantic pull request template

This repository uses [semantic release](https://semantic-release.gitbook.io/semantic-release/) for automatically managing changelogs, versions and GitHub releases. This PR must follow the below semantic release rules.

<br />

## Header

The title must follow the naming scheme `type(scope): Title`, e.g. `feat(component-xyz): Added click event`.

### Types

Available types can be found [here](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#type).

### Scopes

The scope is optional but you can set it e.g. to the component or feature that this PR is about. Setting the scope to `no-release` will not trigger a semantic release after the PR is merged.

<br />

## Body

Describe all important changes of this PR in present tense.

<br />

## Footer

Insert an empty line between the PR body (description) and the footer. The footer contains information about breaking changes and closed issues.

If the PR contains breaking changes (not backwards-compatible) you must add the keyword `BREAKING CHANGE:`. For example:

`BREAKING CHANGE: Removed property "myProp" from component XYZ`
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Semantic release
on:
push:
branches:
- main
- next
- beta
- alpha
workflow_dispatch:

jobs:
release_frontend:
name: Release frontend
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- name: Checkout Git repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install node modules
run: npm ci
- name: Build
run: npm run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

release_backend:
name: Release backend
needs: release_frontend
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- name: Checkout Git repository
uses: actions/checkout@v2
with:
fetch-depth: 0
# needed because backend release would fail if frontend release pushed new changes (e.g. CHANGELOG.md)
- name: Pull latest changes from frontend semantic-release
run: git pull
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: backend/package-lock.json
- name: Install node modules
run: npm ci
- name: Build
run: npm run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
30 changes: 15 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore
node_modules
.DS_Store
www
dist
*.local

*~
*.sw[mnpcod]
Expand All @@ -8,24 +11,21 @@
*.tmp.*
*.sublime-project
*.sublime-workspace
.DS_Store
Thumbs.db
UserInterfaceState.xcuserstate
$RECYCLE.BIN/

# Log files
logs
*.log
log.txt
npm-debug.log*

# Editor directories and files
/.idea
/.ionic
/.sass-cache
/.sourcemaps
/.versions
/.vscode
/coverage
/dist
/node_modules
/platforms
/plugins
/www
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

.eslintcache
40 changes: 32 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,53 @@
# Vorlesungsplan+ for the DHBW Mosbach

The app is live on: https://dhbw.rickstack.de

The api is live on: https://api.rickstack.de

<br />

# App

The Vorlesungsplan+ app is intended to be an alternative to the official stuv survival/stuv companion app of the DHBW
Mosbach. In contrast to the official app, this app offers a cross-platform unified look and feel. This app is a PWA (
Progressive Web App) that allows you to "install" the app to your native device. Alternatively this app is also
available as android app. The APK can be downloaded on https://dhbw.rickstack.de/installation.

This app is live on: https://dhbw.rickstack.de

## Features

1. Show all lectures for selected course at the DHBW Mosbach
2. Show upcoming events
3. Create and manage tasks that you need to do for your lectures
4. Cross-platform

## API
## Technologies

Vorlesungsplan+ is built with Angular (JavaScript Framework), Ionic Framework and Capacitor (tool for using native
features on web applications & wraps web app into native android and ios app).

<br />

# API

The Vorlesungsplan+ API is an Open Source Node.js API to request courses, lectures, events and more for the DHBW
Mosbach. This API is not an official API, but it uses the official StuV API for its data. You can use
this API in your own projects without annoying CORS errors.

For available endpoints and documentation, see https://api.rickstack.de/docs.

A custom API is used for receiving lectures, courses and events. For more details see: https://api.rickstack.de/docs.
## Features

1. Request courses, lectures and event at the DHBW Mosbach.
2. Caching layer that speeds up API calls up to 4 times in comparison to the official StuV API.
3. Open Source

## Technologies

Vorlesungsplan+ is built with Angular (JavaScript Framework), Ionic Framework and Capacitor (tool for using native
features on web applications & wraps web app into native android and ios app)
Vorlesungsplan+ API is build with Node.js, express and TypeScript.

<br />

## Contribution
# Contribution

If you want to contribute to this app you can create a pull request, contact me on Discord
or [email me](mailto:lar.rickert.19@lehre.mosbach.dhbw.de).
or [email me](mailto:dev@lars-rickert.de).
4 changes: 4 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
npm-debug.log
logs
dist
14 changes: 14 additions & 0 deletions backend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"env": {
"es2021": true,
"node": true
},
"extends": ["standard", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {}
}
3 changes: 3 additions & 0 deletions backend/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
node_modules
logs
5 changes: 5 additions & 0 deletions backend/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": false,
"printWidth": 120,
"tabWidth": 2
}
19 changes: 19 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## this is the stage one , also know as the build step
FROM node:15.13.0-alpine as build
WORKDIR /usr/src/app
COPY package*.json ./
COPY . ./
RUN npm ci
RUN npm run build

## this is stage two , where the app actually runs
FROM node:15.13.0-alpine

WORKDIR /usr/src/app
COPY package*.json ./
RUN npm ci --only=production
COPY --from=build /usr/src/app/dist ./dist

ENV PORT=3000
EXPOSE 3000
CMD ["npm", "start"]
File renamed without changes.
8 changes: 8 additions & 0 deletions backend/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"watch": [
"src"
],
"ext": ".ts",
"ignore": [],
"exec": "node -r ts-node/register ./src/server.ts"
}
Loading

0 comments on commit 304087f

Please sign in to comment.