|
1 | | -# Next Liftのシステムアーキテクチャについて |
| 1 | +# Next Lift System Architecture |
2 | 2 |
|
3 | | -このドキュメントでは、システムアーキテクチャの概要と主要なコンポーネントについて説明します。 |
| 3 | +This document describes the system architecture overview and major components. |
4 | 4 |
|
5 | | -## 概要 |
| 5 | +## Overview |
6 | 6 |
|
7 | | -Next Liftはウェイトトレーニングの計画と記録を管理できるシステムです。iOSアプリとWebアプリの2つのアプリケーションで構成されています。それぞれのアプリケーションは、次の機能を提供します。 |
| 7 | +Next Lift is a system for managing weight training plans and records. It consists of two applications: iOS app and Web app. Each application provides the following features: |
8 | 8 |
|
9 | | -- iOSアプリ |
10 | | - - Googleアカウント・Apple IDを使用した認証 |
11 | | - - トレーニング記録のCRUD機能 |
12 | | - - ローカルファースト設計よるオフライン対応・データ同期 |
13 | | - - トレーニング中の疲労状態でも操作しやすいUX |
14 | | - - フリーテキストや音声による入力など、AIを活用した機能(有料機能) |
15 | | -- Webアプリ |
16 | | - - Googleアカウント・Apple IDを使用した認証 |
17 | | - - トレーニング記録のCRUD機能 |
18 | | - - トレーニング計画のCRUD機能 |
19 | | - - ローカルファースト設計よるデータ同期 |
20 | | - - 統計データ表示やフィルタリングなど、広い画面での操作を想定した機能 |
21 | | - - フリーテキストや音声による入力など、AIを活用した機能(有料機能) |
| 9 | +- iOS App |
| 10 | + - Authentication using Google account and Apple ID |
| 11 | + - CRUD functionality for training records |
| 12 | + - Offline support and data synchronization with local-first design |
| 13 | + - UX optimized for ease of use even during fatigue from training |
| 14 | + - AI-powered features such as free text and voice input (premium features) |
| 15 | +- Web App |
| 16 | + - Authentication using Google account and Apple ID |
| 17 | + - CRUD functionality for training records |
| 18 | + - CRUD functionality for training plans |
| 19 | + - Data synchronization with local-first design |
| 20 | + - Features designed for large screens such as statistical data display and filtering |
| 21 | + - AI-powered features such as free text and voice input (premium features) |
22 | 22 |
|
23 | | -Next Liftは認証用データベースとPer-Userデータベースを使用します。 |
| 23 | +Next Lift uses an authentication database and Per-User databases. |
24 | 24 |
|
25 | | -- 認証用データベース |
26 | | - - ユーザー情報やセッション情報を管理 |
27 | | - - Googleアカウント・Apple IDを使用した認証に対応 |
28 | | -- Per-Userデータベース |
29 | | - - トレーニング記録や計画などのユーザーごとのデータを保存 |
30 | | - - 各ユーザーごとに独立したデータベースインスタンスを使用 |
31 | | - - iOSアプリはローカルのインスタンスからデータを読み書きし、変更は自動的にリモートのインスタンスに同期される |
32 | | - - Webアプリはリモートのインスタンスからデータを読み書きする |
| 25 | +- Authentication Database |
| 26 | + - Manages user information and session information |
| 27 | + - Supports authentication using Google account and Apple ID |
| 28 | +- Per-User Database |
| 29 | + - Stores user-specific data such as training records and plans |
| 30 | + - Uses independent database instances for each user |
| 31 | + - iOS app reads and writes data from local instances, with changes automatically synced to remote instances |
| 32 | + - Web app reads and writes data from remote instances |
33 | 33 |
|
34 | | -アプリケーションとデータベースを連携させるために、認証APIサーバーを使用します。認証APIサーバーは次の機能を提供します。 |
| 34 | +An authentication API server is used to connect applications with databases. The authentication API server provides the following functions: |
35 | 35 |
|
36 | | -- 各アプリケーションからの認証リクエストを処理 |
37 | | -- ユーザー登録時にPer-Userデータベースの作成と接続情報の提供 |
| 36 | +- Processes authentication requests from each application |
| 37 | +- Creates Per-User database and provides connection information during user registration |
38 | 38 |
|
39 | | -## 各コンポーネントの詳細 |
| 39 | +## Component Details |
40 | 40 |
|
41 | | -### iOSアプリ |
| 41 | +### iOS App |
42 | 42 |
|
43 | | -- **フレームワーク**: React Native |
44 | | -- **対象プラットフォーム**: iOSのみ(Android端末での検証環境なし) |
45 | | -- **認証**: Better Auth(認証APIサーバーと連携) |
46 | | -- **データベース**: Per-Userデータベース(Local Replica) |
47 | | -- **データアクセス**: Drizzle ORM + op-sqlite |
| 43 | +- **Framework**: React Native |
| 44 | +- **Target Platform**: iOS only (no Android testing environment) |
| 45 | +- **Authentication**: Better Auth (integrated with authentication API server) |
| 46 | +- **Database**: Per-User database (Local Replica) |
| 47 | +- **Data Access**: Drizzle ORM + op-sqlite |
48 | 48 |
|
49 | | -### Webアプリ |
| 49 | +### Web App |
50 | 50 |
|
51 | | -- **フレームワーク**: React Router |
52 | | -- **対象デバイス**: PC(統計データ表示のため広画面想定)、スマートフォン(Androidユーザーにはこちらを使ってもらう) |
53 | | -- **認証**: Better Auth(認証APIサーバーと連携) |
54 | | -- **データベース**: Per-Userデータベース(Remote Database) |
55 | | -- **データアクセス**: Drizzle ORM |
56 | | -- **デプロイ先**: Cloudflare Workers |
| 51 | +- **Framework**: React Router |
| 52 | +- **Target Devices**: PC (optimized for large screens for statistical data display), Smartphone (for Android users) |
| 53 | +- **Authentication**: Better Auth (integrated with authentication API server) |
| 54 | +- **Database**: Per-User database (Remote Database) |
| 55 | +- **Data Access**: Drizzle ORM |
| 56 | +- **Deployment**: Cloudflare Workers |
57 | 57 |
|
58 | | -### 認証APIサーバー |
| 58 | +### Authentication API Server |
59 | 59 |
|
60 | | -- **フレームワーク**: Hono |
61 | | -- **ライブラリ**: Better Auth |
62 | | -- **認証方式**: Apple ID、Google認証 |
63 | | -- **API**: REST API(Web・iOS向け認証エンドポイント) |
64 | | -- **データベース**: 認証用データベース |
65 | | -- **データアクセス**: Drizzle ORM |
66 | | -- **デプロイ先**: Cloudflare Workers |
| 60 | +- **Framework**: Hono |
| 61 | +- **Library**: Better Auth |
| 62 | +- **Authentication Methods**: Apple ID, Google authentication |
| 63 | +- **API**: REST API (authentication endpoints for Web and iOS) |
| 64 | +- **Database**: Authentication database |
| 65 | +- **Data Access**: Drizzle ORM |
| 66 | +- **Deployment**: Cloudflare Workers |
67 | 67 |
|
68 | | -### 認証用データベース |
| 68 | +### Authentication Database |
69 | 69 |
|
70 | | -- **データベース**: Turso |
| 70 | +- **Database**: Turso |
71 | 71 |
|
72 | | -### Per-Userデータベース |
| 72 | +### Per-User Database |
73 | 73 |
|
74 | | -- **データベース**: Turso Embedded Replicas |
| 74 | +- **Database**: Turso Embedded Replicas |
75 | 75 |
|
76 | | -## パッケージ管理 |
| 76 | +## Package Management |
77 | 77 |
|
78 | | -Next Liftは、pnpmを使用してパッケージ管理を行います。モノレポ構成で、各アプリケーションやライブラリは以下のように配置されます。 |
| 78 | +Next Lift uses pnpm for package management. In the monorepo structure, each application and library is organized as follows: |
79 | 79 |
|
80 | 80 | ```text |
81 | 81 | /apps |
82 | | - ├── ios … iOSアプリ |
83 | | - ├── web … Webアプリ |
84 | | - └── auth-api … 認証APIサーバー |
| 82 | + ├── ios … iOS app |
| 83 | + ├── web … Web app |
| 84 | + └── auth-api … Authentication API server |
85 | 85 | /packages |
86 | | - ├── react-components … 共通Reactコンポーネント |
87 | | - ├── react-native-components … 共通React Nativeコンポーネント |
88 | | - ├── per-user-database … Per-Userのデータベースのスキーマとクライアント |
89 | | - └── auth-database … 認証用データベースのスキーマとクライアント |
| 86 | + ├── react-components … Shared React components |
| 87 | + ├── react-native-components … Shared React Native components |
| 88 | + ├── per-user-database … Per-User database schema and client |
| 89 | + └── auth-database … Authentication database schema and client |
90 | 90 | ``` |
0 commit comments