feat: Add new data-manager service for professor and module management and a new frontend application with i18n and a professor dashboard.

This commit is contained in:
Elmar Kresse
2025-11-22 20:20:00 +01:00
parent 48926233d5
commit 34ad90d50d
19 changed files with 769 additions and 68 deletions

View File

@@ -0,0 +1,27 @@
import PocketBase from 'pocketbase';
// const domain = "cal.htwk-leipzig.de";
// const baseUri = "https://" + domain;
// For development, we might want to use the local backend
// const backendUrl = import.meta.env.DEV ? 'http://127.0.0.1:8090' : baseUri;
// But since we are running in docker, the frontend might be accessing the backend via a different URL or proxy.
// The existing code uses relative paths for API calls which go through the reverse proxy.
// PocketBase SDK needs a full URL or it defaults to /.
// If we are serving frontend from the same domain as backend (via proxy), / is fine.
// However, the proxy config shows backend at /api/ and pocketbase at /_/?
// Let's check reverseproxy.conf
export const pb = new PocketBase("/");
// Note: OAuth2 redirect URL should be configured in Keycloak/OIDC provider as:
// Development: http://localhost/callback
// Production: https://cal.htwk-leipzig.de/callback
export const login = async () => {
await pb.collection('users').authWithOAuth2({ provider: 'oidc' });
}
export const logout = () => {
pb.authStore.clear();
}