# onlyone
**Repository Path**: moonlink/onlyone
## Basic Information
- **Project Name**: onlyone
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2026-04-12
- **Last Updated**: 2026-05-17
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
OnlyOne
An All-in-One Personal Assistant Platform — Todo Management + Accounting
---
**[中文](./README.md)**
## Overview
OnlyOne is an open-source personal assistant platform that integrates **Todo Management** and **Accounting** into a single application with cross-device sync between desktop and mobile.
### Key Features
- **Todo Management** — Task CRUD, priorities, due dates, list categories, subtasks, search
- **Accounting** — Income/expense tracking, category management, multi-account, transfers, monthly statistics
- **Cross-device Sync** — Real-time sync between desktop and mobile via WebSocket push + REST incremental sync
- **Offline Support** — Create/edit tasks and transactions offline; auto-sync when network recovers
- **Security** — JWT authentication, bcrypt password hashing, secure token storage
## Tech Stack
| Component | Technology |
|-----------|------------|
| **Backend** | Spring Boot 3.5 + Spring Modulith (DDD) + Spring Data JPA |
| **Database** | MySQL 8+ |
| **Migrations** | Flyway |
| **Auth** | Spring Security + JWT (jjwt) |
| **Real-time** | Spring WebSocket + STOMP |
| **Desktop** | Tauri 2 + React 19 + TypeScript + Tailwind CSS + shadcn/ui |
| **Mobile** | uni-app x (Vue 3) + TypeScript + Pinia |
| **Desktop Cache** | Rust + SQLite (via Tauri IPC) |
## Project Structure
```
OnlyOne/
├── service/ # Backend (Spring Boot + DDD + Spring Modulith)
│ └── src/main/java/com/onlyone/
│ ├── auth/ # Auth module (registration/login/JWT)
│ ├── todo/ # Todo module (task management)
│ ├── accounting/ # Accounting module (transactions/accounts/stats)
│ ├── sync/ # Sync module (WebSocket push/incremental sync)
│ └── shared/ # Shared infrastructure
├── desktop/ # Desktop app (Tauri 2 + React)
│ ├── src/ # React frontend
│ └── src-tauri/ # Rust backend (IPC/local cache)
└── app/ # Mobile app (uni-app x)
└── src/ # Vue 3 + uvue pages
```
## Getting Started
### Prerequisites
| Tool | Version |
|------|---------|
| JDK | 21+ |
| Maven | 3.8+ |
| Node.js | 18+ |
| npm | 9+ |
| Rust | 1.70+ (for desktop development) |
| MySQL | 8.0+ |
| HBuilderX | Latest (for mobile development, optional) |
### 1. Clone the Repository
```bash
git clone https://github.com/your-username/OnlyOne.git
cd OnlyOne
```
### 2. Start the Backend
```bash
# Create MySQL database
mysql -u root -p -e "CREATE DATABASE onlyone CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
# Configure environment variables
export DB_USERNAME=root
export DB_PASSWORD=your_password
export JWT_SECRET=your-jwt-secret-key-at-least-256-bits-long
# Start the service
cd service
mvn spring-boot:run
```
The backend runs on `http://localhost:8080` by default. Flyway will automatically execute database migrations.
### 3. Start the Desktop App
```bash
cd desktop
# Install frontend dependencies
npm install
# Start in development mode (Tauri dev)
npm run tauri dev
```
The desktop dev server runs on `http://localhost:1420`.
**Build the desktop installer:**
```bash
cd desktop
npm run tauri build
```
### 4. Start the Mobile App
```bash
cd app
# Install dependencies
npm install
# H5 development mode
npm run dev:h5
# Or build for H5
npm run build:h5
```
Open the `app/` directory in HBuilderX for native Android/iOS development and builds.
## Configuration
### Backend
Configuration file: `service/src/main/resources/application.yml`
| Setting | Description | Default |
|---------|-------------|---------|
| `spring.datasource.url` | MySQL connection URL | `jdbc:mysql://localhost:3306/onlyone` |
| `spring.datasource.username` | Database username | Env variable `DB_USERNAME` |
| `spring.datasource.password` | Database password | Env variable `DB_PASSWORD` |
| `jwt.secret` | JWT signing key | Env variable `JWT_SECRET` |
| `jwt.access-token-expiration` | Access Token validity (ms) | 900000 (15 min) |
| `jwt.refresh-token-expiration` | Refresh Token validity (ms) | 604800000 (7 days) |
### Desktop
Environment variables are configured in `desktop/.env.development`.
### Mobile
Configuration is in `app/src/manifest.json`, including H5 dev server proxy and Android package name.
## API Overview
| Module | Endpoint | Description |
|--------|----------|-------------|
| **Auth** | `POST /api/auth/register` | Register |
| | `POST /api/auth/login` | Login |
| | `POST /api/auth/refresh` | Refresh token |
| **Todo** | `GET /api/todos` | List todos |
| | `POST /api/todos` | Create todo |
| | `PUT /api/todos/{id}` | Update todo |
| | `DELETE /api/todos/{id}` | Delete todo |
| | `GET /api/todo-lists` | List todo lists |
| **Accounting** | `GET /api/transactions` | List transactions |
| | `POST /api/transactions` | Create transaction |
| | `PUT /api/transactions/{id}` | Update transaction |
| | `DELETE /api/transactions/{id}` | Delete transaction |
| | `GET /api/accounts` | List accounts |
| | `GET /api/categories` | List categories |
| | `GET /api/statistics/monthly` | Monthly statistics |
| | `POST /api/transfers` | Transfer between accounts |
| **Sync** | `GET /api/sync/changes` | Pull incremental changes |
| | `WS /ws/sync` | WebSocket real-time sync |
## Architecture
The backend uses **DDD (Domain-Driven Design)** + **Spring Modulith** modular architecture:
```
┌───────────┐ ┌───────────┐ ┌───────────┐
│ todo │ │accounting │ │ sync │
│ Todo Module│ │Accounting │ │Sync Module│
└─────┬─────┘ └─────┬─────┘ └─────┬─────┘
└──────────────┼──────────────┘
▼
┌──────────────┐
│ auth module │
│ (AuthN) │
└──────────────┘
```
- Each module follows DDD layering: API → Application → Domain → Infrastructure
- Cross-module communication via **domain events** only; direct Service calls are forbidden
- JPA optimistic locking (`@Version`) for multi-device sync conflict detection
## Development
### Backend
```bash
cd service
# Run tests (using Testcontainers, no local MySQL needed)
mvn test
# Run and skip tests
mvn spring-boot:run -Dskip-tests
```
### Desktop
```bash
cd desktop
# Start frontend dev server only (no Rust needed)
npm run dev
# Full Tauri development mode
npm run tauri dev
```
### Mobile
```bash
cd app
# H5 development
npm run dev:h5
# Build native app (requires HBuilderX)
npm run build:app
```
## Contributing
Contributions are welcome! Please read the [Contributing Guide](./CONTRIBUTING.md) for details.
## License
This project is licensed under the [MIT License](./LICENSE).
Copyright (c) 2026 墨月痕