/ opencodehub / todo.txt
swadhinbiswas Initial commit of OpenCodeHub source · 12/11/2025
1110042
63 lines · 4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# OpenCodeHub Production Readiness Todo List

## 1. Missing Core Pages (Critical)
- [ ] **Authentication**
  - [x] `src/pages/login.astro`: Real login form with CSRF protection.
  - [x] `src/pages/register.astro`: Registration form with email verification flow.
  - [x] `src/pages/password-reset.astro`: Forgot password flow.
- [x] **User Dashboard**
  - [x] `src/pages/dashboard.astro`: Logged-in user's homepage (activity feed, my repos).
  - [x] `src/pages/[owner]/index.astro`: Public user profile (pinned repos, contribution graph).
  - [x] `src/pages/settings/profile.astro`: User settings (profile, account, security, SSH keys).
- [x] **Repository Management**
  - [x] `src/pages/new.astro`: Create new repository wizard.
  - [x] `src/pages/[owner]/[repo]/index.astro`: Main repo view (file tree, README).
  - [x] `src/pages/[owner]/[repo]/issues/index.astro`: Issue tracker list.
  - [x] `src/pages/[owner]/[repo]/pulls/index.astro`: Pull request list.
  - [x] `src/pages/[owner]/[repo]/settings/index.astro`: Repository settings (collaborators, webhooks).

## 2. Authentication & Security
- [x] **Middleware**: Create `src/middleware.ts` to validate sessions and populate `Astro.locals.user`.
- [x] **Session Management**: Implement secure HTTP-only cookies for session tokens.
- [x] **RBAC**: Implement Role-Based Access Control for repository settings (Owner vs Maintainer vs Reader).
- [x] **2FA Enforcement**: Enforce 2FA for admin accounts.

## 3. GitHub UI/UX Parity
- [x] **Navigation**: Implement GitHub-style tabbed navigation for repositories (Code, Issues, Pull Requests, Actions, Projects, Wiki, Security, Insights, Settings).
- [x] **File Explorer**: Create a dynamic file tree component (like `src/components/git/FileTree.tsx`) that fetches data from the git backend.
- [x] **Code Viewer**: Implement syntax highlighting using `shiki` or `prismjs` for the blob view.
- [x] **Markdown Rendering**: Use `remark` and `rehype` to render READMEs and comments with GitHub Flavored Markdown (GFM).

## 4. Infrastructure & Scalability
- [ ] **Database Abstraction**: Refactor `src/db/index.ts` to support PostgreSQL and MySQL via environment variables (currently hardcoded to SQLite).
- [ ] **Caching Layer**: Implement a Redis service for caching repository metadata, user sessions, and API responses.
- [ ] **Message Queue**: Integrate BullMQ or Redis Streams for background job processing (webhooks, CI/CD, git garbage collection).
- [x] **Object Storage**: Implement S3-compatible storage adapter for Git LFS and CI/CD artifacts (currently local filesystem only).

## 5. Git Features
- [x] **Smart HTTP Protocol**: Implement `git-upload-pack` and `git-receive-pack` handlers for HTTP/HTTPS cloning support.
- [x] **Git LFS Support**: Add server-side support for Git Large File Storage (LFS) API.
- [x] **Git Hooks**: Implement server-side hooks (pre-receive, post-receive) to trigger webhooks and CI/CD pipelines reliably.
- [x] **Garbage Collection**: Create a scheduled job to run `git gc` on repositories to optimize size and performance.

## 6. CI/CD Pipeline
- [x] **Runner Isolation**: Secure the Docker runner implementation in `src/lib/pipeline.ts` to prevent container escapes or resource exhaustion.
- [x] **Log Streaming**: Implement real-time log streaming from runner to frontend using WebSockets.
- [x] **Artifact Management**: Add APIs to upload and download build artifacts with retention policies.

## 7. Observability & Monitoring
- [x] **Structured Logging**: Replace `console.log` with a structured logger (e.g., Pino) that outputs JSON.
- [x] **Metrics Endpoint**: Add a `/metrics` endpoint exposing Prometheus-compatible metrics (request latency, DB connection pool, active runners).

## 8. Future Roadmap
- [ ] **Webhooks System**: Infrastructure to send HTTP POST requests to external services (Critical for integrations).
- [ ] **Advanced Code Search**: Integration with search engines (Elasticsearch/ZincSearch) for indexed code search.
- [ ] **Package Registry**: Support for hosting packages (npm, Docker container registry, Maven, Nuget).
- [ ] **GitHub Pages**: System to build and serve static websites from repositories.
- [x] **Tracing**: Integrate OpenTelemetry to trace requests across API, Database, and Git subsystems.

## 8. Testing
- [x] **Unit Tests**: Add Jest/Vitest unit tests for core logic in `src/lib/`.
- [x] **Integration Tests**: Create integration tests for Git operations and API endpoints.
- [ ] **E2E Tests**: Set up Playwright for end-to-end testing of critical user flows (Login -> Create Repo -> Push Code).