Skip to content

Commit 17ebbc0

Browse files
committed
Bootstrapped Sinatra API, Vite/TS SPA and CI
1 parent b05a662 commit 17ebbc0

52 files changed

Lines changed: 6938 additions & 405 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
ruby:
15+
name: Ruby ${{ matrix.ruby }}
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
ruby: ['3.2', '3.3']
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Set up Ruby
25+
uses: ruby/setup-ruby@v1
26+
with:
27+
ruby-version: ${{ matrix.ruby }}
28+
bundler-cache: true
29+
30+
- name: RuboCop
31+
run: bundle exec rubocop --format github
32+
33+
- name: RSpec
34+
run: bundle exec rspec
35+
36+
web:
37+
name: Web (Node ${{ matrix.node }})
38+
runs-on: ubuntu-latest
39+
defaults:
40+
run:
41+
working-directory: web
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
node: ['20', '22']
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Set up Node
50+
uses: actions/setup-node@v4
51+
with:
52+
node-version: ${{ matrix.node }}
53+
cache: npm
54+
cache-dependency-path: web/package-lock.json
55+
56+
- name: Install dependencies
57+
run: npm ci || npm install
58+
59+
- name: Typecheck
60+
run: npm run typecheck
61+
62+
- name: Lint
63+
run: npm run lint
64+
65+
- name: Format check
66+
run: npm run format:check
67+
68+
- name: Unit tests
69+
run: npm test
70+
71+
- name: Build
72+
run: npm run build

.github/workflows/tests.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.gitignore

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
1-
# Ignore bundler config.
1+
# Bundler
22
/.bundle
3+
/vendor/bundle
4+
Gemfile.lock
35

4-
# Ignore the default SQLite database.
5-
/db/*.sqlite3
6-
7-
# Ignore all logfiles and tempfiles.
6+
# Logs and temp files
87
/log/*
98
!/log/.keep
109
/tmp
1110

12-
# Ignore .env file containing sensitive information.
11+
# Coverage
12+
/coverage/
13+
14+
# Environment
1315
.env
16+
.env.*
1417

15-
# Ignore macOS metadata files.
18+
# macOS / Windows system files
1619
.DS_Store
20+
Thumbs.db
1721

18-
# Ignore system-specific files.
22+
# Ruby
1923
/.byebug_history
20-
/coverage/
21-
/yarn-error.log
22-
/public/system
23-
/public/uploads
24-
/node_modules/
2524

26-
# Ignore IDE specific directories.
25+
# IDE / editor
2726
.idea/
28-
29-
# Ignore Gemfile.lock, as it should be managed with Bundler.
30-
Gemfile.lock
31-
32-
# Ignore the Ruby gem installation directory.
33-
/vendor/bundle
34-
35-
# Ignore node_modules directory for Node.js dependencies.
36-
/node_modules/
37-
38-
# Ignore yarn lock file.
39-
yarn.lock
27+
.vscode/
28+
*.swp
29+
30+
# Node / Vite
31+
node_modules/
32+
web/dist/
33+
web/node_modules/
34+
web/coverage/
35+
yarn-error.log
36+
yarn.lock
37+
npm-debug.log*
38+
39+
# Public uploads
40+
/public/system
41+
/public/uploads

.rspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--require spec_helper
2+
--color
3+
--format documentation

.rubocop.yml

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,49 @@
1-
# rubocop.yml
1+
require:
2+
- rubocop-rspec
23

3-
# AllCops section defines global settings.
44
AllCops:
5-
# Exclude the spec directory from inspection
5+
TargetRubyVersion: 3.2
6+
NewCops: enable
7+
SuggestExtensions: false
68
Exclude:
7-
- 'spec/**/*'
9+
- 'vendor/**/*'
10+
- 'web/**/*'
11+
- 'bin/*'
12+
- 'node_modules/**/*'
813

9-
# Style/Documentation
1014
Style/Documentation:
1115
Enabled: false
1216

13-
# Style/SymbolProc
14-
Style/SymbolProc:
15-
Enabled: false
17+
Style/StringLiterals:
18+
EnforcedStyle: single_quotes
1619

17-
# Layout/EmptyLineAfterMagicComment
18-
Layout/EmptyLineAfterMagicComment:
19-
Enabled: false
20+
Style/StringLiteralsInInterpolation:
21+
EnforcedStyle: single_quotes
2022

21-
# Layout/EndOfLine
22-
Layout/EndOfLine:
23-
Enabled: false
23+
Style/FrozenStringLiteralComment:
24+
Enabled: true
2425

25-
# Layout/TrailingEmptyLines
26-
Layout/TrailingEmptyLines:
27-
Enabled: false
26+
Layout/LineLength:
27+
Max: 120
2828

29-
# Metrics/BlockLength
3029
Metrics/BlockLength:
3130
Exclude:
3231
- 'spec/**/*'
32+
- 'api/app.rb'
33+
- 'random_data_generator.gemspec'
34+
- 'Rakefile'
3335

34-
# Style/StringLiterals
35-
Style/StringLiterals:
36-
Enabled: false
36+
Metrics/MethodLength:
37+
Max: 25
38+
39+
Metrics/ClassLength:
40+
Max: 200
41+
42+
RSpec/ExampleLength:
43+
Max: 10
44+
45+
RSpec/MultipleExpectations:
46+
Max: 5
47+
48+
RSpec/NestedGroups:
49+
Max: 4

Gemfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,15 @@
22

33
source 'https://rubygems.org'
44

5-
gem 'rspec' # Для тестирования
6-
gem 'rubocop', require: false # Для линтинга кода
5+
gemspec
6+
7+
group :development, :test do
8+
gem 'rake', '~> 13.2'
9+
gem 'rspec', '~> 3.13'
10+
gem 'rubocop', '~> 1.65', require: false
11+
gem 'rubocop-rspec', '~> 3.0', require: false
12+
end
13+
14+
group :test do
15+
gem 'rack-test', '~> 2.1'
16+
end

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Valery Gorbanev <vgartg@gmail.com>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)