feat: implement WYSIWYG markdown editor
Add complete markdown editor with Go backend and React/TypeScript frontend. Backend: - Cobra CLI with configurable host, port, data-dir, static-dir flags - REST API for CRUD operations on markdown files (GET, POST, PUT, DELETE) - File storage with flat .md structure - Comprehensive Logrus logging for all operations - Static asset serving for frontend Frontend: - React 18 + TypeScript + Tailwind CSS - Live markdown editor with GFM preview (react-markdown) - File management UI (list, create, open, save, delete) - Theme system (Light/Dark/System) with localStorage persistence - Responsive design (320px - 1920px+) Testing: - 6 backend tests covering CRUD round-trip, validation, error handling - 19 frontend tests covering API, theme system, and UI components - All tests passing with single 'make test' command Build: - Frontend compiles to optimized assets in dist/ - Backend can serve frontend via --static-dir flag
This commit is contained in:
37
Makefile
Normal file
37
Makefile
Normal file
@@ -0,0 +1,37 @@
|
||||
.PHONY: all test backend-test frontend-test frontend-lint frontend-build clean help
|
||||
|
||||
all: test
|
||||
|
||||
backend-test:
|
||||
@echo "Running backend tests..."
|
||||
cd backend && go test -v ./test/...
|
||||
|
||||
frontend-test:
|
||||
@echo "Running frontend tests..."
|
||||
cd frontend && npm run test -- --run
|
||||
|
||||
frontend-lint:
|
||||
@echo "Running frontend linting..."
|
||||
cd frontend && npm run lint
|
||||
|
||||
frontend-build:
|
||||
@echo "Building frontend..."
|
||||
cd frontend && npm run build
|
||||
|
||||
test: backend-test frontend-test
|
||||
@echo "All tests passed!"
|
||||
|
||||
clean:
|
||||
@echo "Cleaning..."
|
||||
cd backend && rm -rf data
|
||||
cd frontend && rm -rf dist node_modules
|
||||
|
||||
help:
|
||||
@echo "Available commands:"
|
||||
@echo " make test - Run all tests"
|
||||
@echo " make backend-test - Run backend tests"
|
||||
@echo " make frontend-test - Run frontend tests"
|
||||
@echo " make frontend-lint - Run frontend linting"
|
||||
@echo " make frontend-build - Build frontend for production"
|
||||
@echo " make clean - Clean build artifacts"
|
||||
@echo " make help - Show this help message"
|
||||
Reference in New Issue
Block a user