mirror of https://github.com/usememos/memos.git
chore: align branding with brand guidelines (#5693)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1e82714a52
commit
851e090ff9
24
AGENTS.md
24
AGENTS.md
|
|
@ -1,6 +1,8 @@
|
|||
# Memos Codebase Guide for AI Agents
|
||||
# AGENTS.md
|
||||
|
||||
Self-hosted knowledge management platform. Go 1.25 backend (Echo v5, Connect RPC + gRPC-Gateway), React 18 + TypeScript 5.9 + Vite 7 frontend, Protocol Buffers API, SQLite/MySQL/PostgreSQL.
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
Self-hosted note-taking tool. Go 1.25 backend (Echo v5, Connect RPC + gRPC-Gateway), React 18 + TypeScript 5.9 + Vite 7 frontend, Protocol Buffers API, SQLite/MySQL/PostgreSQL.
|
||||
|
||||
## Commands
|
||||
|
||||
|
|
@ -8,8 +10,11 @@ Self-hosted knowledge management platform. Go 1.25 backend (Echo v5, Connect RPC
|
|||
# Backend
|
||||
go run ./cmd/memos --port 8081 # Start dev server
|
||||
go test ./... # Run all tests
|
||||
golangci-lint run # Lint (v2)
|
||||
goimports -w . # Format imports
|
||||
go test -v ./store/... # Run store tests (all 3 DB drivers via TestContainers)
|
||||
go test -v -race ./server/... # Run server tests with race detection
|
||||
go test -v -run TestFoo ./pkg/... # Run a single test
|
||||
golangci-lint run # Lint (v2, config: .golangci.yaml)
|
||||
golangci-lint run --fix # Auto-fix lint issues (includes goimports)
|
||||
|
||||
# Frontend (cd web)
|
||||
pnpm install # Install deps
|
||||
|
|
@ -23,6 +28,7 @@ pnpm release # Build to server/router/frontend/dist
|
|||
# Protocol Buffers (cd proto)
|
||||
buf generate # Regenerate Go + TypeScript + OpenAPI
|
||||
buf lint # Lint proto files
|
||||
buf format -w # Format proto files
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
|
@ -34,7 +40,7 @@ server/
|
|||
├── server.go # Echo v5 HTTP server, background runners
|
||||
├── auth/ # JWT access (15min) + refresh (30d) tokens, PAT
|
||||
├── router/
|
||||
│ ├── api/v1/ # 9 gRPC services (Connect + Gateway)
|
||||
│ ├── api/v1/ # 8 gRPC services (Connect + Gateway)
|
||||
│ │ ├── acl_config.go # Public endpoints whitelist
|
||||
│ │ ├── sse_hub.go # Server-Sent Events (live updates)
|
||||
│ │ └── mcp/ # MCP server for AI assistants
|
||||
|
|
@ -66,15 +72,15 @@ web/src/
|
|||
├── router/index.tsx # Route definitions
|
||||
├── components/ # UI components (Radix UI primitives, MemoEditor, Settings, etc.)
|
||||
├── themes/ # CSS themes (default, dark, paper) — OKLch color tokens
|
||||
└── pages/ # 14 page components
|
||||
└── pages/ # Page components
|
||||
```
|
||||
|
||||
## Conventions
|
||||
|
||||
### Go
|
||||
- **Errors:** `errors.Wrap(err, "context")` from `github.com/pkg/errors`. Never `fmt.Errorf` (lint-enforced).
|
||||
- **Errors:** `errors.Wrap(err, "context")` from `github.com/pkg/errors`. Never `fmt.Errorf` (lint-enforced via forbidigo).
|
||||
- **gRPC errors:** `status.Errorf(codes.X, "message")` from service methods.
|
||||
- **Imports:** stdlib → third-party → local (`github.com/usememos/memos`). Run `goimports -w .`.
|
||||
- **Imports:** stdlib, then third-party, then local (`github.com/usememos/memos`). Enforced by goimports (runs as golangci-lint formatter).
|
||||
- **Comments:** All exported functions must have doc comments (godot enforced).
|
||||
|
||||
### Frontend
|
||||
|
|
@ -90,7 +96,7 @@ web/src/
|
|||
|
||||
## CI/CD
|
||||
|
||||
- **backend-tests.yml:** Go 1.25.7, golangci-lint v2.4.0, tests parallelized by group (store tests all 3 DBs via TestContainers)
|
||||
- **backend-tests.yml:** Go 1.25.7, golangci-lint v2.4.0, tests parallelized by group (store, server, plugin, other)
|
||||
- **frontend-tests.yml:** Node 22, pnpm 10, lint + build
|
||||
- **proto-linter.yml:** buf lint + format check
|
||||
- **Docker:** Multi-stage (`scripts/Dockerfile`), Alpine 3.21, non-root user, port 5230, multi-arch (amd64/arm64/arm/v7)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
See `AGENTS.md` for full architecture, workflows, conventions, and patterns.
|
||||
|
|
|
|||
22
README.md
22
README.md
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
<img align="right" height="96px" src="https://raw.githubusercontent.com/usememos/.github/refs/heads/main/assets/logo-rounded.png" alt="Memos" />
|
||||
|
||||
An open-source, self-hosted note-taking service. Your thoughts, your data, your control — no tracking, no ads, no subscription fees.
|
||||
An open-source, self-hosted note-taking tool. Capture thoughts instantly. Own them completely.
|
||||
|
||||
[](https://usememos.com)
|
||||
[](https://demo.usememos.com/)
|
||||
|
|
@ -49,18 +49,12 @@ An open-source, self-hosted note-taking service. Your thoughts, your data, your
|
|||
<img src="https://usememos.com/sponsors/ssd-nodes.svg" alt="SSD Nodes" height="72" />
|
||||
</a>
|
||||
|
||||
## Overview
|
||||
|
||||
Memos is a privacy-first, self-hosted knowledge base for personal notes, team wikis, and knowledge management. Built with Go and React, it runs as a single binary with minimal resource usage.
|
||||
|
||||
## Features
|
||||
|
||||
- **Privacy-First** — Self-hosted on your infrastructure with zero telemetry, no tracking, and no ads.
|
||||
- **Markdown Native** — Full markdown support with plain text storage. Your data is always portable.
|
||||
- **Lightweight** — Single Go binary with a React frontend. Low memory footprint, starts in seconds.
|
||||
- **Easy to Deploy** — One-line Docker install. Supports SQLite, MySQL, and PostgreSQL.
|
||||
- **Developer-Friendly** — Full REST and gRPC APIs for integration with existing workflows.
|
||||
- **Clean Interface** — Minimal design with dark mode and mobile-responsive layout.
|
||||
- **Instant Capture** — Timeline-first UI. Open, write, done — no folders to navigate.
|
||||
- **Total Data Ownership** — Self-hosted on your infrastructure. Notes stored in Markdown, always portable. Zero telemetry.
|
||||
- **Radical Simplicity** — Single Go binary, ~20MB Docker image. One command to deploy with SQLite, MySQL, or PostgreSQL.
|
||||
- **Open & Extensible** — MIT-licensed with full REST and gRPC APIs for integration.
|
||||
|
||||
## Quick Start
|
||||
|
||||
|
|
@ -109,11 +103,7 @@ Love Memos? [Sponsor us on GitHub](https://github.com/sponsors/usememos) to help
|
|||
|
||||
## License
|
||||
|
||||
Memos is open-source software licensed under the [MIT License](LICENSE).
|
||||
|
||||
## Privacy Policy
|
||||
|
||||
Memos is built with privacy as a core principle. As a self-hosted application, all your data stays on your infrastructure. There is no telemetry, no tracking, and no data collection. See our [Privacy Policy](https://usememos.com/privacy) for details.
|
||||
Memos is open-source software licensed under the [MIT License](LICENSE). See our [Privacy Policy](https://usememos.com/privacy) for details on data handling.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ INSERT INTO user (id,username,role,nickname,password_hash) VALUES(1,'demo','ADMI
|
|||
INSERT INTO user (id,username,role,nickname,description,password_hash) VALUES(2,'alice','USER','Alice','Developer & avid reader 📚','$2a$10$c.slEVgf5b/3BnAWlLb/vOu7VVSOKJ4ljwMe9xzlx9IhKnvAsJYM6');
|
||||
|
||||
-- 1. Welcome Memo (Pinned)
|
||||
INSERT INTO memo (id,uid,creator_id,content,visibility,pinned,payload) VALUES(1,'welcome2memos001',1,replace('# Welcome to Memos!\n\nA privacy-first, lightweight note-taking service. Capture thoughts, build knowledge, stay organized.\n\n## Key Features\n\n- **Write anything**: Quick notes, long-form writing, technical docs\n- **Markdown**: Full CommonMark + GFM syntax\n- **Task Lists**: Track to-dos inline with `- [ ]` syntax\n- **Tags**: Use #hashtags to organize your memos\n- **Attachments**: Images, videos, documents — drag & drop\n- **Location**: Geotag memos to remember where ideas struck\n- **Reactions & Comments**: Engage with any memo\n- **Relations**: Connect and reference related memos\n\n---\n\nExplore the demo memos below to see what''s possible! #welcome #getting-started','\n',char(10)),'PUBLIC',1,'{"tags":["welcome","getting-started"],"property":{"hasLink":false}}');
|
||||
INSERT INTO memo (id,uid,creator_id,content,visibility,pinned,payload) VALUES(1,'welcome2memos001',1,replace('# Welcome to Memos!\n\nAn open-source, self-hosted note-taking tool. Capture thoughts instantly. Own them completely.\n\n## Key Features\n\n- **Write anything**: Quick notes, long-form writing, technical docs\n- **Markdown**: Full CommonMark + GFM syntax\n- **Task Lists**: Track to-dos inline with `- [ ]` syntax\n- **Tags**: Use #hashtags to organize your memos\n- **Attachments**: Images, videos, documents — drag & drop\n- **Location**: Geotag memos to remember where ideas struck\n- **Reactions & Comments**: Engage with any memo\n- **Relations**: Connect and reference related memos\n\n---\n\nExplore the demo memos below to see what''s possible! #welcome #getting-started','\n',char(10)),'PUBLIC',1,'{"tags":["welcome","getting-started"],"property":{"hasLink":false}}');
|
||||
|
||||
-- 2. Sponsor Memo (Pinned)
|
||||
INSERT INTO memo (id,uid,creator_id,content,visibility,pinned,payload) VALUES(2,'sponsor0000001',1,replace('Memos is free and open source, made possible by the generous support of our sponsors. 🙏\n\n---\n\n**[Warp — The AI-powered terminal built for speed and collaboration](https://go.warp.dev/memos)**\n\nWarp is a modern terminal reimagined with AI built in — autocomplete commands, debug errors inline, and collaborate with your team without leaving the terminal.\n\n<a href="https://go.warp.dev/memos" target="_blank" rel="noopener"><img src="https://raw.githubusercontent.com/warpdotdev/brand-assets/refs/heads/main/Logos/Warp-Wordmark-Black.png" alt="Warp - The AI-powered terminal built for speed and collaboration" height="44" /></a>\n\n---\n\n**[TestMu AI — The world''s first full-stack Agentic AI Quality Engineering platform](https://www.testmuai.com/?utm_medium=sponsor&utm_source=memos)**\n\nTestMu AI brings autonomous AI agents to your QA pipeline — from test generation to execution and reporting, all without manual scripting.\n\n<a href="https://www.testmuai.com/?utm_medium=sponsor&utm_source=memos" target="_blank" rel="noopener"><img src="https://usememos.com/sponsors/testmu.svg" alt="TestMu AI" height="36" /></a>\n\n---\n\n**[SSD Nodes — Affordable VPS hosting for self-hosters](https://ssdnodes.com/?utm_source=memos&utm_medium=sponsor)**\n\nHigh-performance VPS servers at prices that make self-hosting a no-brainer. Perfect for running your own Memos instance.\n\n<a href="https://ssdnodes.com/?utm_source=memos&utm_medium=sponsor" target="_blank" rel="noopener"><img src="https://usememos.com/sponsors/ssd-nodes.svg" alt="SSD Nodes" height="72" /></a>\n\n---\n\nInterested in sponsoring? Visit [GitHub Sponsors](https://github.com/sponsors/usememos) to learn more.\n\n#sponsors','\n',char(10)),'PUBLIC',1,'{"tags":["sponsors"],"property":{"hasLink":true}}');
|
||||
|
|
@ -17,7 +17,7 @@ INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(3,'aiskil
|
|||
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(4,'markdownshowcs1',1,replace('## 📄 Issue Definition: Add Full-Text Search to Memos #ai #programming\n\n*Generated with `/defining-issues` from [boojack/skills](https://github.com/boojack/skills)*\n\n---\n\n### Background\n\nUsers rely on tag filtering and manual scrolling to find memos. As the memo count grows, discoverability becomes a pain point with no way to search by keyword.\n\n### Issue Statement\n\nThere is no full-text search capability. Users cannot search memo content by keyword, making it hard to resurface older notes or find related ideas.\n\n### Current State\n\n- Tag-based filtering works via `#hashtag` syntax\n- No search index exists in the database\n- The API has no search endpoint\n- Browsing is limited to chronological scroll or tag drill-down\n\n### Proposed Scope\n\n- Add a search input to the main UI\n- Implement SQLite FTS5 full-text indexing on `memo.content`\n- Return ranked results via `GET /api/memos?search=<query>`\n- Highlight matched terms in search results\n\n### Non-Goals\n\n- Semantic / vector search\n- Search across attachments or comments\n- Cross-user search for admins\n\n### Open Questions\n\n1. Should search respect memo visibility (`PUBLIC` / `PRIVATE`)?\n2. Do we index archived memos?\n3. Real-time results as-you-type, or on submit?\n4. Should tags be weighted higher than body text in ranking?','\n',char(10)),'PUBLIC','{"tags":["ai","programming"],"property":{"hasLink":true,"hasCode":true}}');
|
||||
|
||||
-- 5. Travel Bucket List (has location: Paris)
|
||||
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(5,'travelbucket01',1,replace('## 🌍 My Travel Bucket List #travel #bucketlist\n\n### Places I''ve Been\n- [x] Paris, France — Amazing food and art!\n- [x] Shanghai, China — Modern skyline meets ancient temples\n- [x] Grand Canyon, USA — Breathtaking views\n- [x] Barcelona, Spain — Gaudí''s architecture is incredible\n\n### Dream Destinations\n- [ ] Northern Lights in Iceland\n- [ ] Safari in Tanzania\n- [ ] Great Barrier Reef, Australia\n- [ ] Machu Picchu, Peru\n- [ ] Santorini, Greece\n- [ ] New Zealand road trip\n\n### 2025 Plans\n- [ ] Book tickets to Iceland for winter\n- [ ] Research best time to visit Patagonia\n- [ ] Save up for Australia trip','\n',char(10)),'PUBLIC','{"tags":["travel","bucketlist"],"property":{"hasTaskList":true,"hasIncompleteTasks":true},"location":{"placeholder":"Paris, Île-de-France, France","latitude":48.8566,"longitude":2.3522}}');
|
||||
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(5,'travelbucket01',1,replace('## 🌍 My Travel Bucket List #travel #bucketlist\n\n### Places I''ve Been\n- [x] Paris, France — Amazing food and art!\n- [x] Shanghai, China — Modern skyline meets ancient temples\n- [x] Grand Canyon, USA — Breathtaking views\n- [x] Barcelona, Spain — Gaudí''s architecture is incredible\n\n### Dream Destinations\n- [ ] Northern Lights in Iceland\n- [ ] Safari in Tanzania\n- [ ] Great Barrier Reef, Australia\n- [ ] Machu Picchu, Peru\n- [ ] Santorini, Greece\n- [ ] New Zealand road trip\n\n### 2026 Plans\n- [ ] Book tickets to Iceland for winter\n- [ ] Research best time to visit Patagonia\n- [ ] Save up for Australia trip','\n',char(10)),'PUBLIC','{"tags":["travel","bucketlist"],"property":{"hasTaskList":true,"hasIncompleteTasks":true},"location":{"placeholder":"Paris, Île-de-France, France","latitude":48.8566,"longitude":2.3522}}');
|
||||
|
||||
-- 6. Movie Watchlist — posted by Alice
|
||||
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(6,'moviewatch00001',2,replace('## 🎬 February Movie Marathon #movies #watchlist\n\nCatching up on films I''ve been meaning to watch!\n\n### This Month''s Queue\n\n| Movie | Genre | Status | Rating |\n|-------|-------|--------|--------|\n| The Grand Budapest Hotel | Comedy/Drama | ✅ Watched | ⭐⭐⭐⭐⭐ |\n| Inception | Sci-Fi | ✅ Watched | ⭐⭐⭐⭐⭐ |\n| Spirited Away | Animation | ✅ Watched | ⭐⭐⭐⭐⭐ |\n| Dune: Part Two | Sci-Fi | 📅 This weekend | — |\n| Oppenheimer | Biography | 📋 Queued | — |\n\n### Notes\n- Grand Budapest Hotel: Wes Anderson''s visual style is *chef''s kiss* ✨\n- Inception: Need to watch again to catch all the details\n- Spirited Away: Studio Ghibli never disappoints!\n\n---\n\n**Next month**: Planning a full Miyazaki marathon 🎨','\n',char(10)),'PUBLIC','{"tags":["movies","watchlist"],"property":{"hasLink":false}}');
|
||||
|
|
|
|||
Loading…
Reference in New Issue