commit 78f33053fb53b76c572cf61b7af23a8ca547bc20 Author: Evan Reichard Date: Thu Feb 5 17:27:31 2026 -0500 Initial: setup evaluation environment diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/SPEC.md b/SPEC.md new file mode 100644 index 0000000..cc22433 --- /dev/null +++ b/SPEC.md @@ -0,0 +1,101 @@ +# WYSIWYG Markdown Editor - Specification + +## Overview + +Build a markdown editor with preview: Go backend + React/TypeScript frontend with Tailwind CSS. + +**Out of scope:** authentication, user accounts, collaborative editing, version history. + +## Backend (Go) + +- Standard HTTP server + Cobra for CLI +- CRUD REST API for markdown files +- Store files on disk (flat structure, `.md` files only) +- Errors return 4xx/5xx + JSON with `error` field +- Comprehensive logging using logrus + +### CLI Flags + +- `--data-dir`: Storage path (default: `./data`) +- `--port`: Server port (default: `8080`) +- `--host`: Bind address (default: `127.0.0.1`) + +## Frontend (React + TypeScript + Tailwind) + +- Markdown editor with live GFM preview +- File management: list, create, open, save, delete +- Three themes (Dark, Light, System) with switcher +- Responsive (desktop + mobile) + +## Development Environment + +`flake.nix` (locked to `nixos-25.11`) provides: go, gopls, golangci-lint, eslint, nodejs, gnumake, lsof + +**Do not modify flake.** + +## Testing (TDD) + +- **All tests must pass** +- Single command to run tests +- Backend: demonstrate CRUD round-trip + static asset serving +- Frontend: verify core functionality + +## Milestones + +### Backend (6 milestones) + +**B1: CLI & Server Setup** +- Cobra CLI with --data-dir, --port, --host flags +- HTTP server with basic routing + +**B2: CRUD API** +- REST endpoints for markdown files (GET, POST, PUT, DELETE) +- JSON error responses (4xx/5xx) + +**B3: File Storage** +- Read/write .md files to disk +- Flat file structure + +**B4: Logging** +- Comprehensive logrus logging for all operations + +**B5: Static Assets** +- Serve frontend build files + +**B6: Backend Tests** +- CRUD round-trip tests +- Static asset serving tests + +### Frontend (6 milestones) + +**F1: Project Setup** +- React + TypeScript + Tailwind configured + +**F2: File Management UI** +- List, create, open, save, delete markdown files + +**F3: Editor & Preview** +- Markdown editor with live GFM preview + +**F4: Theme System** +- Dark/Light/System themes +- Theme switcher and persistence + +**F5: Responsive Design** +- Works at 320px and 1920px + +**F6: Frontend Tests** +- Core functionality tests (editor, file operations, themes) + +### Integration (1 milestone) + +**I1: End-to-end** +- Full CRUD workflow test from frontend to backend + +## Evaluation + +1. CLI starts with defaults +2. CRUD works end-to-end +3. Static assets are properly served +4. Theme switch & persistence +5. Responsive at 320px and 1920px diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..beb68bf --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1769318308, + "narHash": "sha256-Mjx6p96Pkefks3+aA+72lu1xVehb6mv2yTUUqmSet6Q=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1cd347bf3355fce6c64ab37d3967b4a2cb4b878c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d7a68dd --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + description = "Development Environment"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { self + , nixpkgs + , flake-utils + , + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = ( + import nixpkgs { + system = system; + } + ); + in + { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + go + gopls + golangci-lint + + nodejs + eslint + gnumake + lsof + ]; + }; + } + ); +}