Skip to content

Commit

Permalink
Start rewriting with SvelteAdmin instead of custom stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierstoval committed Jan 18, 2024
1 parent 9f4c7a0 commit c6e1f04
Show file tree
Hide file tree
Showing 65 changed files with 2,053 additions and 5,788 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @type { import("eslint").Linter.Config } */
module.exports = {
root: true,
extends: [
Expand All @@ -8,7 +9,6 @@ module.exports = {
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
ignorePatterns: ['*.cjs'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ node_modules
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

static/bootstrap*
17 changes: 8 additions & 9 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
117 changes: 22 additions & 95 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,111 +1,38 @@
# 🍎 Compotes 🍏
# create-svelte

A small application to visualise bank operations in graphs and plots.
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).

# 🧮
## Creating a project

> This is the second version of the main app that was previously built with PHP and Symfony.
>
> The new app is built in [Rust](https://www.rust-lang.org/) with [Tauri](https://tauri.studio/) for the backend, and uses [Typescript](https://www.typescriptlang.org/) and [Svelte](https://svelte.dev/) for the frontend part.
If you're seeing this, you've probably already done this step. Congrats!

![App screenshot](docs/capture1.png)

## Install

The project is not even in beta for now.

You can still find latest nightly builds on the [Actions](https://github.com/Orbitale/Compotes/actions) page, if you check out the latest successful action marked by a "☑️" mark (if there is one at least).

The latest builds can also be found on [nightly.link](https://nightly.link/Orbitale/Compotes/workflows/main.yaml/rewrite)

## Project setup

If you want to use the in-development project, you can compile it by doing what is explained in the following steps.

### Requirements

- [Rust](https://www.rust-lang.org/tools/install)
- [Node.js](https://nodejs.org/en/download/)
- [Yarn](https://yarnpkg.com/getting-started/install) (preferred by the Tauri team, so expect better compatibility)
- For Linux users:
- Follow [this guide](https://tauri.studio/docs/getting-started/setting-up-linux#1-system-dependencies) to install the **system dependencies** that are mandatory.
- For Windows users:
- [Webview2](https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section)
- For MacOS users:
- XCode
- The GNU C Compiler, installable via `brew install gcc`

### Install
```bash
# create a new project in the current directory
npm create svelte@latest

# create a new project in my-app
npm create svelte@latest my-app
```
yarn install
```

> You do not need to install Rust dependencies, since running `cargo` commands like `cargo run` will automatically download and compile dependencies.

### Run the app in dev mode
## Developing

```
yarn tauri dev
```
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

### Compile for production
```bash
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
```
yarn tauri build
```

> This command builds the app in the `src-tauri/target/release/` directory.

## Import a database from v1
## Building

- Run `make dump` in the v1 app
- Get the `var/dump_***.sql` file that was just generated
- Install `mysql2sqlite` via this script:
```bash
wget https://raw.githubusercontent.com/dumblob/mysql2sqlite/master/mysql2sqlite
```
- Run it on the sql file you got and create your database:
```bash
./mysql2sqlite dump_***.sql | sqlite3 data.db3
```
- Pray it works 🙏
To create a production version of your app:

### Roadmap

Since the entire app is being rewritten, lots of stuff have to be re-implemented.
```bash
npm run build
```

> The "☑️" mark means the feature is implemented, while the "⬜️" mark means the feature is waiting for implementation.
You can preview the production build with `npm run preview`.

- Core features:
- ☑️ Create the Tauri app
- ☑️ Create the Svelte frontend with it
- ☑️ List operations
- ☑️ Allow sorting operations by some fields
- ☑️ Allow filtering operations
- ☑️ Allow saving current filter to be reused in graphs
- ☑️ Allow filtering operations that have no tags
- ☑️ Allow ignoring an operation in graphs calculations
- ☑️ Tags CRUD
- ☑️ Tag rules CRUD
- ☑️ Bank accounts CRUD
- ☑️ Edit bank account details
- ☑️ Import operations from CSV file
- ☑️ Add tags to operations directly from the list
- ☑️ Sync operations for triage
- ☑️ Sync operations tags with tag rules
- ⬜️ Add the graphs that are at the core of this app 😅
- ☑️ Allow using saved filters for graphs
- ⬜️ Allow creating and saving custom graphs
- Additional features that might be cool:
- ⬜️ Allow customizing graphs
- ⬜️ Config panel
- ⬜️ Allow customizing database, for multiple database usage
- ⬜️ Allow exporting/importing whole database
- ⬜️ User account system for multi-user usage
- ⬜️ Encrypt entire database with a password/passphrase for safety
- ⬜️ Store filters to the database instead of `localStorage`
- Some things are quite buggy and the app needs improvements too:
- ☑️ Check why we have to use `location.reload()` because svelte stores don't update the paginated tables => I actually used SvelteKit's `goto()` from `$app/navigation` and it works great 👌
- ⬜️ Use a `select2` or similar for tags selection
- ⬜️ Add the ability to create a Tag Rule based on an Operation in the operations list
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
65 changes: 65 additions & 0 deletions old/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"build": {
"beforeBuildCommand": "yarn run build",
"beforeDevCommand": "yarn run dev",
"devPath": "http://127.0.0.1:5173",
"distDir": "./target/frontend-build"
},
"package": {
"productName": "compotes",
"version": "0.1.0"
},
"tauri": {
"allowlist": {
"all": true
},
"bundle": {
"active": true,
"category": "DeveloperTool",
"copyright": "",
"deb": {
"depends": []
},
"externalBin": [],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/[email protected]",
"icons/icon.icns",
"icons/icon.ico"
],
"identifier": "io.orbitale.compotes",
"longDescription": "",
"macOS": {
"entitlements": null,
"exceptionDomain": "",
"frameworks": [],
"minimumSystemVersion": "",
"signingIdentity": null
},
"resources": [],
"shortDescription": "",
"targets": ["msi", "deb"],
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
}
},
"security": {
"csp": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; object-src 'none'; require-trusted-types-for 'script';"
},
"updater": {
"active": false
},
"windows": [
{
"fullscreen": false,
"height": 800,
"resizable": true,
"title": "Compotes",
"width": 1024
}
]
}
}
97 changes: 32 additions & 65 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,76 +4,43 @@
"private": true,
"license": "LGPL-3.0-or-later",
"scripts": {
"app": "concurrently --names \"front,back\" --raw \"vite dev\" \"tauri dev\"",
"dev": "vite dev",
"build": "vite build",
"package": "vite package",
"preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. src && eslint --ignore-path .gitignore src",
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. src",
"test": "yarn --cwd tests/webdriverio run test",
"tauri": "tauri",
"postinstall": "yarn --cwd tests/webdriverio/"
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"tauri": "tauri"
},
"devDependencies": {
"@popperjs/core": "^2.11.7",
"@sveltejs/adapter-static": "2.0.3",
"@sveltejs/kit": "^1.15.9",
"@tauri-apps/api": "^1.2.0",
"@tauri-apps/cli": "^1.2.3",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"@zerodevx/svelte-toast": "^0.9.3",
"bootstrap": "^5.2.3",
"chart.js": "^4.3.0",
"concurrently": "^8.0.1",
"date-fns": "^2.30.0",
"date-picker-svelte": "^2.4.2",
"eslint": "^8.39.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-svelte3": "^4.0.0",
"luxon": "^3.3.0",
"prettier": "^3.0.1",
"prettier-plugin-svelte": "^3.0.3",
"sass": "^1.62.1",
"svelte": "^4.1.2",
"@orbitale/svelte-admin": "^0.11.1",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.3.5",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@tauri-apps/api": "^1.5.3",
"@tauri-apps/cli": "^1.5.9",
"@types/eslint": "8.56.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@zerodevx/svelte-toast": "^0.9.5",
"carbon-components-svelte": "^0.82.8",
"carbon-icons-svelte": "^12.4.2",
"chart.js": "^4.4.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.35.1",
"luxon": "^3.4.4",
"prettier": "^3.2.4",
"prettier-plugin-svelte": "^3.1.2",
"sass": "^1.70.0",
"svelte": "^4.2.7",
"svelte-chartjs": "^3.1.2",
"svelte-check": "^3.2.0",
"svelte-dragdroplist": "^1.1.1",
"svelte-preprocess": "^5.0.3",
"ts-results-es": "^4.0.0",
"tslib": "^2.5.0",
"typescript": "^5.0.4",
"vite": "^4.4.9"
"svelte-check": "^3.6.0",
"ts-results-es": "^4.1.0-alpha.1",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.0.3"
},
"flat": true,
"type": "module",
"resolutions": {
"tslib": "2.6.1",
"magic-string": "0.30.2",
"@jridgewell/sourcemap-codec": "1.4.15",
"glob-parent": "6.0.2",
"eslint-scope": "7.2.2",
"estraverse": "5.3.0",
"supports-color": "8.1.1",
"rimraf": "3.0.2",
"ansi-styles": "6.2.1",
"string-width": "5.1.2",
"strip-ansi": "7.1.0",
"wrap-ansi": "8.1.0",
"ansi-regex": "6.0.1",
"emoji-regex": "8.0.0",
"minimatch": "9.0.3",
"glob": "10.3.3",
"brace-expansion": "2.0.1",
"lru-cache": "10.0.0"
},
"dependencies": {
"emoji-regex": "^8.0.0",
"rimraf": "^3.0.2",
"string-width": "^5.1.2",
"supports-color": "^8.1.1"
}
"type": "module"
}
Loading

0 comments on commit c6e1f04

Please sign in to comment.