Initial: setup evaluation environment

This commit is contained in:
2026-02-06 09:30:14 -05:00
commit 6b66cee21d
4 changed files with 202 additions and 0 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

101
SPEC.md Normal file
View File

@@ -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

61
flake.lock generated Normal file
View File

@@ -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
}

39
flake.nix Normal file
View File

@@ -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
];
};
}
);
}