A deployable markdown editor that connects with your self hosted files and lets you edit in a beautiful interface
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Implementation Plan#

1. Save & Load Last Repo (Backend & Database)#

Objective: Store the user's last accessed repository in the database and return it upon login.

Database Schema#

  • Create a new migration backend/internal/database/migrations/002_add_last_repo.sql:
    • Add last_repo column (TEXT) to the users table.
  • Update backend/internal/database/migrations.go to ensure the new migration file is embedded and executed.

Backend Logic#

  • Update backend/internal/database/models.go:
    • Add LastRepo string to the User struct.
  • Update backend/internal/database/queries.go:
    • Update GetUserByID query and scan.
    • Update GetUserByGithubID query and scan.
    • Update CreateUser query and scan.
    • Add UpdateUserRepo(userID int, repoName string) function.
  • Update backend/internal/api/handlers/auth.go:
    • In GetCurrentUser, include last_repo in the response.
    • Create UpdateUserRepo handler to handle POST /api/user/repo.
  • Update backend/internal/api/router.go:
    • Register the new route POST /api/user/repo.

2. Remove Folder Selection Step (Frontend)#

Objective: Simplify the setup wizard to skip the folder selection step and default to root.

Frontend Logic#

  • Modify frontend/src/components/dashboard/SetupWizard.tsx:
    • Remove the "Step 2" (Folder Configuration) UI and logic.
    • Change "Next" button in Step 1 to "Complete Setup".
    • On submission, default the folder path to "" (root).

3. Filter Empty Folders (Backend)#

Objective: Only show folders that actually contain markdown files (recursively).

Backend Logic#

  • Modify backend/internal/connectors/github.go:
    • In ListFiles:
      • Implement logic to check if a directory or its subdirectories contain matching files (based on extensions).
      • If a directory is empty (contains no matching files), exclude it from the returned FileNode structure.

4. Separate Repo Selection URL (Frontend Routing)#

Objective: Create a distinct URL for repo selection to support browser navigation.

Frontend Architecture#

  • Create frontend/src/pages/select-repo.astro:
    • Migrate SetupWizard component usage here.
  • Update frontend/src/pages/dashboard.astro & DashboardApp.tsx:
    • Check for last_repo in user data or URL params.
    • If no repo is active, redirect to /select-repo.
    • If repo is active, show the EditorContainer.
  • Update Sidebar Navigation:
    • "Change repository" button should link to /select-repo.