From 551212db82061ab769938ceafd7e4dc2ff948936 Mon Sep 17 00:00:00 2001 From: Dmitry Verkhoturov Date: Tue, 25 Feb 2025 22:05:25 +0000 Subject: [PATCH] Add first version of the CLAUDE.md --- CLAUDE.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..c8aeae17 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,33 @@ +# Remark42 Development Guidelines + +## Build/Test/Lint Commands +- **Backend**: + - Run server: `make rundev` + - Build: `make backend` + - Race test: `make race_test` +- **Backend Testing**: + - Run all tests: `cd backend/app && go test -timeout=60s -count 1 ./...` + - Run single test: `cd backend/app && go test -run TestName ./path/to/package` +- **Frontend**: + - Development: `cd frontend && pnpm dev:app` + - Tests: `cd frontend && pnpm test` +- **Lint**: + - Backend: `golangci-lint run` + - Frontend: `cd frontend && pnpm lint` + +## Code Style +- **Backend**: Formatting with golangci-lint, strict error handling +- **Frontend**: TypeScript with ESLint, Stylelint and Prettier +- **Imports**: Group stdlib, external packages, then internal packages +- **CSS**: CSS Modules for new components (`component.module.css`) + +## Key Backend Packages +- **Web/API**: `github.com/go-chi/chi/v5`, `github.com/go-pkgz/rest` +- **Auth**: `github.com/go-pkgz/auth/v2` +- **Logging**: `github.com/go-pkgz/lgr` +- **Testing**: `github.com/stretchr/testify` +- **Notifications**: `github.com/go-pkgz/notify` + +## Repository Structure +- Backend: Go server using BoltDB for storage +- Frontend: Preact/Redux-based UI with iframe embedding