Initial project scaffold: Tauri v2 + React + TypeScript + TailwindCSS v4

- Tauri v2 with SQLite plugin and full database schema
- React with react-router-dom, i18n (FR/EN), recharts, lucide-react
- TailwindCSS v4 with custom Bleu/Creme/Terracotta palette
- App shell with sidebar navigation (7 pages)
- Dashboard with summary cards, page stubs for all sections
- Default category configuration (10 top-level categories)
- TypeScript interfaces matching SQLite schema

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Le-King-Fu 2026-02-07 03:07:19 +00:00
parent d3e6d01ad5
commit 801404ca21
55 changed files with 10203 additions and 0 deletions

44
.gitignore vendored Normal file
View file

@ -0,0 +1,44 @@
# Logs
logs
*.log
npm-debug.log*
# Dependencies
node_modules/
# Build output
dist/
dist-ssr/
target/
# User data
data/
*.db
*.db-journal
*.db-wal
# Imports
imports/*.csv
# Environment
.env
.env.local
*.local
# IDE
.vscode/*
!.vscode/extensions.json
.idea/
*.swp
*.swo
*.suo
*.ntvs*
*.njsproj
*.sln
# OS
.DS_Store
Thumbs.db
# Tauri generated
src-tauri/gen/

View file

@ -0,0 +1,117 @@
[
{
"name": "Logement",
"type": "expense",
"color": "#4A90A4",
"icon": "Home",
"children": [
{ "name": "Loyer", "type": "expense" },
{ "name": "Charges", "type": "expense" },
{ "name": "Assurance habitation", "type": "expense" },
{ "name": "Énergie", "type": "expense" },
{ "name": "Internet/Téléphone", "type": "expense" }
]
},
{
"name": "Transport",
"type": "expense",
"color": "#C17767",
"icon": "Car",
"children": [
{ "name": "Carburant", "type": "expense" },
{ "name": "Transports en commun", "type": "expense" },
{ "name": "Assurance auto", "type": "expense" },
{ "name": "Entretien véhicule", "type": "expense" },
{ "name": "Stationnement", "type": "expense" }
]
},
{
"name": "Alimentation",
"type": "expense",
"color": "#22c55e",
"icon": "ShoppingCart",
"children": [
{ "name": "Courses", "type": "expense" },
{ "name": "Restaurants", "type": "expense" },
{ "name": "Livraison repas", "type": "expense" }
]
},
{
"name": "Santé",
"type": "expense",
"color": "#ef4444",
"icon": "Heart",
"children": [
{ "name": "Médecin", "type": "expense" },
{ "name": "Pharmacie", "type": "expense" },
{ "name": "Mutuelle", "type": "expense" }
]
},
{
"name": "Loisirs",
"type": "expense",
"color": "#a855f7",
"icon": "Gamepad2",
"children": [
{ "name": "Sorties", "type": "expense" },
{ "name": "Sport", "type": "expense" },
{ "name": "Culture", "type": "expense" },
{ "name": "Vacances", "type": "expense" },
{ "name": "Abonnements", "type": "expense" }
]
},
{
"name": "Shopping",
"type": "expense",
"color": "#f59e0b",
"icon": "ShoppingBag",
"children": [
{ "name": "Vêtements", "type": "expense" },
{ "name": "Électronique", "type": "expense" },
{ "name": "Maison/Déco", "type": "expense" }
]
},
{
"name": "Services",
"type": "expense",
"color": "#6366f1",
"icon": "Wrench",
"children": [
{ "name": "Banque", "type": "expense" },
{ "name": "Impôts", "type": "expense" },
{ "name": "Abonnements numériques", "type": "expense" }
]
},
{
"name": "Transferts",
"type": "transfer",
"color": "#64748b",
"icon": "ArrowLeftRight",
"children": [
{ "name": "Épargne", "type": "transfer" },
{ "name": "Virement interne", "type": "transfer" }
]
},
{
"name": "Revenus",
"type": "income",
"color": "#22c55e",
"icon": "Banknote",
"children": [
{ "name": "Salaire", "type": "income" },
{ "name": "Freelance", "type": "income" },
{ "name": "Aides/Allocations", "type": "income" },
{ "name": "Remboursements", "type": "income" },
{ "name": "Autres revenus", "type": "income" }
]
},
{
"name": "Autres",
"type": "expense",
"color": "#9ca3af",
"icon": "MoreHorizontal",
"children": [
{ "name": "Non catégorisé", "type": "expense" }
]
}
]

View file

@ -0,0 +1 @@
[]

14
index.html Normal file
View file

@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tauri + React + Typescript</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

3042
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

36
package.json Normal file
View file

@ -0,0 +1,36 @@
{
"name": "simpl_result_scaffold",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"tauri": "tauri"
},
"dependencies": {
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-opener": "^2",
"@tauri-apps/plugin-sql": "^2.3.2",
"i18next": "^25.8.4",
"lucide-react": "^0.563.0",
"papaparse": "^5.5.3",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-i18next": "^16.5.4",
"react-router-dom": "^7.13.0",
"recharts": "^3.7.0"
},
"devDependencies": {
"@tailwindcss/vite": "^4.1.18",
"@tauri-apps/cli": "^2",
"@types/papaparse": "^5.5.2",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@vitejs/plugin-react": "^4.7.0",
"tailwindcss": "^4.1.18",
"typescript": "~5.8.3",
"vite": "^6.4.1"
}
}

6
public/tauri.svg Normal file
View file

@ -0,0 +1,6 @@
<svg width="206" height="231" viewBox="0 0 206 231" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M143.143 84C143.143 96.1503 133.293 106 121.143 106C108.992 106 99.1426 96.1503 99.1426 84C99.1426 71.8497 108.992 62 121.143 62C133.293 62 143.143 71.8497 143.143 84Z" fill="#FFC131"/>
<ellipse cx="84.1426" cy="147" rx="22" ry="22" transform="rotate(180 84.1426 147)" fill="#24C8DB"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M166.738 154.548C157.86 160.286 148.023 164.269 137.757 166.341C139.858 160.282 141 153.774 141 147C141 144.543 140.85 142.121 140.558 139.743C144.975 138.204 149.215 136.139 153.183 133.575C162.73 127.404 170.292 118.608 174.961 108.244C179.63 97.8797 181.207 86.3876 179.502 75.1487C177.798 63.9098 172.884 53.4021 165.352 44.8883C157.82 36.3744 147.99 30.2165 137.042 27.1546C126.095 24.0926 114.496 24.2568 103.64 27.6274C92.7839 30.998 83.1319 37.4317 75.8437 46.1553C74.9102 47.2727 74.0206 48.4216 73.176 49.5993C61.9292 50.8488 51.0363 54.0318 40.9629 58.9556C44.2417 48.4586 49.5653 38.6591 56.679 30.1442C67.0505 17.7298 80.7861 8.57426 96.2354 3.77762C111.685 -1.01901 128.19 -1.25267 143.769 3.10474C159.348 7.46215 173.337 16.2252 184.056 28.3411C194.775 40.457 201.767 55.4101 204.193 71.404C206.619 87.3978 204.374 103.752 197.73 118.501C191.086 133.25 180.324 145.767 166.738 154.548ZM41.9631 74.275L62.5557 76.8042C63.0459 72.813 63.9401 68.9018 65.2138 65.1274C57.0465 67.0016 49.2088 70.087 41.9631 74.275Z" fill="#FFC131"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.4045 76.4519C47.3493 70.6709 57.2677 66.6712 67.6171 64.6132C65.2774 70.9669 64 77.8343 64 85.0001C64 87.1434 64.1143 89.26 64.3371 91.3442C60.0093 92.8732 55.8533 94.9092 51.9599 97.4256C42.4128 103.596 34.8505 112.392 30.1816 122.756C25.5126 133.12 23.9357 144.612 25.6403 155.851C27.3449 167.09 32.2584 177.598 39.7906 186.112C47.3227 194.626 57.153 200.784 68.1003 203.846C79.0476 206.907 90.6462 206.743 101.502 203.373C112.359 200.002 122.011 193.568 129.299 184.845C130.237 183.722 131.131 182.567 131.979 181.383C143.235 180.114 154.132 176.91 164.205 171.962C160.929 182.49 155.596 192.319 148.464 200.856C138.092 213.27 124.357 222.426 108.907 227.222C93.458 232.019 76.9524 232.253 61.3736 227.895C45.7948 223.538 31.8055 214.775 21.0867 202.659C10.3679 190.543 3.37557 175.59 0.949823 159.596C-1.47592 143.602 0.768139 127.248 7.41237 112.499C14.0566 97.7497 24.8183 85.2327 38.4045 76.4519ZM163.062 156.711L163.062 156.711C162.954 156.773 162.846 156.835 162.738 156.897C162.846 156.835 162.954 156.773 163.062 156.711Z" fill="#24C8DB"/>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

1
public/vite.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

7
src-tauri/.gitignore vendored Normal file
View file

@ -0,0 +1,7 @@
# Generated by Cargo
# will have compiled files and executables
/target/
# Generated by Tauri
# will have schema files for capabilities auto-completion
/gen/schemas

5856
src-tauri/Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

26
src-tauri/Cargo.toml Normal file
View file

@ -0,0 +1,26 @@
[package]
name = "simpl-result"
version = "0.1.0"
description = "Personal finance management app"
authors = ["you"]
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
# The `_lib` suffix may seem redundant but it is necessary
# to make the lib name unique and wouldn't conflict with the bin name.
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
name = "simpl_result_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2", features = [] }
[dependencies]
tauri = { version = "2", features = [] }
tauri-plugin-opener = "2"
tauri-plugin-sql = { version = "2", features = ["sqlite"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"

3
src-tauri/build.rs Normal file
View file

@ -0,0 +1,3 @@
fn main() {
tauri_build::build()
}

View file

@ -0,0 +1,13 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": ["main"],
"permissions": [
"core:default",
"opener:default",
"sql:default",
"sql:allow-execute",
"sql:allow-select"
]
}

BIN
src-tauri/icons/128x128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
src-tauri/icons/32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 974 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
src-tauri/icons/icon.icns Normal file

Binary file not shown.

BIN
src-tauri/icons/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
src-tauri/icons/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1 @@
pub const SCHEMA: &str = include_str!("schema.sql");

View file

@ -0,0 +1,166 @@
-- Simpl'Résultat Database Schema
CREATE TABLE IF NOT EXISTS import_sources (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL UNIQUE,
description TEXT,
date_format TEXT NOT NULL DEFAULT '%d/%m/%Y',
delimiter TEXT NOT NULL DEFAULT ';',
encoding TEXT NOT NULL DEFAULT 'utf-8',
column_mapping TEXT NOT NULL, -- JSON mapping
skip_lines INTEGER NOT NULL DEFAULT 0,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS imported_files (
id INTEGER PRIMARY KEY AUTOINCREMENT,
source_id INTEGER NOT NULL,
filename TEXT NOT NULL,
file_hash TEXT NOT NULL,
import_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
row_count INTEGER NOT NULL DEFAULT 0,
status TEXT NOT NULL DEFAULT 'completed', -- 'completed', 'partial', 'error'
notes TEXT,
FOREIGN KEY (source_id) REFERENCES import_sources(id) ON DELETE CASCADE,
UNIQUE(source_id, file_hash)
);
CREATE TABLE IF NOT EXISTS categories (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
parent_id INTEGER,
color TEXT,
icon TEXT,
type TEXT NOT NULL DEFAULT 'expense', -- 'expense', 'income', 'transfer'
is_active INTEGER NOT NULL DEFAULT 1,
sort_order INTEGER NOT NULL DEFAULT 0,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (parent_id) REFERENCES categories(id) ON DELETE SET NULL
);
CREATE TABLE IF NOT EXISTS suppliers (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL UNIQUE,
normalized_name TEXT NOT NULL,
category_id INTEGER,
is_active INTEGER NOT NULL DEFAULT 1,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (category_id) REFERENCES categories(id) ON DELETE SET NULL
);
CREATE TABLE IF NOT EXISTS keywords (
id INTEGER PRIMARY KEY AUTOINCREMENT,
keyword TEXT NOT NULL,
category_id INTEGER NOT NULL,
supplier_id INTEGER,
priority INTEGER NOT NULL DEFAULT 0,
is_active INTEGER NOT NULL DEFAULT 1,
FOREIGN KEY (category_id) REFERENCES categories(id) ON DELETE CASCADE,
FOREIGN KEY (supplier_id) REFERENCES suppliers(id) ON DELETE SET NULL,
UNIQUE(keyword, category_id)
);
CREATE TABLE IF NOT EXISTS transactions (
id INTEGER PRIMARY KEY AUTOINCREMENT,
date DATE NOT NULL,
description TEXT NOT NULL,
amount REAL NOT NULL,
category_id INTEGER,
supplier_id INTEGER,
source_id INTEGER,
file_id INTEGER,
original_description TEXT,
notes TEXT,
is_manually_categorized INTEGER NOT NULL DEFAULT 0,
is_split INTEGER NOT NULL DEFAULT 0,
parent_transaction_id INTEGER,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (category_id) REFERENCES categories(id) ON DELETE SET NULL,
FOREIGN KEY (supplier_id) REFERENCES suppliers(id) ON DELETE SET NULL,
FOREIGN KEY (source_id) REFERENCES import_sources(id) ON DELETE SET NULL,
FOREIGN KEY (file_id) REFERENCES imported_files(id) ON DELETE SET NULL,
FOREIGN KEY (parent_transaction_id) REFERENCES transactions(id) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS adjustments (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
description TEXT,
date DATE NOT NULL,
is_recurring INTEGER NOT NULL DEFAULT 0,
recurrence_rule TEXT, -- JSON rule for recurring adjustments
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS adjustment_entries (
id INTEGER PRIMARY KEY AUTOINCREMENT,
adjustment_id INTEGER NOT NULL,
category_id INTEGER NOT NULL,
amount REAL NOT NULL,
description TEXT,
FOREIGN KEY (adjustment_id) REFERENCES adjustments(id) ON DELETE CASCADE,
FOREIGN KEY (category_id) REFERENCES categories(id) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS budget_entries (
id INTEGER PRIMARY KEY AUTOINCREMENT,
category_id INTEGER NOT NULL,
year INTEGER NOT NULL,
month INTEGER NOT NULL, -- 1-12
amount REAL NOT NULL,
notes TEXT,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (category_id) REFERENCES categories(id) ON DELETE CASCADE,
UNIQUE(category_id, year, month)
);
CREATE TABLE IF NOT EXISTS budget_templates (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL UNIQUE,
description TEXT,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS budget_template_entries (
id INTEGER PRIMARY KEY AUTOINCREMENT,
template_id INTEGER NOT NULL,
category_id INTEGER NOT NULL,
amount REAL NOT NULL,
FOREIGN KEY (template_id) REFERENCES budget_templates(id) ON DELETE CASCADE,
FOREIGN KEY (category_id) REFERENCES categories(id) ON DELETE CASCADE,
UNIQUE(template_id, category_id)
);
CREATE TABLE IF NOT EXISTS user_preferences (
key TEXT PRIMARY KEY,
value TEXT NOT NULL,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- Indexes
CREATE INDEX IF NOT EXISTS idx_transactions_date ON transactions(date);
CREATE INDEX IF NOT EXISTS idx_transactions_category ON transactions(category_id);
CREATE INDEX IF NOT EXISTS idx_transactions_supplier ON transactions(supplier_id);
CREATE INDEX IF NOT EXISTS idx_transactions_source ON transactions(source_id);
CREATE INDEX IF NOT EXISTS idx_transactions_file ON transactions(file_id);
CREATE INDEX IF NOT EXISTS idx_transactions_parent ON transactions(parent_transaction_id);
CREATE INDEX IF NOT EXISTS idx_categories_parent ON categories(parent_id);
CREATE INDEX IF NOT EXISTS idx_categories_type ON categories(type);
CREATE INDEX IF NOT EXISTS idx_suppliers_category ON suppliers(category_id);
CREATE INDEX IF NOT EXISTS idx_suppliers_normalized ON suppliers(normalized_name);
CREATE INDEX IF NOT EXISTS idx_keywords_category ON keywords(category_id);
CREATE INDEX IF NOT EXISTS idx_keywords_keyword ON keywords(keyword);
CREATE INDEX IF NOT EXISTS idx_budget_entries_period ON budget_entries(year, month);
CREATE INDEX IF NOT EXISTS idx_adjustment_entries_adjustment ON adjustment_entries(adjustment_id);
CREATE INDEX IF NOT EXISTS idx_imported_files_source ON imported_files(source_id);
-- Default preferences
INSERT OR IGNORE INTO user_preferences (key, value) VALUES ('language', 'fr');
INSERT OR IGNORE INTO user_preferences (key, value) VALUES ('theme', 'light');
INSERT OR IGNORE INTO user_preferences (key, value) VALUES ('currency', 'EUR');
INSERT OR IGNORE INTO user_preferences (key, value) VALUES ('date_format', 'DD/MM/YYYY');

23
src-tauri/src/lib.rs Normal file
View file

@ -0,0 +1,23 @@
mod database;
use tauri_plugin_sql::{Migration, MigrationKind};
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
let migrations = vec![Migration {
version: 1,
description: "create initial schema",
sql: database::SCHEMA,
kind: MigrationKind::Up,
}];
tauri::Builder::default()
.plugin(tauri_plugin_opener::init())
.plugin(
tauri_plugin_sql::Builder::default()
.add_migrations("sqlite:simpl_resultat.db", migrations)
.build(),
)
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

6
src-tauri/src/main.rs Normal file
View file

@ -0,0 +1,6 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
fn main() {
simpl_result_lib::run()
}

35
src-tauri/tauri.conf.json Normal file
View file

@ -0,0 +1,35 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Simpl'Résultat",
"version": "0.1.0",
"identifier": "com.simpl.resultat",
"build": {
"beforeDevCommand": "npm run dev",
"devUrl": "http://localhost:1420",
"beforeBuildCommand": "npm run build",
"frontendDist": "../dist"
},
"app": {
"windows": [
{
"title": "Simpl'Résultat",
"width": 1200,
"height": 800
}
],
"security": {
"csp": null
}
},
"bundle": {
"active": true,
"targets": "all",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
}
}

27
src/App.tsx Normal file
View file

@ -0,0 +1,27 @@
import { BrowserRouter, Routes, Route } from "react-router-dom";
import AppShell from "./components/layout/AppShell";
import DashboardPage from "./pages/DashboardPage";
import ImportPage from "./pages/ImportPage";
import TransactionsPage from "./pages/TransactionsPage";
import CategoriesPage from "./pages/CategoriesPage";
import AdjustmentsPage from "./pages/AdjustmentsPage";
import BudgetPage from "./pages/BudgetPage";
import ReportsPage from "./pages/ReportsPage";
export default function App() {
return (
<BrowserRouter>
<Routes>
<Route element={<AppShell />}>
<Route path="/" element={<DashboardPage />} />
<Route path="/import" element={<ImportPage />} />
<Route path="/transactions" element={<TransactionsPage />} />
<Route path="/categories" element={<CategoriesPage />} />
<Route path="/adjustments" element={<AdjustmentsPage />} />
<Route path="/budget" element={<BudgetPage />} />
<Route path="/reports" element={<ReportsPage />} />
</Route>
</Routes>
</BrowserRouter>
);
}

View file

@ -0,0 +1,13 @@
import { Outlet } from "react-router-dom";
import Sidebar from "./Sidebar";
export default function AppShell() {
return (
<div className="flex h-screen overflow-hidden">
<Sidebar />
<main className="flex-1 overflow-y-auto p-6">
<Outlet />
</main>
</div>
);
}

View file

@ -0,0 +1,72 @@
import { useTranslation } from "react-i18next";
import { NavLink } from "react-router-dom";
import {
LayoutDashboard,
Upload,
ArrowLeftRight,
Tags,
SlidersHorizontal,
PiggyBank,
BarChart3,
Languages,
} from "lucide-react";
import { NAV_ITEMS, APP_NAME } from "../../shared/constants";
const iconMap: Record<string, React.ComponentType<{ size?: number }>> = {
LayoutDashboard,
Upload,
ArrowLeftRight,
Tags,
SlidersHorizontal,
PiggyBank,
BarChart3,
};
export default function Sidebar() {
const { t, i18n } = useTranslation();
const toggleLanguage = () => {
const next = i18n.language === "fr" ? "en" : "fr";
i18n.changeLanguage(next);
};
return (
<aside className="flex flex-col w-60 h-screen bg-[var(--sidebar-bg)] text-[var(--sidebar-fg)]">
<div className="p-5 border-b border-white/10">
<h1 className="text-lg font-bold tracking-tight">{APP_NAME}</h1>
</div>
<nav className="flex-1 py-4 space-y-1 px-3">
{NAV_ITEMS.map((item) => {
const Icon = iconMap[item.icon];
return (
<NavLink
key={item.key}
to={item.path}
className={({ isActive }) =>
`flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-colors ${
isActive
? "bg-[var(--sidebar-active)] text-white"
: "text-[var(--sidebar-fg)] hover:bg-[var(--sidebar-hover)]"
}`
}
>
{Icon && <Icon size={18} />}
<span>{t(item.labelKey)}</span>
</NavLink>
);
})}
</nav>
<div className="p-3 border-t border-white/10">
<button
onClick={toggleLanguage}
className="flex items-center gap-2 w-full px-3 py-2 rounded-lg text-sm hover:bg-[var(--sidebar-hover)] transition-colors"
>
<Languages size={18} />
<span>{i18n.language === "fr" ? "English" : "Français"}</span>
</button>
</div>
</aside>
);
}

18
src/i18n/config.ts Normal file
View file

@ -0,0 +1,18 @@
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import fr from "./locales/fr.json";
import en from "./locales/en.json";
i18n.use(initReactI18next).init({
resources: {
fr: { translation: fr },
en: { translation: en },
},
lng: "fr",
fallbackLng: "en",
interpolation: {
escapeValue: false,
},
});
export default i18n;

88
src/i18n/locales/en.json Normal file
View file

@ -0,0 +1,88 @@
{
"app": {
"name": "Simpl'Result"
},
"nav": {
"dashboard": "Dashboard",
"import": "Import",
"transactions": "Transactions",
"categories": "Categories",
"adjustments": "Adjustments",
"budget": "Budget",
"reports": "Reports"
},
"dashboard": {
"title": "Dashboard",
"balance": "Balance",
"income": "Income",
"expenses": "Expenses",
"noData": "No data available. Start by importing your bank statements."
},
"import": {
"title": "Import Statements",
"dropzone": "Drag your CSV files here or click to select",
"source": "Source",
"file": "File",
"status": "Status",
"date": "Date"
},
"transactions": {
"title": "Transactions",
"date": "Date",
"description": "Description",
"amount": "Amount",
"category": "Category",
"supplier": "Supplier",
"noTransactions": "No transactions found."
},
"categories": {
"title": "Categories",
"name": "Name",
"type": "Type",
"parent": "Parent Category",
"color": "Color",
"expense": "Expense",
"income": "Income",
"transfer": "Transfer",
"keywords": "Keywords"
},
"adjustments": {
"title": "Adjustments",
"name": "Name",
"date": "Date",
"description": "Description",
"amount": "Amount",
"recurring": "Recurring"
},
"budget": {
"title": "Budget",
"month": "Month",
"year": "Year",
"planned": "Planned",
"actual": "Actual",
"difference": "Difference",
"template": "Template"
},
"reports": {
"title": "Reports",
"period": "Period",
"byCategory": "By Category",
"byMonth": "By Month",
"trends": "Trends",
"export": "Export"
},
"common": {
"save": "Save",
"cancel": "Cancel",
"delete": "Delete",
"edit": "Edit",
"add": "Add",
"search": "Search",
"filter": "Filter",
"loading": "Loading...",
"noResults": "No results",
"confirm": "Confirm",
"language": "Language",
"total": "Total"
}
}

88
src/i18n/locales/fr.json Normal file
View file

@ -0,0 +1,88 @@
{
"app": {
"name": "Simpl'Résultat"
},
"nav": {
"dashboard": "Tableau de bord",
"import": "Importer",
"transactions": "Transactions",
"categories": "Catégories",
"adjustments": "Ajustements",
"budget": "Budget",
"reports": "Rapports"
},
"dashboard": {
"title": "Tableau de bord",
"balance": "Solde",
"income": "Revenus",
"expenses": "Dépenses",
"noData": "Aucune donnée disponible. Commencez par importer vos relevés bancaires."
},
"import": {
"title": "Importer des relevés",
"dropzone": "Glissez vos fichiers CSV ici ou cliquez pour sélectionner",
"source": "Source",
"file": "Fichier",
"status": "Statut",
"date": "Date"
},
"transactions": {
"title": "Transactions",
"date": "Date",
"description": "Description",
"amount": "Montant",
"category": "Catégorie",
"supplier": "Fournisseur",
"noTransactions": "Aucune transaction trouvée."
},
"categories": {
"title": "Catégories",
"name": "Nom",
"type": "Type",
"parent": "Catégorie parente",
"color": "Couleur",
"expense": "Dépense",
"income": "Revenu",
"transfer": "Transfert",
"keywords": "Mots-clés"
},
"adjustments": {
"title": "Ajustements",
"name": "Nom",
"date": "Date",
"description": "Description",
"amount": "Montant",
"recurring": "Récurrent"
},
"budget": {
"title": "Budget",
"month": "Mois",
"year": "Année",
"planned": "Prévu",
"actual": "Réel",
"difference": "Écart",
"template": "Modèle"
},
"reports": {
"title": "Rapports",
"period": "Période",
"byCategory": "Par catégorie",
"byMonth": "Par mois",
"trends": "Tendances",
"export": "Exporter"
},
"common": {
"save": "Enregistrer",
"cancel": "Annuler",
"delete": "Supprimer",
"edit": "Modifier",
"add": "Ajouter",
"search": "Rechercher",
"filter": "Filtrer",
"loading": "Chargement...",
"noResults": "Aucun résultat",
"confirm": "Confirmer",
"language": "Langue",
"total": "Total"
}
}

11
src/main.tsx Normal file
View file

@ -0,0 +1,11 @@
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "./i18n/config";
import "./styles.css";
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<App />
</React.StrictMode>,
);

View file

@ -0,0 +1,14 @@
import { useTranslation } from "react-i18next";
export default function AdjustmentsPage() {
const { t } = useTranslation();
return (
<div>
<h1 className="text-2xl font-bold mb-6">{t("adjustments.title")}</h1>
<div className="bg-[var(--card)] rounded-xl p-8 border border-[var(--border)] text-center text-[var(--muted-foreground)]">
<p>{t("common.noResults")}</p>
</div>
</div>
);
}

14
src/pages/BudgetPage.tsx Normal file
View file

@ -0,0 +1,14 @@
import { useTranslation } from "react-i18next";
export default function BudgetPage() {
const { t } = useTranslation();
return (
<div>
<h1 className="text-2xl font-bold mb-6">{t("budget.title")}</h1>
<div className="bg-[var(--card)] rounded-xl p-8 border border-[var(--border)] text-center text-[var(--muted-foreground)]">
<p>{t("common.noResults")}</p>
</div>
</div>
);
}

View file

@ -0,0 +1,14 @@
import { useTranslation } from "react-i18next";
export default function CategoriesPage() {
const { t } = useTranslation();
return (
<div>
<h1 className="text-2xl font-bold mb-6">{t("categories.title")}</h1>
<div className="bg-[var(--card)] rounded-xl p-8 border border-[var(--border)] text-center text-[var(--muted-foreground)]">
<p>{t("common.noResults")}</p>
</div>
</div>
);
}

View file

@ -0,0 +1,54 @@
import { useTranslation } from "react-i18next";
import { Wallet, TrendingUp, TrendingDown } from "lucide-react";
export default function DashboardPage() {
const { t } = useTranslation();
const cards = [
{
labelKey: "dashboard.balance",
value: "0,00 €",
icon: Wallet,
color: "text-[var(--primary)]",
},
{
labelKey: "dashboard.income",
value: "0,00 €",
icon: TrendingUp,
color: "text-[var(--positive)]",
},
{
labelKey: "dashboard.expenses",
value: "0,00 €",
icon: TrendingDown,
color: "text-[var(--negative)]",
},
];
return (
<div>
<h1 className="text-2xl font-bold mb-6">{t("dashboard.title")}</h1>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 mb-8">
{cards.map((card) => (
<div
key={card.labelKey}
className="bg-[var(--card)] rounded-xl p-5 border border-[var(--border)] shadow-sm"
>
<div className="flex items-center justify-between mb-3">
<span className="text-sm text-[var(--muted-foreground)]">
{t(card.labelKey)}
</span>
<card.icon size={20} className={card.color} />
</div>
<p className="text-2xl font-semibold">{card.value}</p>
</div>
))}
</div>
<div className="bg-[var(--card)] rounded-xl p-8 border border-[var(--border)] text-center text-[var(--muted-foreground)]">
<p>{t("dashboard.noData")}</p>
</div>
</div>
);
}

16
src/pages/ImportPage.tsx Normal file
View file

@ -0,0 +1,16 @@
import { useTranslation } from "react-i18next";
import { Upload } from "lucide-react";
export default function ImportPage() {
const { t } = useTranslation();
return (
<div>
<h1 className="text-2xl font-bold mb-6">{t("import.title")}</h1>
<div className="bg-[var(--card)] rounded-xl p-12 border-2 border-dashed border-[var(--border)] text-center">
<Upload size={40} className="mx-auto mb-4 text-[var(--muted-foreground)]" />
<p className="text-[var(--muted-foreground)]">{t("import.dropzone")}</p>
</div>
</div>
);
}

14
src/pages/ReportsPage.tsx Normal file
View file

@ -0,0 +1,14 @@
import { useTranslation } from "react-i18next";
export default function ReportsPage() {
const { t } = useTranslation();
return (
<div>
<h1 className="text-2xl font-bold mb-6">{t("reports.title")}</h1>
<div className="bg-[var(--card)] rounded-xl p-8 border border-[var(--border)] text-center text-[var(--muted-foreground)]">
<p>{t("common.noResults")}</p>
</div>
</div>
);
}

View file

@ -0,0 +1,14 @@
import { useTranslation } from "react-i18next";
export default function TransactionsPage() {
const { t } = useTranslation();
return (
<div>
<h1 className="text-2xl font-bold mb-6">{t("transactions.title")}</h1>
<div className="bg-[var(--card)] rounded-xl p-8 border border-[var(--border)] text-center text-[var(--muted-foreground)]">
<p>{t("transactions.noTransactions")}</p>
</div>
</div>
);
}

View file

@ -0,0 +1,49 @@
import type { NavItem } from "../types";
export const APP_NAME = "Simpl'Résultat";
export const DB_NAME = "sqlite:simpl_resultat.db";
export const NAV_ITEMS: NavItem[] = [
{
key: "dashboard",
path: "/",
icon: "LayoutDashboard",
labelKey: "nav.dashboard",
},
{
key: "import",
path: "/import",
icon: "Upload",
labelKey: "nav.import",
},
{
key: "transactions",
path: "/transactions",
icon: "ArrowLeftRight",
labelKey: "nav.transactions",
},
{
key: "categories",
path: "/categories",
icon: "Tags",
labelKey: "nav.categories",
},
{
key: "adjustments",
path: "/adjustments",
icon: "SlidersHorizontal",
labelKey: "nav.adjustments",
},
{
key: "budget",
path: "/budget",
icon: "PiggyBank",
labelKey: "nav.budget",
},
{
key: "reports",
path: "/reports",
icon: "BarChart3",
labelKey: "nav.reports",
},
];

129
src/shared/types/index.ts Normal file
View file

@ -0,0 +1,129 @@
export interface ImportSource {
id: number;
name: string;
description?: string;
date_format: string;
delimiter: string;
encoding: string;
column_mapping: string;
skip_lines: number;
created_at: string;
updated_at: string;
}
export interface ImportedFile {
id: number;
source_id: number;
filename: string;
file_hash: string;
import_date: string;
row_count: number;
status: "completed" | "partial" | "error";
notes?: string;
}
export interface Category {
id: number;
name: string;
parent_id?: number;
color?: string;
icon?: string;
type: "expense" | "income" | "transfer";
is_active: boolean;
sort_order: number;
created_at: string;
}
export interface Supplier {
id: number;
name: string;
normalized_name: string;
category_id?: number;
is_active: boolean;
created_at: string;
updated_at: string;
}
export interface Keyword {
id: number;
keyword: string;
category_id: number;
supplier_id?: number;
priority: number;
is_active: boolean;
}
export interface Transaction {
id: number;
date: string;
description: string;
amount: number;
category_id?: number;
supplier_id?: number;
source_id?: number;
file_id?: number;
original_description?: string;
notes?: string;
is_manually_categorized: boolean;
is_split: boolean;
parent_transaction_id?: number;
created_at: string;
updated_at: string;
}
export interface Adjustment {
id: number;
name: string;
description?: string;
date: string;
is_recurring: boolean;
recurrence_rule?: string;
created_at: string;
updated_at: string;
}
export interface AdjustmentEntry {
id: number;
adjustment_id: number;
category_id: number;
amount: number;
description?: string;
}
export interface BudgetEntry {
id: number;
category_id: number;
year: number;
month: number;
amount: number;
notes?: string;
created_at: string;
updated_at: string;
}
export interface BudgetTemplate {
id: number;
name: string;
description?: string;
created_at: string;
}
export interface BudgetTemplateEntry {
id: number;
template_id: number;
category_id: number;
amount: number;
}
export interface UserPreference {
key: string;
value: string;
updated_at: string;
}
export interface NavItem {
key: string;
path: string;
icon: string;
labelKey: string;
}

102
src/styles.css Normal file
View file

@ -0,0 +1,102 @@
@import "tailwindcss";
@theme {
/* Bleu (Primary) */
--color-bleu-50: #EDF4F7;
--color-bleu-100: #D4E5EB;
--color-bleu-200: #A9CBD7;
--color-bleu-300: #7EB1C3;
--color-bleu-400: #5A9DB3;
--color-bleu-500: #4A90A4;
--color-bleu-600: #3D7789;
--color-bleu-700: #305E6D;
--color-bleu-800: #234552;
--color-bleu-900: #162C36;
/* Creme (Background) */
--color-creme-50: #FFFDFB;
--color-creme-100: #FFF8F0;
--color-creme-200: #FFF1E1;
--color-creme-300: #FFE9D1;
--color-creme-400: #FFE0C0;
--color-creme-500: #F5D4AE;
--color-creme-600: #D4B48E;
--color-creme-700: #B3946E;
--color-creme-800: #8A7254;
--color-creme-900: #61503A;
/* Terracotta (Accent) */
--color-terracotta-50: #FDF2EF;
--color-terracotta-100: #F9E0DA;
--color-terracotta-200: #F0C1B5;
--color-terracotta-300: #E4A291;
--color-terracotta-400: #D5897A;
--color-terracotta-500: #C17767;
--color-terracotta-600: #A46054;
--color-terracotta-700: #874A41;
--color-terracotta-800: #6A3A33;
--color-terracotta-900: #4D2A25;
}
/* Light mode (default) */
:root {
--background: var(--color-creme-100);
--foreground: #1a1a2e;
--card: #FFFFFF;
--card-foreground: #1a1a2e;
--primary: var(--color-bleu-500);
--primary-foreground: #FFFFFF;
--accent: var(--color-terracotta-500);
--accent-foreground: #FFFFFF;
--muted: var(--color-creme-200);
--muted-foreground: #6b7280;
--border: var(--color-creme-300);
--sidebar-bg: var(--color-bleu-800);
--sidebar-fg: var(--color-creme-100);
--sidebar-hover: var(--color-bleu-700);
--sidebar-active: var(--color-bleu-600);
--positive: #22c55e;
--negative: #ef4444;
}
/* Dark mode */
.dark {
--background: #1a1a2e;
--foreground: var(--color-creme-100);
--card: #16213e;
--card-foreground: var(--color-creme-100);
--primary: var(--color-bleu-400);
--primary-foreground: #1a1a2e;
--accent: var(--color-terracotta-400);
--accent-foreground: #1a1a2e;
--muted: #16213e;
--muted-foreground: #9ca3af;
--border: #2a2a4a;
--sidebar-bg: #0f0f23;
--sidebar-fg: var(--color-creme-200);
--sidebar-hover: #16213e;
--sidebar-active: #1a2744;
--positive: #4ade80;
--negative: #f87171;
}
/* Base styles */
body {
background-color: var(--background);
color: var(--foreground);
font-family: "Inter", system-ui, -apple-system, sans-serif;
margin: 0;
min-height: 100vh;
}
/* Scrollbar styling */
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: var(--border);
border-radius: 3px;
}

1
src/vite-env.d.ts vendored Normal file
View file

@ -0,0 +1 @@
/// <reference types="vite/client" />

25
tsconfig.json Normal file
View file

@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}

10
tsconfig.node.json Normal file
View file

@ -0,0 +1,10 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}

33
vite.config.ts Normal file
View file

@ -0,0 +1,33 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
// @ts-expect-error process is a nodejs global
const host = process.env.TAURI_DEV_HOST;
// https://vite.dev/config/
export default defineConfig(async () => ({
plugins: [react(), tailwindcss()],
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
//
// 1. prevent Vite from obscuring rust errors
clearScreen: false,
// 2. tauri expects a fixed port, fail if that port is not available
server: {
port: 1420,
strictPort: true,
host: host || false,
hmr: host
? {
protocol: "ws",
host,
port: 1421,
}
: undefined,
watch: {
// 3. tell Vite to ignore watching `src-tauri`
ignored: ["**/src-tauri/**"],
},
},
}));