**Memos** is a modern, open-source, self-hosted knowledge management and note-taking platform designed for privacy-conscious users and organizations. It provides a lightweight yet powerful solution for capturing, organizing, and sharing thoughts with comprehensive Markdown support and cross-platform accessibility.
### Key Technologies
- **Backend**: Go 1.24 with gRPC and Protocol Buffers
- **Frontend**: React 18 with TypeScript, Vite, and Tailwind CSS
- **Database**: SQLite (default), MySQL, PostgreSQL support
- **API**: RESTful HTTP/gRPC with grpc-gateway
- **Authentication**: JWT-based with OAuth2 providers
## Architecture Overview
### Backend Structure
```text
server/
├── router/
│ ├── api/v1/ # API v1 services and handlers
│ ├── frontend/ # Static frontend assets
│ └── rss/ # RSS feed generation
├── runner/ # Background job runners
└── profiler/ # Performance profiling
```
### Protocol Buffers & API
```text
proto/
├── api/v1/ # Public API definitions
│ ├── user_service.proto
│ ├── workspace_service.proto
│ ├── shortcut_service.proto
│ ├── idp_service.proto
│ └── webhook_service.proto
└── store/ # Internal data structures
├── workspace_setting.proto
├── user_setting.proto
└── ...
```
### Data Layer
```text
store/
├── db/ # Database drivers
│ ├── sqlite/
│ ├── mysql/
│ └── postgres/
├── migration/ # Database migrations
├── cache/ # Caching layer
└── test/ # Test utilities
```
## Recent Major Refactoring: Google AIP Compliance
### Overview
We recently completed a comprehensive refactoring to align the API with Google API Improvement Proposals (AIP) for resource-oriented API design. This involved updating protocol buffers, backend services, and frontend TypeScript code.
### Key Changes Made
#### 1. Protocol Buffer Refactoring
- **Resource Patterns**: Implemented standard resource naming (e.g., `users/{user}`, `workspace/settings/{setting}`)
- **Field Behaviors**: Added proper field annotations (`REQUIRED`, `OUTPUT_ONLY`, `IMMUTABLE`)
- **HTTP Annotations**: Updated REST mappings to follow RESTful conventions
- **Service Consolidation**: Merged `workspace_setting_service.proto` into `workspace_service.proto`
#### 2. Backend Service Updates
- **Resource Name Handling**: Added robust parsing for resource names
- **Method Signatures**: Updated to use resource names instead of raw IDs
- **Error Handling**: Improved error responses with proper gRPC status codes
- **Permission Checks**: Enhanced authorization based on user roles
#### 3. Frontend TypeScript Migration
- **Resource Name Utilities**: Helper functions for extracting IDs from resource names
- **State Management**: Updated MobX stores to use new resource formats
- **Component Updates**: React components now handle new API structures
- **Type Safety**: Enhanced TypeScript definitions for better type checking
## Development Workflow
### Code Quality Standards
- **golangci-lint**: Comprehensive linting with 15+ linters enabled
- **Protocol Buffer Generation**: `buf generate` for type-safe API generation