Evan Reichard a074f5a854 feat(api): add file listing endpoint
- Add GET /api endpoint to list all markdown files
- Filter to only include .md files
- Return JSON response with files array
- Add comprehensive tests for file listing functionality
2026-02-06 21:23:59 -05:00
2026-02-05 16:06:54 -05:00
2026-02-05 16:06:54 -05:00

WYSIWYG Markdown Editor

A markdown editor with live preview, file management, and theme switching.

Features

  • Markdown Editor: Write markdown with live GitHub Flavored Markdown preview
  • File Management: Create, open, save, and delete markdown files
  • Theme System: Dark, Light, and System themes
  • Responsive Design: Works on desktop and mobile devices

Running the Application

Prerequisites

  • Node.js (v18+)
  • Go (v1.21+)
  • npm or yarn

Backend

# Build the backend
cd backend
make build

# Run the backend
./bin/markdown-editor

# Or with custom flags
./bin/markdown-editor --data-dir ./my-data --port 3000 --host 0.0.0.0

Frontend

# Install dependencies
cd frontend
npm install

# Build the frontend
npm run build

# Run in development mode
npm run dev

Running Both

  1. Build the frontend:

    cd frontend
    npm run build
    
  2. Run the backend (it will serve the built frontend):

    cd backend
    ./bin/markdown-editor
    
  3. Open your browser to http://localhost:8080

Development

Running Tests

# Backend tests
cd backend
make test

# Frontend tests
cd frontend
npm test

Project Structure

backend/
  cmd/
    backend/
      main.go
  internal/
    api/
      api.go
    logger/
      logger.go
    server/
      server.go
  tests/
    api_test.go
  go.mod
  go.sum
  Makefile

frontend/
  src/
    App.tsx
    main.tsx
    index.css
    setupTests.ts
    App.test.tsx
  package.json
  vite.config.ts
  tailwind.config.js
  postcss.config.js
  tsconfig.json
  index.html

Makefile
README.md
SPEC.md

API Endpoints

  • GET /api/{filename}.md - Get markdown file content
  • POST /api/{filename}.md - Create a new markdown file
  • PUT /api/{filename}.md - Update an existing markdown file
  • DELETE /api/{filename}.md - Delete a markdown file

License

MIT

Description
No description provided
Readme 33 MiB
Languages
Shell 64.1%
Nix 35.9%