Skip to content

Commit ad8df12

Browse files
authored
Feature/clock example (#20)
* Add basic clock layout * Add clock shader * Add frontend for clocks (without spinify subscription) * Update clock layout * Clock example * Add readme for clock example
1 parent d9d1ca1 commit ad8df12

25 files changed

+1673
-12
lines changed

.vscode/tasks.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@
237237
"--name=centrifugo",
238238
"centrifugo/centrifugo:latest",
239239
"centrifugo",
240-
"--client_insecure",
240+
"--client.insecure",
241241
"--admin",
242242
"--admin_insecure",
243243
"--log_level=debug"
@@ -255,7 +255,7 @@
255255
"--name=centrifugo",
256256
"centrifugo/centrifugo:latest",
257257
"centrifugo",
258-
//"--client_insecure",
258+
//"--client.insecure",
259259
"--admin",
260260
"--admin_insecure",
261261
"--log_level=debug"
@@ -273,7 +273,7 @@
273273
"--name=centrifugo",
274274
"centrifugo/centrifugo:latest",
275275
"centrifugo",
276-
"--client_insecure",
276+
"--client.insecure",
277277
"--admin",
278278
"--admin_insecure",
279279
"--log_level=debug"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Windows 11 Pro 64-bit
108108
CPU 13th Gen Intel Core i7-13700K
109109
Chrome Version 131.0.6778.86 (Official Build) (64-bit)
110110
Docker version 27.1.1
111-
Docker image centrifugo/centrifugo:v5
111+
Docker image centrifugo/centrifugo:latest
112112
Flutter 3.24.5 • Dart 3.5.4
113113
Package spinify v0.1.0
114114
Package centrifuge-dart v0.14.1

example/benchmark/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ Logs: `docker-compose logs -f`
5252
services:
5353
centrifugo-benchmark:
5454
container_name: centrifugo-benchmark
55-
image: centrifugo/centrifugo:v5
55+
image: centrifugo/centrifugo:latest
5656
restart: unless-stopped
57-
command: centrifugo --client_insecure --admin
57+
command: centrifugo --client.insecure --admin
5858
tty: true
5959
ports:
6060
- 8000:8000

example/benchmark/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
services:
77
centrifugo-benchmark:
88
container_name: centrifugo-benchmark
9-
image: centrifugo/centrifugo:v5
9+
image: centrifugo/centrifugo:latest
1010
restart: unless-stopped
11-
command: centrifugo --client_insecure --admin
11+
command: centrifugo --client.insecure --admin
1212
tty: true
1313
ports:
1414
- 8000:8000

example/benchmark/lib/src/help_tab.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ const String _helpComposeContent = '''
157157
services:
158158
centrifugo-benchmark:
159159
container_name: centrifugo-benchmark
160-
image: centrifugo/centrifugo:v5
160+
image: centrifugo/centrifugo:latest
161161
restart: unless-stopped
162-
command: centrifugo --client_insecure --admin
162+
command: centrifugo --client.insecure --admin
163163
tty: true
164164
ports:
165165
- 8000:8000

example/clock/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Clock example
2+
3+
## How to run
4+
5+
```bash
6+
docker compose up --build
7+
```
8+
9+
and open [http://localhost:3081](http://localhost:3081) in your browser.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.dart_tool/

example/clock/backend/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Dockerfile для сервера на Dart
2+
FROM dart:stable AS backend_build
3+
4+
# Установим рабочую директорию
5+
WORKDIR /app
6+
7+
# Копируем pubspec и pubspec.lock для установки зависимостей
8+
COPY pubspec.* ./
9+
10+
# Устанавливаем зависимости
11+
RUN dart pub get
12+
13+
# Копируем остальной код приложения
14+
COPY . .
15+
16+
# Компилируем серверное приложение
17+
RUN dart compile exe bin/main.dart -o /server
18+
19+
# Финальный образ
20+
FROM debian:bullseye-slim
21+
22+
# Устанавливаем необходимые зависимости
23+
RUN apt-get update && apt-get install -y \
24+
ca-certificates && \
25+
rm -rf /var/lib/apt/lists/*
26+
27+
# Копируем скомпилированный сервер
28+
COPY --from=backend_build /server /usr/local/bin/server
29+
30+
# Порт для сервера
31+
EXPOSE 8080
32+
33+
# Команда запуска сервера
34+
CMD ["/usr/local/bin/server"]
Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
include: package:lints/recommended.yaml
2+
3+
analyzer:
4+
exclude:
5+
# Build
6+
- "build/**"
7+
# Tests
8+
- "test/**.mocks.dart"
9+
- ".test_coverage.dart"
10+
- "coverage/**"
11+
# Assets
12+
- "assets/**"
13+
# Generated
14+
- "lib/src/common/localization/generated/**"
15+
- "lib/src/common/constants/pubspec.yaml.g.dart"
16+
- "lib/src/common/model/generated/**"
17+
- "**.g.dart"
18+
- "**.gql.dart"
19+
- "**.freezed.dart"
20+
- "**.config.dart"
21+
- "**.mocks.dart"
22+
- "**.gen.dart"
23+
- "**.pb.dart"
24+
- "**.pbenum.dart"
25+
- "**.pbjson.dart"
26+
# Flutter Version Manager
27+
- ".fvm/**"
28+
# Tools
29+
#- "tool/**"
30+
- "scripts/**"
31+
- ".dart_tool/**"
32+
# Platform
33+
- "ios/**"
34+
- "android/**"
35+
- "web/**"
36+
- "macos/**"
37+
- "windows/**"
38+
- "linux/**"
39+
40+
# Enable the following options to enable strong mode.
41+
language:
42+
strict-casts: true
43+
strict-raw-types: true
44+
strict-inference: true
45+
46+
errors:
47+
# Allow having TODOs in the code
48+
todo: ignore
49+
50+
# Info
51+
directives_ordering: info
52+
always_declare_return_types: info
53+
54+
# Warning
55+
unsafe_html: warning
56+
missing_return: warning
57+
missing_required_param: warning
58+
no_logic_in_create_state: warning
59+
empty_catches: warning
60+
61+
# Error
62+
always_use_package_imports: error
63+
avoid_relative_lib_imports: error
64+
avoid_slow_async_io: error
65+
avoid_types_as_parameter_names: error
66+
valid_regexps: error
67+
always_require_non_null_named_parameters: error
68+
69+
linter:
70+
rules:
71+
# Public packages
72+
#public_member_api_docs: true
73+
#lines_longer_than_80_chars: true
74+
75+
# Enabling rules
76+
always_use_package_imports: true
77+
avoid_relative_lib_imports: true
78+
79+
# Disable rules
80+
sort_pub_dependencies: false
81+
prefer_relative_imports: false
82+
prefer_final_locals: false
83+
avoid_escaping_inner_quotes: false
84+
curly_braces_in_flow_control_structures: false
85+
one_member_abstracts: false
86+
87+
# Enabled
88+
use_named_constants: true
89+
unnecessary_constructor_name: true
90+
sort_constructors_first: true
91+
exhaustive_cases: true
92+
sort_unnamed_constructors_first: true
93+
type_literal_in_constant_pattern: true
94+
always_put_required_named_parameters_first: true
95+
avoid_annotating_with_dynamic: true
96+
avoid_bool_literals_in_conditional_expressions: true
97+
avoid_double_and_int_checks: true
98+
avoid_field_initializers_in_const_classes: true
99+
avoid_implementing_value_types: true
100+
avoid_js_rounded_ints: true
101+
avoid_print: true
102+
avoid_renaming_method_parameters: true
103+
avoid_returning_null_for_void: true
104+
avoid_single_cascade_in_expression_statements: true
105+
avoid_slow_async_io: true
106+
avoid_unnecessary_containers: true
107+
avoid_unused_constructor_parameters: true
108+
avoid_void_async: true
109+
await_only_futures: true
110+
cancel_subscriptions: true
111+
cascade_invocations: true
112+
close_sinks: true
113+
control_flow_in_finally: true
114+
empty_statements: true
115+
collection_methods_unrelated_type: true
116+
join_return_with_assignment: true
117+
leading_newlines_in_multiline_strings: true
118+
literal_only_boolean_expressions: true
119+
missing_whitespace_between_adjacent_strings: true
120+
no_adjacent_strings_in_list: true
121+
no_logic_in_create_state: true
122+
no_runtimeType_toString: true
123+
only_throw_errors: true
124+
overridden_fields: true
125+
package_names: true
126+
package_prefixed_library_names: true
127+
parameter_assignments: true
128+
prefer_asserts_in_initializer_lists: true
129+
prefer_asserts_with_message: true
130+
prefer_const_constructors: true
131+
prefer_const_constructors_in_immutables: true
132+
prefer_const_declarations: true
133+
prefer_const_literals_to_create_immutables: true
134+
prefer_constructors_over_static_methods: true
135+
prefer_expression_function_bodies: true
136+
prefer_final_in_for_each: true
137+
prefer_foreach: true
138+
prefer_if_elements_to_conditional_expressions: true
139+
prefer_inlined_adds: true
140+
prefer_int_literals: true
141+
prefer_is_not_operator: true
142+
prefer_null_aware_operators: true
143+
prefer_typing_uninitialized_variables: true
144+
prefer_void_to_null: true
145+
provide_deprecation_message: true
146+
sized_box_for_whitespace: true
147+
sort_child_properties_last: true
148+
test_types_in_equals: true
149+
throw_in_finally: true
150+
unnecessary_null_aware_assignments: true
151+
unnecessary_overrides: true
152+
unnecessary_parenthesis: true
153+
unnecessary_raw_strings: true
154+
unnecessary_statements: true
155+
unnecessary_string_escapes: true
156+
unnecessary_string_interpolations: true
157+
unsafe_html: true
158+
use_raw_strings: true
159+
use_string_buffers: true
160+
valid_regexps: true
161+
void_checks: true
162+
163+
# Pedantic 1.9.0
164+
always_declare_return_types: true
165+
annotate_overrides: true
166+
avoid_empty_else: true
167+
avoid_init_to_null: true
168+
avoid_null_checks_in_equality_operators: true
169+
avoid_return_types_on_setters: true
170+
avoid_shadowing_type_parameters: true
171+
avoid_types_as_parameter_names: true
172+
camel_case_extensions: true
173+
empty_catches: true
174+
empty_constructor_bodies: true
175+
library_names: true
176+
library_prefixes: true
177+
no_duplicate_case_values: true
178+
null_closures: true
179+
omit_local_variable_types: true
180+
prefer_adjacent_string_concatenation: true
181+
prefer_collection_literals: true
182+
prefer_conditional_assignment: true
183+
prefer_contains: true
184+
prefer_final_fields: true
185+
prefer_for_elements_to_map_fromIterable: true
186+
prefer_generic_function_type_aliases: true
187+
prefer_if_null_operators: true
188+
prefer_is_empty: true
189+
prefer_is_not_empty: true
190+
prefer_iterable_whereType: true
191+
prefer_single_quotes: true
192+
prefer_spread_collections: true
193+
recursive_getters: true
194+
slash_for_doc_comments: true
195+
type_init_formals: true
196+
unawaited_futures: true
197+
unnecessary_const: true
198+
unnecessary_new: true
199+
unnecessary_null_in_if_null_operators: true
200+
unnecessary_this: true
201+
unrelated_type_equality_checks: true
202+
use_function_type_syntax_for_parameters: true
203+
use_rethrow_when_possible: true
204+
205+
# Effective_dart 1.2.0
206+
camel_case_types: true
207+
file_names: true
208+
non_constant_identifier_names: true
209+
constant_identifier_names: true
210+
directives_ordering: true
211+
package_api_docs: true
212+
implementation_imports: true
213+
prefer_interpolation_to_compose_strings: true
214+
unnecessary_brace_in_string_interps: true
215+
avoid_function_literals_in_foreach_calls: true
216+
prefer_function_declarations_over_variables: true
217+
unnecessary_lambdas: true
218+
unnecessary_getters_setters: true
219+
prefer_initializing_formals: true
220+
avoid_catches_without_on_clauses: true
221+
avoid_catching_errors: true
222+
use_to_and_as_if_applicable: true
223+
avoid_classes_with_only_static_members: true
224+
prefer_mixin: true
225+
use_setters_to_change_properties: true
226+
avoid_setters_without_getters: true
227+
avoid_returning_this: true
228+
type_annotate_public_apis: true
229+
avoid_types_on_closure_parameters: true
230+
avoid_private_typedef_functions: true
231+
avoid_positional_boolean_parameters: true
232+
hash_and_equals: true
233+
avoid_equals_and_hash_code_on_mutable_classes: true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import 'package:spinify_clock_backend/server.dart';
2+
3+
void main() => runServer();

0 commit comments

Comments
 (0)