diff --git a/README.md b/README.md index fbd2efc..eb7b9d7 100644 --- a/README.md +++ b/README.md @@ -1,107 +1,114 @@ -# Tauri: An Ultimate Project Template +# NordicFlow 🇳🇴 -[![NPM Version](https://img.shields.io/npm/v/create-tauri-react)](https://www.npmjs.com/package/create-tauri-react) -[![NPM Downloads](https://img.shields.io/npm/dm/create-tauri-react)](https://www.npmjs.com/package/create-tauri-react) +**NordicFlow** to nowoczesna aplikacja desktopowa do nauki języka norweskiego, wykorzystująca Local AI do interaktywnych konwersacji, analizy obrazu i nauki z wideo. -This template should help get you started developing with [Tauri](https://tauri.app), [React](https://reactjs.org), [Typescript](https://typescriptlang.org) and [Tailwind CSS](https://tailwindcss.com) (w/ [shadcn/ui](https://ui.shadcn.com/)) in [Vite](https://vitejs.dev). +Projekt zbudowany w oparciu o **Tauri 2.0**, **React 19**, **TypeScript** oraz **Rust**. -The architecture is based on practices suggested by [@alan2207](https://github.com/alan2207) in his [bulletproof-react](https://github.com/alan2207/bulletproof-react/blob/master/docs/project-structure.md). +## 🚀 Kluczowe Funkcje -In addition, this template configures [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [Husky](https://typicode.github.io/husky/) and [Lint-staged](https://github.com/lint-staged/lint-staged) for pre-commits. +* **AI Chat**: Konwersacje z wirtualnym nauczycielem (model Llama 3.1) z korektą błędów w czasie rzeczywistym. +* **Visual Recognition**: Nauka słownictwa poprzez rozpoznawanie obiektów na zdjęciach (model MiniCPM-V). +* **Smart Reading**: Generowanie historii dopasowanych do poziomu użytkownika z ćwiczeniami "fill-in-the-blank". +* **Video Learning**: Nauka z materiałów wideo z transkrypcją i interaktywnymi napisami (wymaga Whisper). +* **Flashcards & Mini Games**: Fiszki, tryb pisowni i gry językowe. -![Demo Screenshot](./assets/demo.png) +## 🛠️ Wymagania Wstępne -## Getting Started +Aby uruchomić projekt w trybie deweloperskim, potrzebujesz: -### Basics +1. **Node.js** (v18+) +2. **Rust** (najnowsza wersja stabilna) +3. **Build Tools for Visual Studio** (Windows) - z zaznaczonym "Desktop development with C++". +4. **Sterowniki NVIDIA CUDA** (Zalecane dla płynnego działania AI na GPU). -Ensure that you have the [Tauri prerequisites](https://tauri.app/v1/guides/getting-started/prerequisites) installed. - -#### Create a new project +## ⚙️ Instalacja i Uruchomienie +1. **Sklonuj repozytorium:** ```bash -npx create-tauri-react@latest -``` - -## What's included - -### Core - -A basic Tauri setup with Vite, React, Typescript. - -#### Tailwind CSS - -A basic Tailwind CSS setup. Includes a `components.json` for Shadcn UI components. - -### Dev Tools - -#### Eslint 9 - -A new Eslint 9 setup with flat config. This will help you to keep your code clean and consistent. - -#### Prettier - -A basic Prettier setup to keep your code formatted. - -#### Husky + Lint-staged - -Pre-commit hooks to run Eslint and Prettier on staged files. - -## How to use? - -Once again, the architecture of the template is based on practices proposed by [@alan2207](https://github.com/alan2207) in his [bulletproof-react](https://github.com/alan2207/bulletproof-react/blob/master/docs/project-structure.md). +git clone https://github.com/twoj-nick/nordicflow.git +cd nordicflow ``` -src -| -+-- app # application layer containing: -| | # this folder might differ based on the meta framework used -| +-- routes # application routes / can also be pages -| +-- app.tsx # main application component -| +-- provider.tsx # application provider that wraps the entire application with different global providers - this might also differ based on meta framework used -| +-- router.tsx # application router configuration -+-- assets # assets folder can contain all the static files such as images, fonts, etc. -| -+-- components # shared components used across the entire application -| -+-- config # global configurations, exported env variables etc. -| -+-- features # feature based modules -| -+-- hooks # shared hooks used across the entire application -| -+-- lib # reusable libraries preconfigured for the application -| -+-- stores # global state stores -| -+-- testing # test utilities and mocks -| -+-- types # shared types used across the application -| -+-- utils # shared utility functions -``` + + +2. **Zainstaluj zależności frontendowe:** +```bash +npm install ``` -src/features/awesome-feature -| -+-- api # exported API request declarations and api hooks related to a specific feature -| -+-- assets # assets folder can contain all the static files for a specific feature -| -+-- components # components scoped to a specific feature -| -+-- hooks # hooks scoped to a specific feature -| -+-- stores # state stores for a specific feature -| -+-- types # typescript types used within the feature -| -+-- utils # utility functions for a specific feature + + +3. **Uruchom tryb deweloperski:** +```bash +npm run tauri dev + ``` -So, simply put: -- Define your app's routes in `src/app/router.tsx` and `src/app/routes/*` with minimal business logic. -- The pages from the routes should be using `src/features` to build up functionality on the page. -- The features should be using components from `src/components`, which are pure ui components (like [Shadcn UI](https://ui.shadcn.com/)) or layouts. -- For an extended template, you can look up [`@MrLightful/powersync-tauri`](https://github.com/MrLightful/powersync-tauri), which also defines `src/config` and `src/hooks` examples. + +--- + +## 🤖 Konfiguracja AI (Instalacja Manualna) + +⚠️ **WAŻNE:** Obecna wersja deweloperska nie pobiera automatycznie silnika wykonawczego AI (`llama.cpp`). Należy go zainstalować ręcznie, aby funkcje **AI Chat** i **Visual Recognition** działały. + +W przyszłości proces ten będzie zautomatyzowany wewnątrz aplikacji. + +### Krok 1: Pobierz wymagane pliki + +Pobierz poniższe archiwa `.zip` (wersja `b4603` lub nowsza, kompatybilna z CUDA 12.4): + +1. 📥 **Pliki wykonywalne (Binaries):** +[llama-b4603-bin-win-cuda-12.4-x64.zip](https://www.google.com/search?q=https://github.com/ggml-org/llama.cpp/releases/download/b4603/llama-b4603-bin-win-cuda-12.4-x64.zip) +2. 📥 **Biblioteki CUDA (Backend):** +[cudart-llama-bin-win-cuda-12.4-x64.zip](https://www.google.com/search?q=https://github.com/ggml-org/llama.cpp/releases/download/b4603/cudart-llama-bin-win-cuda-12.4-x64.zip) + +### Krok 2: Zlokalizuj folder danych aplikacji + +Uruchom aplikację raz (`npm run tauri dev`), aby utworzyła ona swoje katalogi systemowe. Następnie znajdź folder danych lokalnych: + +* **Windows**: Wciśnij `Win + R`, wpisz `%LocalAppData%` i szukaj folderu o nazwie **`NordicFlow`** (lub `com.nordicflow.app`). + +### Krok 3: Instalacja plików + +1. W folderze `src-tauri` utwórz katalog o nazwie `binaries` (jeśli aplikacja nie utworzyła go automatycznie). +2. Wypakuj **zawartość obu pobranych archiwów** bezpośrednio do tego folderu. +3. Upewnij się, że plik `llama-server.exe` oraz pliki `.dll` (np. `cudart64_12.dll`) znajdują się w tym samym katalogu, z którego korzysta aplikacja. + + +### Uwaga dotycząca funkcji Video (Whisper) + +Do działania funkcji **Video Learning** (transkrypcja) aplikacja w kodzie odwołuje się również do `whisper-cli.exe` oraz `ffmpeg.exe`. Te pliki również powinny znaleźć się w folderze z binariami, jeśli chcesz korzystać z tej konkretnej funkcji. + +--- + +## 📂 Modele AI + +Aplikacja automatycznie zarządza pobieraniem modeli językowych (GGUF) przy pierwszej próbie użycia danej funkcji. + +* **Czat:** `Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf` (~4.8 GB) +* **Wzrok:** `MiniCPM-V-2_6-Q4_K_M.gguf` + projektor (~5 GB) +* **Mowa:** `nb-whisper-medium-q5_0.gguf` (~1 GB) + +Modele są zapisywane w katalogu `%LocalAppData%\NordicFlow\models`. + +## 🏗️ Struktura Projektu + +* `src/` - Kod źródłowy Frontend (React) +* `src/features/` - Moduły funkcjonalne (ai-chat, flashcards, video-learning) +* `src/components/` - Komponenty UI (Shadcn/ui) + + +* `src-tauri/` - Kod źródłowy Backend (Rust) +* `src-tauri/src/commands.rs` - Komendy Tauri (logika AI, pliki) +* `src-tauri/capabilities/` - Uprawnienia Tauri 2.0 + + + +## 🤝 Kontrybucja + +Projekt jest w fazie aktywnego rozwoju. Zgłoszenia błędów (Issues) i propozycje zmian (Pull Requests) są mile widziane. + +## 📄 Licencja + +CC BY-NC-SA 4.0 License © 2026 Kazimierz Ciołek \ No newline at end of file