diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml
new file mode 100644
index 0000000..ffbecf5
--- /dev/null
+++ b/.github/workflows/build-container.yml
@@ -0,0 +1,24 @@
+name: Create and publish container
+on:
+ release:
+ types: [published]
+ workflow_dispatch:
+jobs:
+ build_container:
+ runs-on: ubuntu-latest
+ permissions:
+ packages: write
+ contents: read
+ steps:
+ - name: Check out Git repository
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ github.ref }}
+ - name: Build image
+ run: docker buildx build . --tag ghcr.io/studyphoenix/frontend --build-arg GIT_REF="$( git rev-parse HEAD )"
+ - name: Login to registry
+ run: |
+ echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
+ - name: Publish to GitHub Container Registry
+ run: |
+ docker push ghcr.io/studyphoenix/frontend
diff --git a/.github/workflows/update-types.yml b/.github/workflows/update-types.yml
new file mode 100644
index 0000000..fe43728
--- /dev/null
+++ b/.github/workflows/update-types.yml
@@ -0,0 +1,22 @@
+name: Update data types
+on:
+ workflow_dispatch:
+env:
+ BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
+jobs:
+ run_eslint:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ steps:
+ - name: Check out Git repository
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ env.BRANCH_NAME }}
+ persist-credentials: true
+ - name: Generate types
+ run: ./generate-types.yml ci
+ - name: Push changes back to repository
+ uses: stefanzweifel/git-auto-commit-action@v7
+ with:
+ commit_message: "chore: updated data types for API [skip ci]"
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..57cb183
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,19 @@
+FROM node:25-alpine3.21 AS build
+
+ARG GIT_REF="studyphoenix"
+
+# Frontend Build stage
+WORKDIR /usr/src/build
+
+ENV VITE_GIT_REF="${GIT_REF}"
+
+COPY . /usr/src/build
+
+RUN npm i
+RUN npm run build
+
+# Build final image
+FROM nginx AS prod
+COPY --from=build /usr/src/build/dist /usr/share/nginx/html
+COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
+EXPOSE 3000
diff --git a/compose.yml b/compose.yml
index 9a5451e..3fd5541 100644
--- a/compose.yml
+++ b/compose.yml
@@ -13,5 +13,10 @@ services:
restart: on-failure
ports:
- 8080:8080
+ environment:
+ DATA_DIR: /data
+ BACKEND_URL: http://localhost:8080
+ FRONTEND_URL: http://localhost:8081
+ DEFAULT_REDIRECT: http://localhost:8081
volumes:
- ./backend-data:/data
diff --git a/generate-types.sh b/generate-types.sh
index 474dd79..77960ef 100755
--- a/generate-types.sh
+++ b/generate-types.sh
@@ -1,6 +1,10 @@
#!/bin/bash
-if [[ $1 != "" ]]; then
+set -e
+
+if [[ $1 == "ci" ]]; then
+ npx --yes swagger-typescript-api@13.13.0 generate --path https://raw.githubusercontent.com/studyphoenix/backend/refs/heads/main/docs/swagger.json -o ./src/ts/types -n api.d.ts --no-client
+elif [[ $1 != "" ]]; then
npx swagger-typescript-api@13.13.0 generate --path http://$1:8080/swagger/doc.json -o ./src/ts/types -n api.d.ts --no-client
else
npx swagger-typescript-api@13.13.0 generate --path https://raw.githubusercontent.com/studyphoenix/backend/refs/heads/main/docs/swagger.json -o ./src/ts/types -n api.d.ts --no-client
diff --git a/launch.sh b/launch.sh
new file mode 100755
index 0000000..63f69cf
--- /dev/null
+++ b/launch.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -e
+docker compose pull
+docker compose down && docker compose up -d
diff --git a/nginx/default.conf b/nginx/default.conf
new file mode 100644
index 0000000..ac25660
--- /dev/null
+++ b/nginx/default.conf
@@ -0,0 +1,16 @@
+server {
+ listen 3000;
+ server_name localhost;
+
+ location / {
+ root /usr/share/nginx/html;
+ index index.html;
+ }
+
+ error_page 404 /index.html;
+
+ error_page 500 502 503 504 /50x.html;
+ location = /50x.html {
+ root /usr/share/nginx/html;
+ }
+}
diff --git a/package.json b/package.json
index f26f84a..b9440d0 100644
--- a/package.json
+++ b/package.json
@@ -14,7 +14,7 @@
},
"dependencies": {
"@fontsource/roboto": "^5.2.10",
- "@janishutz/oidc-login-sdk-browser": "^1.5.3",
+ "@janishutz/oidc-login-sdk-browser": "^1.7.0",
"@mdi/font": "7.4.47",
"pinia": "^3.0.4",
"vue": "^3.5.30",
diff --git a/run-lint.sh b/run-lint.sh
index bec200c..4b62bc9 100755
--- a/run-lint.sh
+++ b/run-lint.sh
@@ -1,6 +1,11 @@
#!/bin/bash
-docker run -v .:/mnt -e VITE_BACKENDLESS=true --name linter ghcr.io/janishutz/vue-dev-runner
-docker exec linter bash -c "npm run type-check && npm run lint-fix"
-docker stop linter
-docker rm linter
+if [[ $1 == "local" ]]; then
+ npm run lint-fix
+ npm run type-check
+else
+ docker run -v .:/mnt -e VITE_BACKENDLESS=true --name linter ghcr.io/janishutz/vue-dev-runner
+ docker exec linter bash -c "npm run lint-fix && npm run type-check"
+ docker stop linter
+ docker rm linter
+fi
diff --git a/src/components/SideBar.vue b/src/components/SideBar.vue
index c3769fd..2f7b3e7 100644
--- a/src/components/SideBar.vue
+++ b/src/components/SideBar.vue
@@ -1,9 +1,16 @@
@@ -15,10 +22,10 @@
@@ -33,18 +40,18 @@
href="/"
/>
@@ -59,7 +66,7 @@
diff --git a/src/components/authz/LoginProvider.vue b/src/components/authz/LoginProvider.vue
index 6d71037..20ddcbb 100644
--- a/src/components/authz/LoginProvider.vue
+++ b/src/components/authz/LoginProvider.vue
@@ -38,6 +38,7 @@
const profile: ControllerUserProfileResponse = await ( await sdk.request.get( '/user/profile' ) ).json();
store.username = profile.username;
+ store.email = profile.email;
router.push( '/app' );
};
diff --git a/src/components/authz/LogoutProvider.vue b/src/components/authz/LogoutProvider.vue
index 31940c4..decab5a 100644
--- a/src/components/authz/LogoutProvider.vue
+++ b/src/components/authz/LogoutProvider.vue
@@ -1,20 +1,50 @@
-
+
Log Out
+
+
+
+
+
+
+
+
diff --git a/src/router/index.ts b/src/router/index.ts
index aef6ca6..999b8b5 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -49,7 +49,7 @@ router.afterEach( to => {
'top': 0,
'behavior': 'smooth'
} );
- document.title = to.meta.title ? to.meta.title + ' - MusicPlayer' : 'MusicPlayer';
+ document.title = to.meta.title ? to.meta.title + ' - StudyPhoenix' : 'StudyPhoenix';
// NProgress.done();
} );
diff --git a/src/stores/authstore.ts b/src/stores/authstore.ts
index abc6be2..54260df 100644
--- a/src/stores/authstore.ts
+++ b/src/stores/authstore.ts
@@ -8,9 +8,11 @@ import {
export const useAuthStore = defineStore( 'authstore', () => {
const isAuth = ref( import.meta.env.PROD ? false : ( import.meta.env.VITE_BACKENDLESS == 'true' ? true : false ) );
const username = ref( '' );
+ const email = ref( '' );
return {
isAuth,
- username
+ username,
+ email
};
} );
diff --git a/src/ts/types/api.d.ts b/src/ts/types/api.d.ts
index 8957496..b4927ed 100644
--- a/src/ts/types/api.d.ts
+++ b/src/ts/types/api.d.ts
@@ -7,95 +7,206 @@
* ---------------------------------------------------------------
*/
-export interface ControllerCreateAssetRequest {
+export interface ControllerUserProfileResponse {
+ /** @example "jane.doe@example.com" */
+ 'email': string;
+ /** @example "My Nice Username" */
+ 'username': string;
+}
+
+export interface HttputilHTTPError {
+ /** @example 500 */
+ 'code': number;
+ /** @example "Error processing data due to db issue" */
+ 'message': string;
+}
+
+export interface ModelAddChatMessageRequest {
+ /** @example "Model's message" */
+ 'modelMessage': string;
/**
- * The Icon of the asset. Must be an icon that can be rendered in the browser
* @minLength 0
* @maxLength 250
- * @example "fa-gear"
+ * @example "test messages"
*/
- 'icon': string;
+ 'summary': string;
/**
- * The mediatype (formerly MIME type) of the asset. Will block replacement with asset of another type
- * @maxLength 250
- * @example "application/json"
+ * @minLength 3
+ * @maxLength 20000
+ * @example "User's message"
*/
+ 'userMessage': string;
+}
+
+export interface ModelAsset {
+ /** @example "fa-gear" */
+ 'icon': string;
+ 'id': number;
+ /** @example "application/pdf" */
'mediaType': string;
+ /** @example "my asset name" */
+ 'name': string;
+ /** @example "2027-01-01T00:00:00Z" */
+ 'updatedAt': string;
+}
+
+export interface ModelChat {
+ 'chatMessages': ModelChatMessage[];
+ /** @example 1 */
+ 'id': number;
/**
- * @minLength 3
- * @maxLength 250
- * @example "Analysis"
+ * the mode to be used for the UI
+ * @example 1
*/
+ 'mode': 1 | 2 | 3;
+ /** @example "My nice chat name" */
'name': string;
+ /** @example "2026-12-31T08:32:08Z" */
+ 'updatedAt': string;
}
-export interface ControllerCreateChatRequest {
+export interface ModelChatMessage {
+ /** @example 1 */
+ 'chatId': number;
+ /** @example 10 */
+ 'id': number;
+ /** @example "Certianly! This..." */
+ 'modelMessage': string;
+ /** @example "summary for this message pair" */
+ 'summary': string;
+ /** @example "2026-12-31T08:34:12Z" */
+ 'updatedAt': string;
+ /** @example "Explain why ..." */
+ 'userMessage': string;
+}
+
+export interface ModelCreateAssetRequest {
/**
- * The Icon of the chat. Must be an icon that can be rendered in the browser
+ * Must be a valid identifier for vuetify
* @minLength 0
* @maxLength 250
* @example "fa-gear"
*/
'icon': string;
/**
+ * The mediatype (formerly MIME type) of the asset. Will block replacement with asset of another type
+ * @minLength 3
+ * @maxLength 40
+ * @example "application/pdf"
+ */
+ 'mediaType': string;
+ /**
* @minLength 3
* @maxLength 250
- * @example "Analysis"
+ * @example "Analysis Script"
*/
'name': string;
}
-export interface ControllerCreateFlashcardRequest {
+export interface ModelCreateChatRequest {
+ /**
+ * @min 1
+ * @max 3
+ * @example 1
+ */
+ 'mode': 1 | 2 | 3;
+ /**
+ * @minLength 3
+ * @maxLength 100
+ * @example "Analysis Explanation"
+ */
+ 'name': string;
+}
+
+export interface ModelCreateFlashcardRequest {
/**
- * The Icon of the flashcard. Must be an icon that can be rendered in the browser
* @minLength 0
- * @maxLength 250
- * @example "fa-gear"
+ * @example "summarized content for this flashcard with everything needed for the model to ask sensible questions"
*/
- 'icon': string;
+ 'content': string;
/**
* @minLength 3
- * @maxLength 250
+ * @maxLength 100
* @example "Analysis"
*/
'name': string;
}
-export interface ControllerCreateSubjectRequest {
+export interface ModelCreateSubjectRequest {
/**
* The Icon of the subject. Must be an icon that can be rendered in the browser
* @minLength 0
- * @maxLength 250
+ * @maxLength 100
* @example "fa-gear"
*/
'icon': string;
/**
* @minLength 3
- * @maxLength 250
+ * @maxLength 100
* @example "Analysis"
*/
'name': string;
}
-export interface ControllerCreateSubtopicRequest {
+export interface ModelCreateSubtopicRequest {
/**
- * The Icon of the subtopic. Must be an icon that can be rendered in the browser
+ * The Icon of the subject. Must be an icon that can be rendered in the browser
* @minLength 0
- * @maxLength 250
+ * @maxLength 100
* @example "fa-gear"
*/
'icon': string;
/**
* @minLength 3
- * @maxLength 250
+ * @maxLength 100
* @example "Analysis"
*/
'name': string;
}
-export interface ControllerUpdateAssetRequest {
+export interface ModelFlashcard {
+ 'completionCount': number;
+ 'content': string;
+ 'id': number;
+ 'name': string;
+ /** @example "2026-12-17T13:47:33Z" */
+ 'updatedAt': string;
+}
+
+export interface ModelSettings {
+ /** @default false */
+ 'answerInBulletPoints': boolean;
+ /** @default "default" */
+ 'answerLength': 'very-short' | 'short' | 'default' | 'long' | 'very-long';
+}
+
+export interface ModelSubject {
+ 'assets'?: ModelAsset[];
+ /** @example "fa-gear" */
+ 'icon': string;
+ 'id': number;
+ /** @example "Analysis" */
+ 'name': string;
+ /** @example "2026-12-17T13:47:33Z" */
+ 'updatedAt': string;
+}
+
+export interface ModelSubtopic {
+ 'assets'?: ModelAsset[];
+ 'chats'?: ModelChat[];
+ /** @example "fa-gear" */
+ 'icon': string;
+ 'id': number;
+ /** @example "ordinary differential equations" */
+ 'name': string;
+ 'subtopics'?: ModelSubtopic[];
+ /** @example "2026-12-17T13:47:33Z" */
+ 'updatedAt': string;
+}
+
+export interface ModelUpdateAssetRequest {
/**
- * The Icon of the asset. Must be an icon that can be rendered in the browser
+ * Must be a valid identifier for vuetify
* @minLength 0
* @maxLength 250
* @example "fa-gear"
@@ -104,157 +215,92 @@ export interface ControllerUpdateAssetRequest {
/**
* @minLength 3
* @maxLength 250
- * @example "Analysis"
+ * @example "Analysis Script"
*/
'name'?: string;
}
-export interface ControllerUpdateChatRequest {
+export interface ModelUpdateChatMessageRequest {
+ /** @example "Model's message" */
+ 'modelMessage'?: string;
/**
- * The Icon of the chat. Must be an icon that can be rendered in the browser
* @minLength 0
* @maxLength 250
- * @example "fa-gear"
+ * @example "test messages"
*/
- 'icon'?: string;
+ 'summary'?: string;
/**
* @minLength 3
- * @maxLength 250
- * @example "Analysis"
+ * @maxLength 20000
+ * @example "User's message"
*/
- 'name'?: string;
+ 'userMessage'?: string;
}
-export interface ControllerUpdateFlashcardRequest {
+export interface ModelUpdateChatRequest {
/**
- * The Icon of the flashcard. Must be an icon that can be rendered in the browser
- * @minLength 0
- * @maxLength 250
- * @example "fa-gear"
+ * @min 1
+ * @max 3
+ * @example 2
*/
- 'icon'?: string;
+ 'mode'?: 1 | 2 | 3;
/**
* @minLength 3
- * @maxLength 250
- * @example "Analysis"
+ * @maxLength 100
+ * @example "Analysis Explanation"
*/
'name'?: string;
}
-export interface ControllerUpdateSubjectRequest {
+export interface ModelUpdateFlashcardRequest {
/**
- * The Icon of the subject. Must be an icon that can be rendered in the browser
* @minLength 0
- * @maxLength 250
- * @example "fa-gear"
+ * @example "summarized content for this flashcard with everything needed for the model to ask sensible questions"
*/
- 'icon'?: string;
+ 'content'?: string;
/**
* @minLength 3
- * @maxLength 250
- * @example "Analysis"
+ * @maxLength 100
+ * @example "ODEs"
*/
'name'?: string;
}
-export interface ControllerUpdateSubtopicRequest {
+export interface ModelUpdateSubjectRequest {
/**
- * The Icon of the subtopic. Must be an icon that can be rendered in the browser
+ * The Icon of the subject. Must be an icon that can be rendered in the browser
* @minLength 0
- * @maxLength 250
+ * @maxLength 100
* @example "fa-gear"
*/
'icon'?: string;
/**
* @minLength 3
- * @maxLength 250
+ * @maxLength 100
* @example "Analysis"
*/
'name'?: string;
}
-export interface ControllerUserProfileResponse {
- /** @example "My Nice Username" */
- 'username': string;
-}
-
-export interface HttputilHTTPError {
- /** @example 500 */
- 'code': number;
- /** @example "Error processing data due to db issue" */
- 'message': string;
-}
-
-export interface ModelAsset {
- /** @example "fa-gear" */
- 'icon': string;
- 'id': number;
- /** @example "application/pdf" */
- 'mediaType': string;
- /** @example "2027-01-01T00:00:00Z" */
- 'updatedAt': string;
-}
-
-export interface ModelChat {
- 'chatMessages': ModelChatMessage[];
- /** @example 1 */
- 'id': number;
+export interface ModelUpdateSubtopicRequest {
/**
- * the mode to be used for the UI
- * @example 0
+ * The Icon of the subject. Must be an icon that can be rendered in the browser
+ * @minLength 0
+ * @maxLength 100
+ * @example "fa-gear"
*/
- 'mode': 1 | 2 | 3;
- /** @example "My nice chat name" */
- 'name': string;
+ 'icon'?: string;
/**
- * The id of the subtopic it belongs to
- * @example 0
+ * @minLength 3
+ * @maxLength 100
+ * @example "Analysis"
*/
- 'subtopicId': number;
- /** @example "2026-12-31T08:32:08Z" */
- 'updatedAt': string;
-}
-
-export interface ModelChatMessage {
- /** @example 1 */
- 'chatId': number;
- /** @example "2026-12-31T08:32:08Z" */
- 'createdAt': string;
- /** @example "2026-12-31T08:34:12Z" */
- 'editedAt'?: string;
- /** @example 10 */
- 'id': number;
- /** @example "Certianly! This..." */
- 'modelMessage': string;
- /** @example "Explain why ..." */
- 'userMessage': string;
-}
-
-export interface ModelFlashcard {
- 'content': string;
- 'id': number;
- 'name': string;
- /** @example "2026-12-17T13:47:33Z" */
- 'updatedAt': string;
-}
-
-export interface ModelSubject {
- 'assets'?: ModelAsset[];
- 'id': number;
- /** @example "Analysis" */
- 'name': string;
- /** @example "2026-12-17T13:47:33Z" */
- 'updatedAt': string;
+ 'name'?: string;
}
-export interface ModelSubtopic {
- 'assets'?: ModelAsset[];
- 'chats'?: ModelChat[];
- 'flashcards'?: ModelFlashcard[];
- 'id': number;
- /** @example "ordinary differential equations" */
- 'name': string;
- 'subtopics'?: ModelSubtopic[];
- /** @example "2026-12-17T13:47:33Z" */
- 'updatedAt': string;
+export interface ModelUpdateUserConfigRequest {
+ /** @default false */
+ 'answerInBulletPoints'?: boolean;
+ /** @default "default" */
+ 'answerLength'?: 'very-short' | 'short' | 'default' | 'long' | 'very-long';
}