358 Zeilen
13 KiB
Plaintext
358 Zeilen
13 KiB
Plaintext
================================================================================
|
|
TASKMATE - GITEA-INTEGRATION IMPLEMENTIERUNGSPLAN
|
|
================================================================================
|
|
Erstellt: 28.12.2025
|
|
Status: In Bearbeitung
|
|
|
|
================================================================================
|
|
UEBERSICHT
|
|
================================================================================
|
|
|
|
Neuer "Gitea"-Tab neben Board, Liste, Kalender, Genehmigung fuer die
|
|
Git-Repository-Verwaltung pro Projekt.
|
|
|
|
KERNKONZEPT: Jedes TaskMate-Projekt = Ein Git-Repository
|
|
|
|
Workflow:
|
|
1. Projekt in TaskMate erstellen/auswaehlen
|
|
2. Gitea-Repository verknuepfen (bestehend oder neu erstellen)
|
|
3. Lokales Verzeichnis angeben (wo Claude Code arbeitet)
|
|
4. Git-Operationen ausfuehren (Pull, Push, Commit, etc.)
|
|
|
|
================================================================================
|
|
AKTUELLER STAND (VOR IMPLEMENTIERUNG)
|
|
================================================================================
|
|
|
|
BACKEND - Bereits implementiert (aber NICHT aktiviert!):
|
|
[x] backend/services/giteaService.js - Gitea API Integration
|
|
[x] backend/services/gitService.js - Lokale Git-Operationen
|
|
[x] backend/routes/git.js - 11 Git-Endpoints
|
|
[x] backend/routes/applications.js - Projekt-Repository-Verknuepfung
|
|
[x] Datenbank-Tabelle "applications" vorhanden
|
|
|
|
KRITISCHER BUG:
|
|
[ ] Routes sind in server.js NICHT registriert - API funktioniert nicht!
|
|
|
|
FRONTEND - Fehlt komplett:
|
|
[ ] Kein Gitea-Tab
|
|
[ ] Keine UI fuer Repository-Verwaltung
|
|
[ ] Keine Git-Operationen im Frontend
|
|
|
|
================================================================================
|
|
IMPLEMENTIERUNGSSCHRITTE
|
|
================================================================================
|
|
|
|
PHASE 1: BACKEND AKTIVIEREN
|
|
--------------------------------------------------------------------------------
|
|
|
|
Schritt 1.1: Routes in server.js registrieren
|
|
Datei: backend/server.js
|
|
|
|
Imports hinzufuegen:
|
|
const gitRoutes = require('./routes/git');
|
|
const applicationsRoutes = require('./routes/applications');
|
|
const giteaRoutes = require('./routes/gitea');
|
|
|
|
Routes registrieren:
|
|
app.use('/api/git', authenticateToken, csrfProtection, gitRoutes);
|
|
app.use('/api/applications', authenticateToken, csrfProtection, applicationsRoutes);
|
|
app.use('/api/gitea', authenticateToken, csrfProtection, giteaRoutes);
|
|
|
|
Status: [ ] Ausstehend
|
|
|
|
Schritt 1.2: Neue Gitea-Route erstellen
|
|
Datei: backend/routes/gitea.js (NEU)
|
|
|
|
Endpoints:
|
|
- GET /api/gitea/test - Verbindung testen
|
|
- GET /api/gitea/repositories - Alle Repos auflisten
|
|
- POST /api/gitea/repositories - Neues Repo erstellen
|
|
- GET /api/gitea/repositories/:owner/:repo - Repo-Details
|
|
- GET /api/gitea/repositories/:owner/:repo/branches - Branches
|
|
- GET /api/gitea/repositories/:owner/:repo/commits - Commits
|
|
|
|
Status: [ ] Ausstehend
|
|
|
|
--------------------------------------------------------------------------------
|
|
PHASE 2: FRONTEND API ERWEITERN
|
|
--------------------------------------------------------------------------------
|
|
|
|
Schritt 2.1: API-Client erweitern
|
|
Datei: frontend/js/api.js
|
|
|
|
Neue Methoden:
|
|
// Gitea
|
|
testGiteaConnection()
|
|
getGiteaRepositories()
|
|
createGiteaRepository(data)
|
|
getGiteaRepository(owner, repo)
|
|
getGiteaBranches(owner, repo)
|
|
getGiteaCommits(owner, repo, options)
|
|
|
|
// Applications
|
|
getProjectApplication(projectId)
|
|
saveProjectApplication(data)
|
|
deleteProjectApplication(projectId)
|
|
getUserBasePath()
|
|
setUserBasePath(basePath)
|
|
|
|
// Git Operations
|
|
cloneRepository(data)
|
|
getGitStatus(projectId)
|
|
gitPull(projectId, branch)
|
|
gitPush(projectId, branch)
|
|
gitCommit(projectId, message, stageAll)
|
|
getGitCommits(projectId, limit)
|
|
getGitBranches(projectId)
|
|
gitCheckout(projectId, branch)
|
|
gitFetch(projectId)
|
|
validatePath(path)
|
|
|
|
Status: [ ] Ausstehend
|
|
|
|
--------------------------------------------------------------------------------
|
|
PHASE 3: HTML-STRUKTUR
|
|
--------------------------------------------------------------------------------
|
|
|
|
Schritt 3.1: Navigation-Tab hinzufuegen
|
|
Datei: frontend/index.html
|
|
|
|
Nach proposals-Tab einfuegen:
|
|
<button class="view-tab" data-view="gitea">Gitea</button>
|
|
|
|
Status: [ ] Ausstehend
|
|
|
|
Schritt 3.2: Gitea-View hinzufuegen
|
|
Datei: frontend/index.html
|
|
|
|
Struktur:
|
|
<div id="view-gitea" class="view view-gitea hidden">
|
|
|
|
<!-- Konfiguration (wenn nicht verknuepft) -->
|
|
<div id="gitea-config-section">
|
|
- Gitea-Verbindungsstatus
|
|
- Repository-Dropdown (bestehende auswaehlen)
|
|
- "Neues Repository erstellen" Button
|
|
- Lokaler Pfad Eingabe
|
|
- Standard-Branch
|
|
- Speichern Button
|
|
</div>
|
|
|
|
<!-- Hauptansicht (wenn verknuepft) -->
|
|
<div id="gitea-main-section">
|
|
- Repository-Name und URL
|
|
- Aktueller Branch (Dropdown)
|
|
- Status-Badge (Clean/Dirty/Ahead/Behind)
|
|
- Git-Operationen (Fetch, Pull, Push, Commit)
|
|
- Aenderungen-Liste
|
|
- Commit-Historie
|
|
</div>
|
|
|
|
<!-- Leer-Zustand -->
|
|
<div id="gitea-no-project">
|
|
Kein Projekt ausgewaehlt
|
|
</div>
|
|
|
|
</div>
|
|
|
|
Status: [ ] Ausstehend
|
|
|
|
Schritt 3.3: Modals hinzufuegen
|
|
Datei: frontend/index.html
|
|
|
|
- #git-commit-modal - Commit-Nachricht eingeben
|
|
- #create-repo-modal - Neues Repository erstellen
|
|
|
|
Status: [ ] Ausstehend
|
|
|
|
--------------------------------------------------------------------------------
|
|
PHASE 4: CSS-STYLES
|
|
--------------------------------------------------------------------------------
|
|
|
|
Schritt 4.1: Gitea-Styles erstellen
|
|
Datei: frontend/css/gitea.css (NEU)
|
|
|
|
Styles fuer:
|
|
- .view-gitea - Hauptcontainer
|
|
- .gitea-section - Sektionen
|
|
- .gitea-connection-status - Verbindungsanzeige
|
|
- .gitea-repo-header - Repository-Header
|
|
- .gitea-status-panel - Status-Grid
|
|
- .status-badge - Clean/Dirty/Ahead Badges
|
|
- .gitea-operations-panel - Button-Grid
|
|
- .changes-list - Geaenderte Dateien
|
|
- .commits-list - Commit-Historie
|
|
- .gitea-empty-state - Leer-Zustand
|
|
|
|
Status: [ ] Ausstehend
|
|
|
|
Schritt 4.2: CSS in index.html einbinden
|
|
<link rel="stylesheet" href="css/gitea.css">
|
|
|
|
Status: [ ] Ausstehend
|
|
|
|
--------------------------------------------------------------------------------
|
|
PHASE 5: GITEA MANAGER
|
|
--------------------------------------------------------------------------------
|
|
|
|
Schritt 5.1: Gitea Manager erstellen
|
|
Datei: frontend/js/gitea.js (NEU)
|
|
|
|
Klasse GiteaManager:
|
|
Properties:
|
|
- application (Projekt-Repository-Verknuepfung)
|
|
- gitStatus (Aktueller Git-Status)
|
|
- branches (Verfuegbare Branches)
|
|
- commits (Commit-Historie)
|
|
- giteaRepos (Gitea-Repositories)
|
|
- giteaConnected (Verbindungsstatus)
|
|
|
|
Methoden:
|
|
- init() - Initialisierung
|
|
- bindEvents() - Event-Listener
|
|
- subscribeToStore() - Store-Subscriptions
|
|
- loadApplication() - Anwendung laden
|
|
- loadGitData() - Git-Daten laden
|
|
- loadGiteaRepos() - Gitea-Repos laden
|
|
- renderConfigurationView() - Konfig-Ansicht
|
|
- renderConfiguredView() - Hauptansicht
|
|
- renderStatus() - Status rendern
|
|
- renderBranches() - Branches rendern
|
|
- renderCommits() - Commits rendern
|
|
- renderChanges() - Aenderungen rendern
|
|
- handleConfigSave() - Konfig speichern
|
|
- handleRepoSelect() - Repo auswaehlen
|
|
- handleBranchChange() - Branch wechseln
|
|
- handleFetch/Pull/Push/Commit() - Git-Ops
|
|
- validateLocalPath() - Pfad validieren
|
|
- show()/hide() - View-Kontrolle
|
|
- startAutoRefresh() - Auto-Refresh
|
|
|
|
Status: [ ] Ausstehend
|
|
|
|
--------------------------------------------------------------------------------
|
|
PHASE 6: APP-INTEGRATION
|
|
--------------------------------------------------------------------------------
|
|
|
|
Schritt 6.1: Manager in app.js integrieren
|
|
Datei: frontend/js/app.js
|
|
|
|
Import:
|
|
import giteaManager from './gitea.js';
|
|
|
|
In initializeApp():
|
|
await giteaManager.init();
|
|
|
|
In switchView():
|
|
if (view === 'gitea') {
|
|
giteaManager.show();
|
|
} else {
|
|
giteaManager.hide();
|
|
}
|
|
|
|
Status: [ ] Ausstehend
|
|
|
|
--------------------------------------------------------------------------------
|
|
PHASE 7: FINALISIERUNG
|
|
--------------------------------------------------------------------------------
|
|
|
|
Schritt 7.1: Service Worker aktualisieren
|
|
Datei: frontend/sw.js
|
|
|
|
- Cache-Version erhoehen
|
|
- gitea.js und gitea.css zum Cache hinzufuegen
|
|
|
|
Status: [ ] Ausstehend
|
|
|
|
Schritt 7.2: CHANGELOG.txt aktualisieren
|
|
Dokumentation der neuen Gitea-Integration
|
|
|
|
Status: [ ] Ausstehend
|
|
|
|
Schritt 7.3: Docker-Container neu bauen und testen
|
|
docker compose down
|
|
docker compose up --build -d
|
|
|
|
Status: [ ] Ausstehend
|
|
|
|
================================================================================
|
|
UI-MOCKUP: GITEA-TAB
|
|
================================================================================
|
|
|
|
+------------------------------------------------------------------+
|
|
| [Board] [Liste] [Kalender] [Genehmigung] [Gitea] |
|
|
+------------------------------------------------------------------+
|
|
| |
|
|
| +------------------------------------------------------------+ |
|
|
| | IntelSight/AccountForger-neuerUpload [Edit][X] | |
|
|
| | https://gitea-undso.aegis-sight.de/... | |
|
|
| +------------------------------------------------------------+ |
|
|
| |
|
|
| +------------------------------------------------------------+ |
|
|
| | Branch: [main v] Status: Clean Aenderungen: 0 | |
|
|
| | Letzte Sync: vor 5 Minuten | |
|
|
| +------------------------------------------------------------+ |
|
|
| |
|
|
| +------------------------------------------------------------+ |
|
|
| | Git-Operationen | |
|
|
| | [Fetch] [Pull] [Push] [Commit] | |
|
|
| +------------------------------------------------------------+ |
|
|
| |
|
|
| +------------------------------------------------------------+ |
|
|
| | Letzte Commits | |
|
|
| | +--------------------------------------------------------+ | |
|
|
| | | [a1b2c3d] Fix: Login-Bug behoben | | |
|
|
| | | HG - vor 2 Stunden | | |
|
|
| | +--------------------------------------------------------+ | |
|
|
| | | [e4f5g6h] Feature: Neue Filteroptionen | | |
|
|
| | | MH - vor 1 Tag | | |
|
|
| | +--------------------------------------------------------+ | |
|
|
| +------------------------------------------------------------+ |
|
|
| |
|
|
+------------------------------------------------------------------+
|
|
|
|
================================================================================
|
|
KRITISCHE DATEIEN
|
|
================================================================================
|
|
|
|
Datei | Aktion
|
|
-------------------------------|------------------------------------------
|
|
backend/server.js | Routes registrieren (KRITISCH!)
|
|
backend/routes/gitea.js | NEU erstellen
|
|
frontend/js/api.js | Erweitern
|
|
frontend/js/gitea.js | NEU erstellen
|
|
frontend/css/gitea.css | NEU erstellen
|
|
frontend/index.html | View + Tab + Modals
|
|
frontend/js/app.js | Import + Integration
|
|
frontend/sw.js | Cache-Version erhoehen
|
|
CHANGELOG.txt | Dokumentieren
|
|
|
|
================================================================================
|
|
IMPLEMENTIERUNGS-REIHENFOLGE (CHECKLISTE)
|
|
================================================================================
|
|
|
|
[ ] 1. Backend: Routes in server.js registrieren
|
|
[ ] 2. Backend: gitea.js Route erstellen
|
|
[ ] 3. Frontend: api.js erweitern
|
|
[ ] 4. Frontend: index.html (View + Tab + Modals)
|
|
[ ] 5. Frontend: gitea.css erstellen
|
|
[ ] 6. Frontend: gitea.js Manager erstellen
|
|
[ ] 7. Frontend: app.js Integration
|
|
[ ] 8. Service Worker aktualisieren
|
|
[ ] 9. CHANGELOG.txt aktualisieren
|
|
[ ] 10. Docker-Container neu bauen und testen
|
|
|
|
================================================================================
|
|
KONFIGURATION (BEREITS VORHANDEN)
|
|
================================================================================
|
|
|
|
.env Datei:
|
|
GITEA_URL=https://gitea-undso.aegis-sight.de
|
|
GITEA_TOKEN=8d76ec66b3e1f02e9b1e4848d8b15e0cdffe48df
|
|
|
|
Beispiel-Repository:
|
|
Organisation: IntelSight
|
|
Name: AccountForger-neuerUpload
|
|
|
|
================================================================================
|