Перевод проекта на единую SQLite БД, WAL и обновление README для Windows

This commit is contained in:
2026-03-03 23:53:22 +05:00
parent 906a6cb91f
commit 9bfc6e668f
11 changed files with 100 additions and 34 deletions

View File

@@ -1,15 +1,59 @@
# ClashDeckGenerator2
🌸 Welcome to your Hanami app!
Приложение на Hanami 2.3 (Ruby 3.4, SQLite).
## Getting started
## Запуск на Windows (через winget)
- Set up the project with `bin/setup`
- Run the server with `bin/dev`
- View the app at [http://localhost:2300](http://localhost:2300)
- Run the tests with `bundle exec rake`
### 1) Установить зависимости
## Useful links
```bat
winget install -e --id RubyInstallerTeam.RubyWithDevKit.3.4
winget install -e --id SQLite.SQLite
winget install -e --id Git.Git
```
После установки открой новый терминал (чтобы обновился `PATH`).
### 2) Установить Ruby-зависимости проекта
```bat
bundle install
```
### 3) Подготовить БД
```bat
bundle exec hanami db prepare
```
Команда создаст/обновит:
- [`db/db.sqlite3`](db/db.sqlite3)
- [`db/db_test.sqlite3`](db/db_test.sqlite3)
### 4) Запуск приложения
```bat
bundle exec puma -C config/puma.rb config.ru
```
Открыть: [http://localhost:2300](http://localhost:2300)
## Важно про SQLite для Hanami
Для корректной работы нужны **две части**:
1. Ruby-модуль [`gem "sqlite3"`](Gemfile:17) — используется приложением и адаптером БД.
Устанавливается через [`bundle install`](README.md:27).
2. CLI-утилита `sqlite3` (отдельный бинарник) — нужна командам Hanami, например [`hanami db prepare`](README.md:33).
Ставится через [`winget install -e --id SQLite.SQLite`](README.md:13).
Если `bundle` или `hanami` не находятся в `cmd`, проверь Ruby в `PATH` или временно добавь:
```bat
set "PATH=C:\Ruby34-x64\bin;%PATH%"
```
## Полезные ссылки
- [Hanami](http://hanamirb.org)
- [Hanami guides](https://guides.hanamirb.org/)
- [Hanami Guides](https://guides.hanamirb.org/)