Skip to content

Commit

Permalink
Merge dev in main (#540)
Browse files Browse the repository at this point in the history
* Bump @formkit/themes from 1.0.0-beta.9-f64c966 to 1.1.0 (#480)

Bumps [@formkit/themes](https://github.com/formkit/formkit/tree/HEAD/packages/themes) from 1.0.0-beta.9-f64c966 to 1.1.0.
- [Release notes](https://github.com/formkit/formkit/releases)
- [Commits](https://github.com/formkit/formkit/commits/1.1.0/packages/themes)

---
updated-dependencies:
- dependency-name: "@formkit/themes"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump docker/login-action from 2 to 3 (#463)

Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](docker/login-action@v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump docker/build-push-action from 4 to 5 (#462)

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@v4...v5)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @tailwindcss/typography from 0.5.9 to 0.5.10 (#461)

Bumps [@tailwindcss/typography](https://github.com/tailwindcss/typography) from 0.5.9 to 0.5.10.
- [Release notes](https://github.com/tailwindcss/typography/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss-typography/blob/master/CHANGELOG.md)
- [Commits](tailwindlabs/tailwindcss-typography@v0.5.9...v0.5.10)

---
updated-dependencies:
- dependency-name: "@tailwindcss/typography"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Revert "Bump docker/login-action from 2 to 3 (#463)" (#482)

This reverts commit fa703e2.

* Bump @formkit/vue from 1.0.0-beta.9-f64c966 to 1.1.0 (#479)

Bumps [@formkit/vue](https://github.com/formkit/formkit/tree/HEAD/packages/rules) from 1.0.0-beta.9-f64c966 to 1.1.0.
- [Release notes](https://github.com/formkit/formkit/releases)
- [Commits](https://github.com/formkit/formkit/commits/1.1.0/packages/rules)

---
updated-dependencies:
- dependency-name: "@formkit/vue"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @formkit/addons from 1.0.0-beta.9-f64c966 to 1.1.0 (#478)

Bumps [@formkit/addons](https://github.com/formkit/formkit/tree/HEAD/packages/addons) from 1.0.0-beta.9-f64c966 to 1.1.0.
- [Release notes](https://github.com/formkit/formkit/releases)
- [Commits](https://github.com/formkit/formkit/commits/1.1.0/packages/addons)

---
updated-dependencies:
- dependency-name: "@formkit/addons"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(readme): kubernetes link (#506)

* fix(readme): kubernetes link

* fix(readme): kubernetes link

* feat(readme): add devcontainer section (#507)

* feat(deploy): add aws s3 (#508)

* Titus tasks for gerolstein (#512)

* Update ddates

* Improve Module seeder logic

* Fix naming

* Add state logic

* Add modules to inertia share

* Linting

* Add random generaot backend

* Generate components

* Sort user by firstname

* Proof of Concept up and download from s3

* Image to s3 nearly done (req to controller not working)

* s3 Image Upload in user register and s3 show image funciton ready for use

* Remove outdated docs

* Add spatie permissions

* Remove dev code

* Migrate to rbac

* Update routes

* Fix drop col

* All comments implemented

* Add super admin role to prevent erros

* Add edit view

* Add link to old register/assigne page

* Add special role

* Add disabled flag

* Fix namings

* Add public api

* Improve user view

* Add missing if

* Add missing dependencies

* Improve S3 Implmentation

* Improvee admin ui

* Fix s3 logic

* Fix S3 logic

* Allow to edit super admins (except roles)

---------

Co-authored-by: DontEdit <[email protected]>
Co-authored-by: DontEdit <[email protected]>

* feat(github_actions): add docker e2e test (#513)

* feat(github_actions): add docker e2e test

* fix(github_actions/docker-e2e): event name typo

* fix(github_actions/docker-e2e): env file creation typo

* fix(docker-compose): adjust db connection typo

* fix(github_actions/docker-e2e): add missing env vars

* feat(github_actions/docker-e2e): change naming

* debug(github_actions/docker-e2e): add debug steps

* debug(github_actions/docker-e2e): remove redis connection

* update(docker): roadrunner (#519)

* fix(database/seeders): invalid and missing seeders (#520)

* fix(database/seeders): missing students seeder

* fix(database/seeders): bracket inside tutor seeder

* feat(database/seeders/tutor): switch delimiter and add disabled (#521)

* Fix/darkmode (#533)

* Fix darkmode

* lint code

* Feat/phil frontend (#532)

* Init Commit

* Pair programming
Co-authored-by: PhilPinsdorf

* Added Random Generator Frontend

* Removed Scaleup Animation because it is not used

* Fixed Font

* Fixed AvatarCard

* Fixed Transition Component

* Fixed single-file component element order

* Added Name for Display Route

* Set new Location for AvatarCard

* Fixed isFetchingRandomGenerator

* Fixed Naming

* Fixed Transiotin, Audio and added Riser

---------

Co-authored-by: Titus Kirch <[email protected]>

* Feat/add score system (#534)

* Init Commit

* Pair programming
Co-authored-by: PhilPinsdorf

* Added Random Generator Frontend

* Removed Scaleup Animation because it is not used

* Fix darkmode

* lint code

* Fixed Font

* Add scoresystem

* Fixed AvatarCard

* Fixed Transition Component

* Fixed single-file component element order

* Added Name for Display Route

* Set new Location for AvatarCard

* Fixed isFetchingRandomGenerator

* Fixed Naming

* Fixed Transiotin, Audio and added Riser

* Adjust display of name

* Regenerate components file

* Lint code and fix typo

---------

Co-authored-by: Phil Pinsdorf <[email protected]>

* feat/add user delete feature (#536)

* Add delete feature for super admins

* Fix message

* Add missing redirect back

* Feat/update authors in readme md #335 (#432)

* Add Martin Philemon Pinsdorf

* Fix typo

* Add Vitor

* Changed Gif (#537)

* Feat/improve audio (#538)

* Lint

* Fade out audio

* Update event data (#539)

* Update event data

* Fix wording

* Fix/hotfix 1 (#542)

* Remove >

* Fix naming of file

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Simon Ostendorf <[email protected]>
Co-authored-by: DontEdit <[email protected]>
Co-authored-by: DontEdit <[email protected]>
Co-authored-by: Phil Pinsdorf <[email protected]>
Co-authored-by: Phil Pinsdorf <[email protected]>
  • Loading branch information
7 people authored Oct 30, 2023
1 parent 69245cd commit 5c1e6c4
Show file tree
Hide file tree
Showing 147 changed files with 3,781 additions and 8,455 deletions.
5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// https://aka.ms/devcontainer.json
{
"name": "Laravel Sail",
"dockerComposeFile": ["../docker-compose.yml"],
"dockerComposeFile": ["../docker-compose.sail.yaml"],
"service": "laravel.test",
"workspaceFolder": "/var/www/html",
"customizations": {
Expand All @@ -20,7 +20,8 @@
"neilbrayfield.php-docblocker",
"steoates.autoimport",
"Vue.volar",
"xdebug.php-debug"
"xdebug.php-debug",
"github.copilot"
],
"settings": {}
}
Expand Down
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ APP_URL=http://localhost
APP_FORCE_HTTPS=false
APP_EVENT_TYPE=demo

APP_PUBLIC_API_SECRET=secret

TUTOR_PASSWORD=password
ADMIN_PASSWORD=admin

Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/docker-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Docker e2e Test

on:
pull_request: {}

env:
IMAGE_REGISTRY: ghcr.io
IMAGE_PATH: ${{ github.repository }}
IMAGE_TAG: ${{ github.ref_name }}

jobs:
e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Image
uses: docker/build-push-action@v5
with:
push: false
load: true
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:latest
- name: Create Environment
run: |
cat > .env << EOF
APP_NAME="Erstiwoche FB5"
APP_ENV=local
APP_KEY=1234567890ABCDEFGHIJ1234567890AB
APP_DEBUG=true
APP_URL=http://localhost
APP_FORCE_HTTPS=false
APP_EVENT_TYPE=demo
TUTOR_PASSWORD=password
ADMIN_PASSWORD=admin
LOG_CHANNEL=stack
LOG_LEVEL=debug
BROADCAST_DRIVER=log
CACHE_DRIVER=file # TODO
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file # TODO
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
OCTANE_HTTPS=false
OCTANE_WORKERS=1
OCTANE_MAX_REQUESTS=512
WWWGROUP=1000
WWWUSER=1000
OCTANE_SERVER=roadrunner
EOF
- name: Run Image
uses: isbang/[email protected]
with:
compose-file: "docker-compose.yaml"
down-flags: "--volumes"
- name: Wait
run: |
# wait 10 seconds for the docker container to start
sleep 10
- name: Run DB Seed
run: |
# run "php artisan migrate:fresh --seed" inside docker container
docker exec portals-web php artisan migrate:fresh --seed
- name: Debug
run: |
curl http://localhost:8000
- name: Test reachable
run: |
# test every 10 seconds if http://localhost:8000 is reachable and has a OK status code. Timeout after 2 minutes
timeout 120 bash -c 'until curl --output /dev/null --silent --head --fail http://localhost:8000; do printf "."; sleep 10; done'
6 changes: 3 additions & 3 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push (latest release)
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
if: ${{ github.event_name == 'release' && steps.latest_release.outputs.release == github.ref_name }} # run only on latest release
with:
push: true
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}, ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:latest
- name: Build and push (release)
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
if: ${{ github.event_name == 'release' && steps.latest_release.outputs.release != github.ref_name }} # run only on release (not latest)
with:
push: true
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}
- name: Build and push (push)
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
if: ${{ github.event_name == 'push' }} # run only on push (to dev)
with:
push: true
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# STAGE 1.1: Build JS with node
# --------------------------------------------

FROM ghcr.io/roadrunner-server/roadrunner:2023.2.2 AS roadrunner
FROM ghcr.io/roadrunner-server/roadrunner:2023.3.2 AS roadrunner
FROM node:16-alpine as node
WORKDIR /app

Expand Down
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ and the vite dev server:
npm run dev
```

### devcontainer

If you want to use the provided devcontainer via laravel sail you need vscode and the devcontainer extension.

### type generation

To generate the typescript types for the frontend, run:
Expand Down Expand Up @@ -139,7 +143,7 @@ docker exec -it portals-web php artisan migrate:fresh --seed

You can deploy the application to kubernetes using the helm chart.

See [fsr5-fhaachen/charts/portals](github.com/fsr5-fhaachen/charts/charts/portals/) for more information.
See [fsr5-fhaachen/charts/portals](https://github.com/fsr5-fhaachen/charts/tree/main/charts/portals) for more information.

If you want information about creating the kubernetes cluster, see [deploy information](./deploy).

Expand All @@ -150,22 +154,30 @@ If you want information about creating the kubernetes cluster, see [deploy infor
- Website: https://tkirch.dev/
- LinkedIn: [Titus Kirch](https://www.linkedin.com/in/tituskirch/)
- Twitter: [@TitusKirch](https://twitter.com/TitusKirch)
- Github: [@TitusKirch](https://github.com/TitusKirch)
- GitHub: [@TitusKirch](https://github.com/TitusKirch)

👤 **Benedikt Haas (main author)**

- LinkedIn: [Benedikt Haas](https://www.linkedin.com/in/benedikt-haas-ab698924a/)
- Github: [@BenediktHaas96](https://github.com/BenediktHaas96)
- GitHub: [@BenediktHaas96](https://github.com/BenediktHaas96)

👤 **Simon Ostendorf**

- LinkedIn: [Simon Ostendorf](https://www.linkedin.com/in/simonostendorf/)
- Github: [@simonostendorf](https://github.com/simonostendorf)
- GitHub: [@simonostendorf](https://github.com/simonostendorf)

👤 **Martin Philemon Pinsdorf**

- GitHub: [@PhilPinsdorf](https://github.com/PhilPinsdorf)

👤 **Vitor Macedo**

- GitHub: [@DontEdit](https://github.com/DontEdit)

👤 **Patrik Schmolke**

- LinkedIn: [Patrik Schmolke](https://www.linkedin.com/in/patrik-schmolke-612962175/)
- Github: [@Rec0gnice](https://github.com/Rec0gnice)
- GitHub: [@Rec0gnice](https://github.com/Rec0gnice)

Show here to see the full list of [contributors](https://github.com/fsr5-fhaachen/portals/graphs/contributors) who participated in this project.

Expand Down
76 changes: 74 additions & 2 deletions app/Http/Controllers/Api/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use App\Models\Course;
use App\Models\Event;
use App\Models\Registration;
use App\Models\State;
use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

Expand Down Expand Up @@ -211,7 +213,7 @@ public function coursesUserAmount(): JsonResponse
foreach ($courses as $course) {
$result[] = [
'id' => $course->id,
'amount' => $course->users()->where('is_tutor', false)->count(),
'amount' => $course->users()->doesntHave('roles')->count(),
];
}

Expand Down Expand Up @@ -242,10 +244,80 @@ public function coursesUserAmountPerEvent(Request $request): JsonResponse
foreach ($courses as $course) {
$result[] = [
'id' => $course->id,
'amount' => $course->users()->where('is_tutor', false)->whereIn('id', $userIds)->count(),
'amount' => $course->users()->doesntHave('roles')->whereIn('id', $userIds)->count(),
];
}

return response()->json($result);
}

/**
* Return the current state of the random generator.
* The state is structured like this:
* {
* "state": "setup", // setup, idle, running, stopped
* "user": null | User, // default null and if stopped, the user that was selected by the random generator
* }
*
* The definition of the states is as follows:
* setup: The random generator is not set up yet
* idle: The random generator is set up, but not running yet
* running: The random generator is running
* stopped: The random generator is stopped and a user was selected
*/
public function randomGeneratorState(): JsonResponse
{
// get state with key randomGenerator
$state = State::where('key', 'randomGenerator')->first();

// if state does not exist, return setup
if (! $state) {
return response()->json([
'state' => 'setup',
]);
}

return response()->json(json_decode($state->value));
}

/**
* Return the current state of the score system.
* The state is structured like this:
* {
* "teams": {
* "name": string;
* "score": string;
* }[];
* }
*/
public function scoreSystemState(): JsonResponse
{
// get state with key scoreSystem
$state = State::where('key', 'scoreSystem')->first();

// if state does not exist, return setup
if (! $state) {
return response()->json([
'teams' => [],
]);
}

return response()->json(json_decode($state->value));
}

/**
* Fresh users data
*/
public function users(): JsonResponse
{
$users = User::with('course', 'roles')->get()->map(function ($user) {
$user->avatarUrl = $user->avatarUrl();

return $user;
});

return response()->json([
'users' => $users,
]);
}
}
28 changes: 28 additions & 0 deletions app/Http/Controllers/Api/PublicApiController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Models\User;
use Illuminate\Http\JsonResponse;

class PublicApiController extends Controller
{
/**
* Returns all users.
*/
public function users(): JsonResponse
{
// get all users and get execute avatarUrl
$users = User::with('course', 'roles')->get()->map(function ($user) {
$user->avatarUrl = $user->avatarUrl();

return $user;
});

return response()->json([
'success' => true,
'users' => $users,
]);
}
}
Loading

0 comments on commit 5c1e6c4

Please sign in to comment.