adding new mindforge applications
All checks were successful
Mindforge API Build and Deploy / Build Mindforge API Image (push) Successful in 1m8s
Mindforge Cronjob Build and Deploy / Build Mindforge Cronjob Image (push) Successful in 1m19s
Mindforge API Build and Deploy / Deploy Mindforge API (internal) (push) Successful in 11s
Mindforge Cronjob Build and Deploy / Deploy Mindforge Cronjob (internal) (push) Successful in 10s
Mindforge Web Build and Deploy (internal) / Build Mindforge Web Image (push) Successful in 2m25s
Mindforge Web Build and Deploy (internal) / Deploy Mindforge Web (internal) (push) Successful in 12s

This commit is contained in:
2026-03-20 22:51:04 -03:00
parent 36e405a9a8
commit 3e09b03753
55 changed files with 4164 additions and 2 deletions

View File

@@ -0,0 +1,56 @@
const BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:5123';
export interface CheckFileRequest {
fileContent: string;
fileName: string;
checkType: 'language' | 'content';
}
export interface CheckFileResponse {
result: string;
}
export interface GenerateFlashcardsRequest {
fileContent: string;
fileName: string;
amount: number;
mode: FlashcardMode;
}
export type FlashcardMode = 'Basic' | 'Simple' | 'Detailed' | 'Hyper';
export interface GenerateFlashcardsResponse {
result: string;
}
export const MindforgeApiService = {
async checkFile(data: CheckFileRequest): Promise<CheckFileResponse> {
const response = await fetch(`${BASE_URL}/api/v1/file/check`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
});
if (!response.ok) {
throw new Error(`Error checking file: ${response.statusText}`);
}
return response.json();
},
async generateFlashcards(data: GenerateFlashcardsRequest): Promise<GenerateFlashcardsResponse> {
const response = await fetch(`${BASE_URL}/api/v1/flashcard/generate`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
});
if (!response.ok) {
throw new Error(`Error generating flashcards: ${response.statusText}`);
}
return response.json();
}
};