A deployable markdown editor that connects with your self hosted files and lets you edit in a beautiful interface
Project Context#
Project Structure#
- Root:
backend/: Go backend service.frontend/: Astro + React frontend.Makefile: Build commands.docker-compose.yml: Container orchestration.
Backend (/backend)#
- Language: Go
- Framework: Chi (Router)
- Database: SQLite (with
modernc.org/sqlitedriver) - Authentication: Goth (GitHub OAuth)
- Key Directories:
internal/api/: Handlers and routing.router.go: Defines API routes.handlers/: Contains logic for Auth, Repos, etc.
internal/database/: Database connection, models, and queries.models.go: Struct definitions (User,AuthToken,BranchState,DraftContent).queries.go: SQL queries.migrations/: SQL migration files.
internal/connectors/: External API integrations (GitHub).github.go: Handles GitHub API calls (listing repos, files).
Frontend (/frontend)#
- Framework: Astro (Static Site Generation / Server Side Rendering) with React islands.
- Styling: Tailwind CSS.
- State Management: React Query (TanStack Query).
- Key Directories:
src/pages/:index.astro: Landing page.dashboard.astro: Main application entry point.
src/components/dashboard/:DashboardApp.tsx: Main React component for the dashboard.SetupWizard.tsx: Component for selecting repository and folder (To be refactored).FileTree.tsx: Displays repository file structure.
src/lib/api/: API client and endpoints.repos.ts: Calls to backend repo endpoints.
Current Functionality#
- Auth: GitHub OAuth flow via
/api/auth/github/login. - Repo Selection: Users select a repo and optional folder path via
SetupWizard. - File Listing: Fetches file tree from GitHub via Backend. Currently shows all folders, even empty ones.
- Editing: Markdown editing (implied, likely using TipTap or similar based on
node_modules).
Proposed Changes Context#
- Last Repo Persistence: Currently, the app doesn't remember the selected repo across sessions. We need to add
last_repoto theUsermodel. - Folder Selection: The user finds the folder selection step unnecessary. We will enforce root (
"") as the default. - Empty Folders: The file tree currently is "dumb" and shows the full structure. We need to make the backend filtering "smart" to only return relevant paths.
- Navigation: The dashboard currently handles both setup and editing in one view. Splitting this into
/select-repoand/dashboardwill improve UX and browser history management.