-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Add university sports mutation and resolver with database integration * refactor: Remove unused university sports mutation and resolvers; add caching for parking, charging, bus, train, and cl-events queries * refactor: Replace create and update university sports mutations with a single upsert mutation * feat: Add upsert and delete mutations for app announcements with GraphQL integration * refactor: Update CI workflow to use Bun for package management and linting * feat: Update app announcements and university sports mutations to use Unix timestamps for date fields * adds jwt check * feat: Enhance authentication handling by assigning default role for unauthenticated users * feat: Update database connection to use Bun environment variables and enhance authorization checks * feat: Integrate graphql-scalars for enhanced date handling in announcements and university sports * feat: Update schema to use EmailAddress scalar and enhance documentation configuration * feat: Refactor linting configuration and improve type safety in scraping and utility functions * Adds Drizzle * feat: Refactor database schema and migrations for app announcements and university sports * feat: Update authentication handling to support multiple roles and adjust related migrations * 🐛 fix deleteUniversitySport * feat: Enhance JWT verification by fetching public key from JWKS endpoint * 🩹 fix token deconstruction * feat: Add created_at and updated_at fields to app_announcements and update related migrations * feat: Deprecate announcements query and introduce appAnnouncements query with updated timestamps * 🔧 update misc files * 🐛 fix food API * 📦 update bun.lockb * fix: Update organizer formatting to handle 'e. V.' abbreviation --------- Co-authored-by: Philipp Opheys <philipp@opheys.dev>
- Loading branch information
1 parent
76de996
commit 86d1e11
Showing
52 changed files
with
2,821 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.env | ||
Dockerfile | ||
.dockerignore | ||
node_modules | ||
npm-debug.log | ||
README.md | ||
.next | ||
.git | ||
/data/* | ||
.huksy | ||
.github | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
DEEPL_API_KEY="" | ||
MOODLE_USERNAME="" | ||
MOODLE_PASSWORD="" | ||
MOODLE_PASSWORD="" | ||
DB_HOST=localhost | ||
DB_PORT=5432 | ||
POSTGRES_DB=app | ||
POSTGRES_USER=postgres | ||
POSTGRES_PASSWORD="" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: ['main', 'develop'] | ||
branches: [develop, main] | ||
pull_request: | ||
branches: [develop, main] | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
- uses: oven-sh/setup-bun@v2 | ||
with: | ||
node-version: 20 | ||
bun-version: latest | ||
- uses: actions/checkout@v4 | ||
- name: Install modules | ||
run: npm install | ||
run: bun install | ||
- name: Run ESLint | ||
run: npx eslint . --ext .js,.jsx,.ts,.tsx | ||
run: bunx eslint . | ||
- name: Run Prettier | ||
run: npx prettier --check . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ node_modules | |
.DS_Store | ||
src/data/announcements.json | ||
src/data/cl-events.json | ||
database/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
version: '3.8' | ||
|
||
services: | ||
app: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import pluginJs from '@eslint/js' | ||
import globals from 'globals' | ||
import tseslint from 'typescript-eslint' | ||
|
||
export default [ | ||
{ ignores: ['**/node_modules', '**/documentation'] }, | ||
{ files: ['**/*.{js,mjs,cjs,ts}'] }, | ||
{ languageOptions: { globals: globals.browser } }, | ||
pluginJs.configs.recommended, | ||
...tseslint.configs.recommended, | ||
{ | ||
languageOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
parserOptions: { | ||
tsconfigRootDir: './', | ||
noUnusedLocals: true, | ||
noUnusedParameters: true, | ||
}, | ||
}, | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { drizzle } from 'drizzle-orm/postgres-js' | ||
import postgres from 'postgres' | ||
|
||
import schema from './schema' | ||
|
||
export const CONNECTION_STRING = `postgres://${process.env.POSTGRES_USER}:${process.env.POSTGRES_PASSWORD}@${process.env.DB_HOST}:${process.env.DB_PORT}/${process.env.POSTGRES_DB}` | ||
|
||
const queryClient = postgres(CONNECTION_STRING, { max: 1 }) | ||
|
||
export const db = drizzle(queryClient, { schema }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { drizzle } from 'drizzle-orm/postgres-js' | ||
import { migrate } from 'drizzle-orm/postgres-js/migrator' | ||
import postgres from 'postgres' | ||
|
||
import { CONNECTION_STRING } from '.' | ||
|
||
async function main() { | ||
const client = postgres(CONNECTION_STRING, { max: 1 }) | ||
await migrate(drizzle(client), { migrationsFolder: './src/db/migrations' }) | ||
|
||
await client.end() | ||
} | ||
|
||
main().catch((err) => { | ||
console.error(err) | ||
process.exit(1) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
DO $$ BEGIN | ||
CREATE TYPE "public"."campus" AS ENUM('Ingolstadt', 'Neuburg'); | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
CREATE TYPE "public"."weekday" AS ENUM('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'); | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "app_announcements" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"title_de" text NOT NULL, | ||
"title_en" text NOT NULL, | ||
"description_de" text NOT NULL, | ||
"description_en" text NOT NULL, | ||
"start_date_time" timestamp with time zone NOT NULL, | ||
"end_date_time" timestamp with time zone NOT NULL, | ||
"priority" integer NOT NULL, | ||
"url" text | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "university_sports" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"title_de" text NOT NULL, | ||
"description_de" text, | ||
"title_en" text NOT NULL, | ||
"description_en" text, | ||
"campus" "campus" NOT NULL, | ||
"location" text NOT NULL, | ||
"weekday" "weekday" NOT NULL, | ||
"start_time" time NOT NULL, | ||
"end_time" time, | ||
"requires_registration" boolean NOT NULL, | ||
"invitation_link" text, | ||
"e_mail" text, | ||
"created_at" timestamp with time zone NOT NULL, | ||
"updated_at" timestamp with time zone NOT NULL | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE "app_announcements" ADD COLUMN "created_at" timestamp with time zone NOT NULL;--> statement-breakpoint | ||
ALTER TABLE "app_announcements" ADD COLUMN "updated_at" timestamp with time zone NOT NULL; |
Oops, something went wrong.