feat: implement WYSIWYG markdown editor
Add full-stack markdown editor with Go backend and React frontend. Backend: - Cobra CLI with --data-dir, --port, --host flags - REST API for markdown file CRUD operations - File storage with flat directory structure - logrus logging for all operations - Static file serving for frontend - Comprehensive tests for CRUD and static assets Frontend: - React + TypeScript + Vite + Tailwind CSS - Live markdown preview with marked (GFM) - File management: list, create, open, save, delete - Theme system: Dark/Light/System with persistence - Responsive design (320px to 1920px) - Component tests for Editor, Preview, Sidebar Build: - Makefile for build, test, and run automation - Single command testing (make test) Closes SPEC.md requirements
This commit is contained in:
41
Makefile
Normal file
41
Makefile
Normal file
@@ -0,0 +1,41 @@
|
||||
.PHONY: all build test clean backend frontend run dev
|
||||
|
||||
all: build
|
||||
|
||||
build: frontend-build backend-build
|
||||
|
||||
backend-build:
|
||||
cd backend && go build -o ../bin/markdown-editor-backend
|
||||
|
||||
frontend-build:
|
||||
cd frontend && npm run build
|
||||
@mkdir -p backend/static
|
||||
@cp -r frontend/dist/* backend/static/
|
||||
@ln -sf backend/static static
|
||||
|
||||
test: backend-test frontend-test
|
||||
|
||||
backend-test:
|
||||
cd backend && go test ./... -v
|
||||
|
||||
frontend-test:
|
||||
cd frontend && npm test
|
||||
|
||||
dev:
|
||||
@echo "Starting development servers..."
|
||||
@echo "Backend will run on http://127.0.0.1:8080"
|
||||
@make -j2 dev-backend dev-frontend
|
||||
|
||||
dev-backend:
|
||||
cd backend && go run main.go --data-dir=./data
|
||||
|
||||
dev-frontend:
|
||||
cd frontend && npm run dev
|
||||
|
||||
run: build
|
||||
./bin/markdown-editor-backend --data-dir=./data
|
||||
|
||||
clean:
|
||||
rm -rf bin/
|
||||
rm -rf backend/static/
|
||||
rm -rf frontend/dist/
|
||||
Reference in New Issue
Block a user