Skip to content

Commit f330636

Browse files
authored
docs: add technical documentations
* add flutter-architecture.md * add guildlines/conventional-commit.md *add database-schema.md
1 parent 7b25f9e commit f330636

3 files changed

Lines changed: 83 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Database Schema
2+
3+
The database is built on **PostgreSQL** (hosted via Supabase) and is strictly secured using **Row Level Security (RLS)**.
4+
5+
6+
7+
### Core Database Dictionary
8+
9+
| Table Name | Description / Purpose | Key Relationships & Security |
10+
| :--- | :--- | :--- |
11+
| **`profile`** | Extended data for Supabase users (username, avatar, timezone). | `1:1` with `auth.users`. |
12+
| **`category`** | Life contexts or folders created by users (e.g., Work, Health). | Belongs to `profile` (RLS enforced). |
13+
| **`task`** | The main entity containing to-do properties (title, status, priority). | Belongs to `profile` and `category`. |
14+
| **`note`** | Satellite table for long-form text descriptions. | `1:N` with `task`. |
15+
| **`subtask`** | Satellite table acting as a checklist inside a specific task. | `1:N` with `task`. |
16+
| **`reminder`** | Scheduling entity for push notifications. | `1:N` with `task`. |
17+
18+
### Security Architecture
19+
* **Row Level Security (RLS):** Every core table contains a `profile_id`. RLS policies are enforced at the database level so users can only `SELECT`, `INSERT`, `UPDATE`, or `DELETE` their own data.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
# Flutter App Architecture
3+
4+
**TaskManagement App** is built based on **Feature-Based MVVM**
5+
Architecture
6+
7+
In each feature, we organize the folders based on **MVVM** Architecture
8+
9+
### 1. core
10+
- `.env`: Contains **Supabase URL** and secrets key
11+
- **Themes & Constants**: Stores global UI configurations and constant values.
12+
13+
### 2. features
14+
- `model`: Contains classes to define data
15+
- `view`: Contains UI widgets
16+
- `viewmodel`: Implements business logic and handles state management.
17+
- `services`: Handles data operations and communicates with the Supabase Backend.
18+
```plaintext
19+
.
20+
└── 📂 src/
21+
├── 📂 android
22+
├── 📂 ios
23+
├── 📂 lib/
24+
│ ├── 📂 core
25+
│ ├── 📂 features/
26+
│ │ ├── 📂 auth/
27+
│ │ │ ├── 📂 model
28+
│ │ │ ├── 📂 view
29+
│ │ │ ├── 📂 viewmodel
30+
│ │ │ └── 📂 services
31+
│ │ └── 📂 ...
32+
│ └── main.dart
33+
├── 📂 test
34+
├── pubspec.lock
35+
├── pubspec.yaml
36+
└── .metadata
37+
38+
```
39+
40+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## 📌 Git Commit Convention
2+
3+
To maintain a clean, readable, and trackable commit history, all team members **MUST** adhere to the following commit guidelines.
4+
5+
### 1. Standard Syntax
6+
`<type>(<scope>): <short_description>`
7+
8+
### 2. Allowed Types
9+
10+
| Icon | Type | Description | Example |
11+
| :---: | :--- | :--- | :--- |
12+
|| **feat** | Adds a new feature to the application. | `feat(auth): add JWT login API` |
13+
| 🐛 | **fix** | Patches a bug or resolves an issue. | `fix(cart): resolve incorrect total price calculation` |
14+
| ♻️ | **refactor**| Restructures code without changing existing logic or adding features. | `refactor(product): clean up IProductService interface` |
15+
| 📝 | **docs** | Adds or updates documentation (README, diagrams, etc.). | `docs(ci): update SonarCloud workflow` |
16+
| 🔧 | **chore** | Maintenance tasks, configurations, or dependency updates. | `chore(deps): bump Newtonsoft.Json to 10.0.4` |
17+
| 🚀 | **perf** | Code changes that improve performance. | `perf(db): add index to Product table for faster queries` |
18+
19+
### 3. Golden Rules
20+
- The `type` and `scope` MUST strictly be in **lowercase**.
21+
- The description must be clear, concise, and straight to the point.
22+
- **NEVER** push code with meaningless commit messages such as: `update`, `fix bug`, `done part A`, `asdfgh`.
23+
24+
Reference: [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/)

0 commit comments

Comments
 (0)