osbc 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (310) hide show
  1. checksums.yaml +7 -0
  2. data/.env +5 -0
  3. data/.rspec +1 -0
  4. data/.rubocop.yml +273 -0
  5. data/.ruby-version +1 -0
  6. data/CHANGELOG.md +5 -0
  7. data/CODE_OF_CONDUCT.md +84 -0
  8. data/Dockerfile +17 -0
  9. data/Gemfile +109 -0
  10. data/Gemfile.lock +343 -0
  11. data/LICENSE.md +21 -0
  12. data/LICENSE.txt +21 -0
  13. data/Procfile +3 -0
  14. data/Procfile.dev +2 -0
  15. data/README.md +185 -0
  16. data/Rakefile +6 -0
  17. data/app/assets/builds/.keep +0 -0
  18. data/app/assets/config/manifest.js +5 -0
  19. data/app/assets/images/.keep +0 -0
  20. data/app/assets/images/bg.png +0 -0
  21. data/app/assets/images/gimage.png +0 -0
  22. data/app/assets/images/image.png +0 -0
  23. data/app/assets/images/logo.png +0 -0
  24. data/app/assets/images/outerspc.jpg +0 -0
  25. data/app/assets/images/proxy.jpg +0 -0
  26. data/app/assets/images/space.jpg +0 -0
  27. data/app/assets/images/space_four.jpg +0 -0
  28. data/app/assets/images/space_t.jpg +0 -0
  29. data/app/assets/images/space_th.jpg +0 -0
  30. data/app/assets/images/space_two.jpg +0 -0
  31. data/app/assets/images/th.jpg +0 -0
  32. data/app/assets/stylesheets/application.css +344 -0
  33. data/app/assets/stylesheets/application.tailwind.css +13 -0
  34. data/app/assets/stylesheets/home.css +0 -0
  35. data/app/channels/application_cable/channel.rb +6 -0
  36. data/app/channels/application_cable/connection.rb +6 -0
  37. data/app/controllers/api/v1/block_confirmations_controller.rb +65 -0
  38. data/app/controllers/application_controller.rb +72 -0
  39. data/app/controllers/blocks_controller.rb +20 -0
  40. data/app/controllers/chains_controller.rb +72 -0
  41. data/app/controllers/concerns/.keep +0 -0
  42. data/app/controllers/contracts_controller.rb +25 -0
  43. data/app/controllers/pools_controller.rb +73 -0
  44. data/app/controllers/signatures_controller.rb +25 -0
  45. data/app/controllers/tickets_controller.rb +76 -0
  46. data/app/controllers/transactions_controller.rb +48 -0
  47. data/app/controllers/users/confirmations_controller.rb +30 -0
  48. data/app/controllers/users/omniauth_callbacks_controller.rb +30 -0
  49. data/app/controllers/users/passwords_controller.rb +34 -0
  50. data/app/controllers/users/registrations_controller.rb +61 -0
  51. data/app/controllers/users/sessions_controller.rb +27 -0
  52. data/app/controllers/users/unlocks_controller.rb +30 -0
  53. data/app/controllers/wallets_controller.rb +18 -0
  54. data/app/helpers/application_helper.rb +4 -0
  55. data/app/helpers/blocks_helper.rb +4 -0
  56. data/app/helpers/chains_helper.rb +4 -0
  57. data/app/helpers/contracts_helper.rb +4 -0
  58. data/app/helpers/pools_helper.rb +4 -0
  59. data/app/helpers/signatures_helper.rb +4 -0
  60. data/app/helpers/tickets_helper.rb +4 -0
  61. data/app/helpers/transactions_helper.rb +4 -0
  62. data/app/helpers/wallets_helper.rb +4 -0
  63. data/app/javascript/application.js +3 -0
  64. data/app/javascript/controllers/application.js +9 -0
  65. data/app/javascript/controllers/hello_controller.js +7 -0
  66. data/app/javascript/controllers/index.js +11 -0
  67. data/app/jobs/application_job.rb +9 -0
  68. data/app/mailers/application_mailer.rb +6 -0
  69. data/app/models/acceptable_number_sequence.rb +4 -0
  70. data/app/models/acceptable_symbol_sequence.rb +4 -0
  71. data/app/models/acceptable_word.rb +4 -0
  72. data/app/models/application_record.rb +5 -0
  73. data/app/models/block.rb +17 -0
  74. data/app/models/chain.rb +10 -0
  75. data/app/models/concerns/.keep +0 -0
  76. data/app/models/concerns/sequences_validator.rb +30 -0
  77. data/app/models/concerns/wallet_exists_validator.rb +13 -0
  78. data/app/models/contract.rb +7 -0
  79. data/app/models/pool.rb +5 -0
  80. data/app/models/signature.rb +12 -0
  81. data/app/models/ticket.rb +11 -0
  82. data/app/models/transaction.rb +25 -0
  83. data/app/models/user.rb +44 -0
  84. data/app/models/wallet.rb +33 -0
  85. data/app/services/application_service.rb +23 -0
  86. data/app/services/assign_contracts_service.rb +162 -0
  87. data/app/services/create_ticket_service.rb +87 -0
  88. data/app/services/create_wallet_service.rb +20 -0
  89. data/app/services/transaction_to_block_service.rb +62 -0
  90. data/app/views/application/_featured_board.html.erb +77 -0
  91. data/app/views/application/home.html.slim +1 -0
  92. data/app/views/application/mining_profile.html.slim +59 -0
  93. data/app/views/application/privacy_policy.html.erb +0 -0
  94. data/app/views/application/terms.html.erb +0 -0
  95. data/app/views/blocks/_block.html.slim +13 -0
  96. data/app/views/blocks/_block.json.jbuilder +4 -0
  97. data/app/views/blocks/_form.html.slim +26 -0
  98. data/app/views/blocks/edit.html.slim +10 -0
  99. data/app/views/blocks/index.html.slim +12 -0
  100. data/app/views/blocks/index.json.jbuilder +3 -0
  101. data/app/views/blocks/new.html.slim +8 -0
  102. data/app/views/blocks/show.html.slim +8 -0
  103. data/app/views/blocks/show.json.jbuilder +3 -0
  104. data/app/views/chains/_chain.html.slim +16 -0
  105. data/app/views/chains/_chain.json.jbuilder +4 -0
  106. data/app/views/chains/_form.html.slim +30 -0
  107. data/app/views/chains/edit.html.slim +10 -0
  108. data/app/views/chains/index.html.slim +11 -0
  109. data/app/views/chains/index.json.jbuilder +3 -0
  110. data/app/views/chains/new.html.slim +8 -0
  111. data/app/views/chains/show.html.slim +10 -0
  112. data/app/views/chains/show.json.jbuilder +3 -0
  113. data/app/views/contracts/_contract.html.slim +8 -0
  114. data/app/views/contracts/_contract.json.jbuilder +4 -0
  115. data/app/views/contracts/_form.html.slim +34 -0
  116. data/app/views/contracts/edit.html.slim +10 -0
  117. data/app/views/contracts/index.html.slim +12 -0
  118. data/app/views/contracts/index.json.jbuilder +3 -0
  119. data/app/views/contracts/new.html.slim +8 -0
  120. data/app/views/contracts/show.html.slim +8 -0
  121. data/app/views/contracts/show.json.jbuilder +3 -0
  122. data/app/views/layouts/_alert.html.slim +6 -0
  123. data/app/views/layouts/_navbar.html.slim +27 -0
  124. data/app/views/layouts/_notice.html.slim +6 -0
  125. data/app/views/layouts/application.html.erb +32 -0
  126. data/app/views/layouts/mailer.html.erb +13 -0
  127. data/app/views/layouts/mailer.text.erb +1 -0
  128. data/app/views/pools/_form.html.slim +30 -0
  129. data/app/views/pools/_pool.html.slim +16 -0
  130. data/app/views/pools/_pool.json.jbuilder +4 -0
  131. data/app/views/pools/edit.html.slim +10 -0
  132. data/app/views/pools/index.html.slim +12 -0
  133. data/app/views/pools/index.json.jbuilder +3 -0
  134. data/app/views/pools/new.html.slim +8 -0
  135. data/app/views/pools/show.html.slim +8 -0
  136. data/app/views/pools/show.json.jbuilder +3 -0
  137. data/app/views/signatures/_form.html.slim +46 -0
  138. data/app/views/signatures/_signature.html.slim +28 -0
  139. data/app/views/signatures/_signature.json.jbuilder +4 -0
  140. data/app/views/signatures/edit.html.slim +10 -0
  141. data/app/views/signatures/index.html.slim +10 -0
  142. data/app/views/signatures/index.json.jbuilder +3 -0
  143. data/app/views/signatures/new.html.slim +8 -0
  144. data/app/views/signatures/show.html.slim +10 -0
  145. data/app/views/signatures/show.json.jbuilder +3 -0
  146. data/app/views/tickets/_form.html.slim +26 -0
  147. data/app/views/tickets/_ticket.html.slim +10 -0
  148. data/app/views/tickets/_ticket.json.jbuilder +4 -0
  149. data/app/views/tickets/edit.html.slim +10 -0
  150. data/app/views/tickets/index.html.slim +16 -0
  151. data/app/views/tickets/index.json.jbuilder +3 -0
  152. data/app/views/tickets/new.html.slim +10 -0
  153. data/app/views/tickets/show.html.slim +8 -0
  154. data/app/views/tickets/show.json.jbuilder +3 -0
  155. data/app/views/transactions/_form.html.slim +16 -0
  156. data/app/views/transactions/_transaction.html.slim +24 -0
  157. data/app/views/transactions/_transaction.json.jbuilder +4 -0
  158. data/app/views/transactions/edit.html.slim +10 -0
  159. data/app/views/transactions/index.html.slim +19 -0
  160. data/app/views/transactions/index.json.jbuilder +3 -0
  161. data/app/views/transactions/new.html.slim +9 -0
  162. data/app/views/transactions/show.html.slim +8 -0
  163. data/app/views/transactions/show.json.jbuilder +3 -0
  164. data/app/views/users/confirmations/new.html.erb +16 -0
  165. data/app/views/users/mailer/confirmation_instructions.html.erb +5 -0
  166. data/app/views/users/mailer/email_changed.html.erb +7 -0
  167. data/app/views/users/mailer/password_change.html.erb +3 -0
  168. data/app/views/users/mailer/reset_password_instructions.html.erb +8 -0
  169. data/app/views/users/mailer/unlock_instructions.html.erb +7 -0
  170. data/app/views/users/passwords/edit.html.erb +25 -0
  171. data/app/views/users/passwords/new.html.erb +16 -0
  172. data/app/views/users/registrations/edit.html.erb +43 -0
  173. data/app/views/users/registrations/new.html.erb +37 -0
  174. data/app/views/users/sessions/new.html.erb +30 -0
  175. data/app/views/users/shared/_error_messages.html.erb +15 -0
  176. data/app/views/users/shared/_links.html.erb +25 -0
  177. data/app/views/users/unlocks/new.html.erb +16 -0
  178. data/app/views/wallets/_form.html.slim +30 -0
  179. data/app/views/wallets/_wallet.html.slim +13 -0
  180. data/app/views/wallets/_wallet.json.jbuilder +4 -0
  181. data/app/views/wallets/edit.html.slim +10 -0
  182. data/app/views/wallets/index.html.slim +18 -0
  183. data/app/views/wallets/index.json.jbuilder +3 -0
  184. data/app/views/wallets/new.html.slim +8 -0
  185. data/app/views/wallets/show.html.slim +11 -0
  186. data/app/views/wallets/show.json.jbuilder +3 -0
  187. data/app/workers/application_worker.rb +82 -0
  188. data/app/workers/assign_contract_worker.rb +27 -0
  189. data/app/workers/create_ticket_worker.rb +23 -0
  190. data/app/workers/create_wallet_worker.rb +21 -0
  191. data/app/workers/transaction_to_block_worker.rb +48 -0
  192. data/bin/bundle +114 -0
  193. data/bin/console +15 -0
  194. data/bin/dev +9 -0
  195. data/bin/importmap +5 -0
  196. data/bin/osbc +77 -0
  197. data/bin/rails +6 -0
  198. data/bin/rake +6 -0
  199. data/bin/setup +35 -0
  200. data/config/application.rb +25 -0
  201. data/config/boot.rb +6 -0
  202. data/config/cable.yml +10 -0
  203. data/config/credentials.yml.enc +1 -0
  204. data/config/database.yml +21 -0
  205. data/config/environment.rb +7 -0
  206. data/config/environments/development.rb +73 -0
  207. data/config/environments/production.rb +95 -0
  208. data/config/environments/test.rb +62 -0
  209. data/config/importmap.rb +9 -0
  210. data/config/initializers/assets.rb +14 -0
  211. data/config/initializers/content_security_policy.rb +26 -0
  212. data/config/initializers/devise.rb +311 -0
  213. data/config/initializers/filter_parameter_logging.rb +10 -0
  214. data/config/initializers/inflections.rb +17 -0
  215. data/config/initializers/permissions_policy.rb +12 -0
  216. data/config/locales/devise.en.yml +65 -0
  217. data/config/locales/en.yml +33 -0
  218. data/config/puma.rb +45 -0
  219. data/config/routes/api.rb +9 -0
  220. data/config/routes.rb +30 -0
  221. data/config/sidekiq.yml +10 -0
  222. data/config/storage.yml +34 -0
  223. data/config/tailwind.config.js +23 -0
  224. data/config.ru +8 -0
  225. data/coverage/.last_run.json +5 -0
  226. data/coverage/.resultset.json +1853 -0
  227. data/coverage/.resultset.json.lock +0 -0
  228. data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc.png +0 -0
  229. data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
  230. data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_both.png +0 -0
  231. data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc.png +0 -0
  232. data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
  233. data/coverage/assets/0.12.3/application.css +1 -0
  234. data/coverage/assets/0.12.3/application.js +7 -0
  235. data/coverage/assets/0.12.3/colorbox/border.png +0 -0
  236. data/coverage/assets/0.12.3/colorbox/controls.png +0 -0
  237. data/coverage/assets/0.12.3/colorbox/loading.gif +0 -0
  238. data/coverage/assets/0.12.3/colorbox/loading_background.png +0 -0
  239. data/coverage/assets/0.12.3/favicon_green.png +0 -0
  240. data/coverage/assets/0.12.3/favicon_red.png +0 -0
  241. data/coverage/assets/0.12.3/favicon_yellow.png +0 -0
  242. data/coverage/assets/0.12.3/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  243. data/coverage/assets/0.12.3/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  244. data/coverage/assets/0.12.3/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  245. data/coverage/assets/0.12.3/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  246. data/coverage/assets/0.12.3/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  247. data/coverage/assets/0.12.3/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  248. data/coverage/assets/0.12.3/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  249. data/coverage/assets/0.12.3/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  250. data/coverage/assets/0.12.3/images/ui-icons_222222_256x240.png +0 -0
  251. data/coverage/assets/0.12.3/images/ui-icons_2e83ff_256x240.png +0 -0
  252. data/coverage/assets/0.12.3/images/ui-icons_454545_256x240.png +0 -0
  253. data/coverage/assets/0.12.3/images/ui-icons_888888_256x240.png +0 -0
  254. data/coverage/assets/0.12.3/images/ui-icons_cd0a0a_256x240.png +0 -0
  255. data/coverage/assets/0.12.3/loading.gif +0 -0
  256. data/coverage/assets/0.12.3/magnify.png +0 -0
  257. data/coverage/index.html +20731 -0
  258. data/db/migrate/20221018053949_devise_create_users.rb +45 -0
  259. data/db/migrate/20221019002956_create_chains.rb +13 -0
  260. data/db/migrate/20221020112137_create_blocks.rb +12 -0
  261. data/db/migrate/20221020123102_add_chain_to_blocks.rb +5 -0
  262. data/db/migrate/20221020150504_create_wallets.rb +13 -0
  263. data/db/migrate/20221022221059_create_transactions.rb +20 -0
  264. data/db/migrate/20221023011005_add_block_to_transactions.rb +5 -0
  265. data/db/migrate/20221023014707_create_contracts.rb +11 -0
  266. data/db/migrate/20221023040749_create_pools.rb +13 -0
  267. data/db/migrate/20221023041015_create_tickets.rb +11 -0
  268. data/db/migrate/20221023103509_add_contracts_count_to_block.rb +6 -0
  269. data/db/migrate/20221023110613_add_acceptable_word_list_to_users.rb +7 -0
  270. data/db/migrate/20221023113539_create_signatures.rb +19 -0
  271. data/db/migrate/20221023113750_create_acceptable_words.rb +9 -0
  272. data/db/migrate/20221023114152_create_acceptable_number_sequences.rb +9 -0
  273. data/db/migrate/20221023114203_create_acceptable_symbol_sequences.rb +9 -0
  274. data/db/migrate/20221023114324_add_user_acceptable_hash_to_tickets.rb +7 -0
  275. data/db/migrate/20221023114408_add_time_ref_to_tickets.rb +5 -0
  276. data/db/migrate/20221024125047_add_master_hash_to_blocks.rb +5 -0
  277. data/db/migrate/20221109161845_add_transactions_count_to_blocks.rb +5 -0
  278. data/db/migrate/20221117135003_add_balance_to_chains.rb +5 -0
  279. data/db/migrate/20221117203417_add_transaction_id_list_to_tickets.rb +5 -0
  280. data/db/migrate/20221118080357_add_api_keys_to_users.rb +6 -0
  281. data/db/schema.rb +179 -0
  282. data/db/seeds.rb +134 -0
  283. data/docker-compose.yml +53 -0
  284. data/entrypoint.sh +8 -0
  285. data/lib/assets/.keep +0 -0
  286. data/lib/osbc/osbc.rb +9 -0
  287. data/lib/outerspace/blockchain/version.rb +7 -0
  288. data/lib/outerspace/blockchain.rb +10 -0
  289. data/lib/tasks/.keep +0 -0
  290. data/lib/tasks/compose.rake +92 -0
  291. data/lib/tasks/compose_db.rake +71 -0
  292. data/lib/tasks/compose_logs.rake +95 -0
  293. data/lib/tasks/compose_test.rake +62 -0
  294. data/log/.keep +0 -0
  295. data/mining_concept.ipynb +284 -0
  296. data/outerspace-blockchain.gemspec +50 -0
  297. data/public/404.html +67 -0
  298. data/public/422.html +67 -0
  299. data/public/500.html +66 -0
  300. data/public/apple-touch-icon-precomposed.png +0 -0
  301. data/public/apple-touch-icon.png +0 -0
  302. data/public/favicon.ico +0 -0
  303. data/public/robots.txt +1 -0
  304. data/storage/.keep +0 -0
  305. data/tmp/.keep +0 -0
  306. data/tmp/pids/.keep +0 -0
  307. data/tmp/storage/.keep +0 -0
  308. data/vendor/.keep +0 -0
  309. data/vendor/javascript/.keep +0 -0
  310. metadata +643 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: '0959a1f1814a23d86916f914b28842a0f009ddd8e22bdd8fecf14d2d0d29f659'
4
+ data.tar.gz: a8473f6072c95c8af77a9d402ab6988ace065ce177e688a35828275910c9d1b5
5
+ SHA512:
6
+ metadata.gz: 6a76df0d7eeb1f18f9ec34eee953a5fb1df36dab4375d514cd59a67e8ba3960486eb28dd9bf86ebba7755f666caa61b76d163f7a08fdfa33ba4b2fbb762b9d30
7
+ data.tar.gz: f778bf73d3de0a3d51f7f69e7e11796b5305756552681f4e82d39487ec932a13b87fe293842f75d1f160db8d64c77847259f5e1d6c9bc9faf13d2daa461b6210
data/.env ADDED
@@ -0,0 +1,5 @@
1
+ FIRST_CHAIN_NAME=YOUR_CHAIN_NAME
2
+ FIRST_CHAIN_MAINTAINER=YOUR_NAME
3
+ CONTRACTS_LIMIT=2
4
+ SIGNATURES_LIMIT=5
5
+ REDIS_URL=redis://redis:6379
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,273 @@
1
+ require:
2
+ - rubocop-rspec
3
+ - rubocop-rails
4
+
5
+ AllCops:
6
+ TargetRubyVersion: 3.0
7
+ # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
8
+ # to ignore them, so only the ones explicitly set in this file are enabled.
9
+ DisabledByDefault: true
10
+ SuggestExtensions: false
11
+ Exclude:
12
+ - 'Rakefile'
13
+ - 'spec/factories/**/*'
14
+ - 'spec/rails_helper.rb'
15
+ - 'spec/spec_helper.rb'
16
+ - 'spec/support/**/*.rb'
17
+ - 'Gemfile'
18
+ - 'db/migrate/**/*'
19
+ - 'db/schema.rb'
20
+ - '**/tmp/**/*'
21
+ - '**/templates/**/*'
22
+ - '**/vendor/**/*'
23
+ - 'actionpack/lib/action_dispatch/journey/parser.rb'
24
+ - 'actionmailbox/test/dummy/**/*'
25
+ - 'actiontext/test/dummy/**/*'
26
+ - '**/node_modules/**/*'
27
+
28
+ # Prefer assert_not over assert !
29
+ Rails/AssertNot:
30
+ Include:
31
+ - '**/test/**/*'
32
+
33
+ # Prefer assert_not_x over refute_x
34
+ Rails/RefuteMethods:
35
+ Include:
36
+ - '**/test/**/*'
37
+
38
+ Rails/IndexBy:
39
+ Enabled: true
40
+
41
+ Rails/IndexWith:
42
+ Enabled: true
43
+
44
+ # Prefer &&/|| over and/or.
45
+ Style/AndOr:
46
+ Enabled: true
47
+
48
+ # Align `when` with `case`.
49
+ Layout/CaseIndentation:
50
+ Enabled: true
51
+
52
+ Layout/ClosingHeredocIndentation:
53
+ Enabled: true
54
+
55
+ Layout/ClosingParenthesisIndentation:
56
+ Enabled: true
57
+
58
+ # Align comments with method definitions.
59
+ Layout/CommentIndentation:
60
+ Enabled: true
61
+
62
+ Layout/ElseAlignment:
63
+ Enabled: true
64
+
65
+ # Align `end` with the matching keyword or starting expression except for
66
+ # assignments, where it should be aligned with the LHS.
67
+ Layout/EndAlignment:
68
+ Enabled: true
69
+ EnforcedStyleAlignWith: variable
70
+ AutoCorrect: true
71
+
72
+ Layout/EndOfLine:
73
+ Enabled: true
74
+
75
+ Layout/EmptyLineAfterMagicComment:
76
+ Enabled: true
77
+
78
+ Layout/EmptyLinesAroundAccessModifier:
79
+ Enabled: true
80
+ EnforcedStyle: only_before
81
+
82
+ Layout/EmptyLinesAroundBlockBody:
83
+ Enabled: true
84
+
85
+ # In a regular class definition, no empty lines around the body.
86
+ Layout/EmptyLinesAroundClassBody:
87
+ Enabled: true
88
+
89
+ # In a regular method definition, no empty lines around the body.
90
+ Layout/EmptyLinesAroundMethodBody:
91
+ Enabled: true
92
+
93
+ # In a regular module definition, no empty lines around the body.
94
+ Layout/EmptyLinesAroundModuleBody:
95
+ Enabled: true
96
+
97
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
98
+ Style/HashSyntax:
99
+ Enabled: true
100
+
101
+ # Method definitions after `private` or `protected` isolated calls need one
102
+ # extra level of indentation.
103
+ Layout/IndentationConsistency:
104
+ Enabled: true
105
+ EnforcedStyle: indented_internal_methods
106
+
107
+ # Two spaces, no tabs (for indentation).
108
+ Layout/IndentationWidth:
109
+ Enabled: true
110
+
111
+ Layout/LeadingCommentSpace:
112
+ Enabled: true
113
+
114
+ Layout/SpaceAfterColon:
115
+ Enabled: true
116
+
117
+ Layout/SpaceAfterComma:
118
+ Enabled: true
119
+
120
+ Layout/SpaceAfterSemicolon:
121
+ Enabled: true
122
+
123
+ Layout/SpaceAroundEqualsInParameterDefault:
124
+ Enabled: true
125
+
126
+ Layout/SpaceAroundKeyword:
127
+ Enabled: true
128
+
129
+ Layout/SpaceAroundOperators:
130
+ Enabled: true
131
+
132
+ Layout/SpaceBeforeComma:
133
+ Enabled: true
134
+
135
+ Layout/SpaceBeforeComment:
136
+ Enabled: true
137
+
138
+ Layout/SpaceBeforeFirstArg:
139
+ Enabled: true
140
+
141
+ Style/DefWithParentheses:
142
+ Enabled: true
143
+
144
+ # Defining a method with parameters needs parentheses.
145
+ Style/MethodDefParentheses:
146
+ Enabled: true
147
+
148
+ Style/ExplicitBlockArgument:
149
+ Enabled: true
150
+
151
+ Style/FrozenStringLiteralComment:
152
+ Enabled: true
153
+ EnforcedStyle: always
154
+ Exclude:
155
+ - 'actionview/test/**/*.builder'
156
+ - 'actionview/test/**/*.ruby'
157
+ - 'actionpack/test/**/*.builder'
158
+ - 'actionpack/test/**/*.ruby'
159
+ - 'activestorage/db/migrate/**/*.rb'
160
+ - 'activestorage/db/update_migrate/**/*.rb'
161
+ - 'actionmailbox/db/migrate/**/*.rb'
162
+ - 'actiontext/db/migrate/**/*.rb'
163
+
164
+ Style/MapToHash:
165
+ Enabled: true
166
+
167
+ Style/RedundantFreeze:
168
+ Enabled: true
169
+
170
+ # Use `foo {}` not `foo{}`.
171
+ Layout/SpaceBeforeBlockBraces:
172
+ Enabled: true
173
+
174
+ # Use `foo { bar }` not `foo {bar}`.
175
+ Layout/SpaceInsideBlockBraces:
176
+ Enabled: true
177
+ EnforcedStyleForEmptyBraces: space
178
+
179
+ # Use `{ a: 1 }` not `{a:1}`.
180
+ Layout/SpaceInsideHashLiteralBraces:
181
+ Enabled: true
182
+
183
+ Layout/SpaceInsideParens:
184
+ Enabled: true
185
+
186
+ # Check quotes usage according to lint rule below.
187
+ Style/StringLiterals:
188
+ Enabled: true
189
+ EnforcedStyle: double_quotes
190
+
191
+ # Detect hard tabs, no hard tabs.
192
+ Layout/IndentationStyle:
193
+ Enabled: true
194
+
195
+ # Empty lines should not have any spaces.
196
+ Layout/TrailingEmptyLines:
197
+ Enabled: true
198
+
199
+ # No trailing whitespace.
200
+ Layout/TrailingWhitespace:
201
+ Enabled: true
202
+
203
+ # Use quotes for string literals when they are enough.
204
+ Style/RedundantPercentQ:
205
+ Enabled: true
206
+
207
+ Lint/AmbiguousOperator:
208
+ Enabled: true
209
+
210
+ Lint/AmbiguousRegexpLiteral:
211
+ Enabled: true
212
+
213
+ Lint/DuplicateRequire:
214
+ Enabled: true
215
+
216
+ Lint/DuplicateMethods:
217
+ Enabled: true
218
+
219
+ Lint/ErbNewArguments:
220
+ Enabled: true
221
+
222
+ Lint/EnsureReturn:
223
+ Enabled: true
224
+
225
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
226
+ Lint/RequireParentheses:
227
+ Enabled: true
228
+
229
+ Lint/RedundantStringCoercion:
230
+ Enabled: true
231
+
232
+ Lint/UriEscapeUnescape:
233
+ Enabled: true
234
+
235
+ Lint/UselessAssignment:
236
+ Enabled: true
237
+
238
+ Lint/DeprecatedClassMethods:
239
+ Enabled: true
240
+
241
+ Style/ParenthesesAroundCondition:
242
+ Enabled: true
243
+
244
+ Style/HashTransformKeys:
245
+ Enabled: true
246
+
247
+ Style/HashTransformValues:
248
+ Enabled: true
249
+
250
+ Style/RedundantBegin:
251
+ Enabled: true
252
+
253
+ Style/RedundantReturn:
254
+ Enabled: true
255
+ AllowMultipleReturnValues: true
256
+
257
+ Style/RedundantRegexpEscape:
258
+ Enabled: true
259
+
260
+ Style/Semicolon:
261
+ Enabled: true
262
+ AllowAsExpressionSeparator: true
263
+
264
+ # Prefer Foo.method over Foo::method
265
+ Style/ColonMethodCall:
266
+ Enabled: true
267
+
268
+ Style/TrivialAccessors:
269
+ Enabled: true
270
+
271
+ # Prefer a = b || c over a = b ? b : c
272
+ Style/RedundantCondition:
273
+ Enabled: true
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-3.0.3
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-10-18
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Dockerfile ADDED
@@ -0,0 +1,17 @@
1
+ # syntax=docker/dockerfile:1
2
+ FROM ruby:3.0.3
3
+ RUN apt-get update -qq && apt-get install -y nodejs postgresql-client
4
+ WORKDIR /myapp
5
+ COPY Gemfile /myapp/Gemfile
6
+ COPY Gemfile.lock /myapp/Gemfile.lock
7
+ RUN bundle install
8
+ RUN gem install foreman
9
+
10
+ # Add a script to be executed every time the container starts.
11
+ COPY entrypoint.sh /usr/bin/
12
+ RUN chmod +x /usr/bin/entrypoint.sh
13
+ ENTRYPOINT ["entrypoint.sh"]
14
+ EXPOSE 80
15
+
16
+ # Configure the main process to run when running the image
17
+ CMD ["rails", "server", "-b", "0.0.0.0"]
data/Gemfile ADDED
@@ -0,0 +1,109 @@
1
+ source "https://rubygems.org"
2
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
+
4
+ ruby "3.0.3"
5
+
6
+ # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
7
+ gem "rails", "~> 7.0"
8
+
9
+ # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
10
+ gem "sprockets-rails", "~> 3.4"
11
+
12
+ # Use postgresql as the database for Active Record
13
+ gem "pg", "~> 1.4"
14
+
15
+ # Use the Puma web server [https://github.com/puma/puma]
16
+ gem "puma", "~> 5.6"
17
+
18
+ # Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
19
+ gem "importmap-rails", "~> 1.1"
20
+
21
+ # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
22
+ gem "turbo-rails", "~> 1.3"
23
+
24
+ # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
25
+ gem "stimulus-rails", "~> 1.1"
26
+
27
+ # Use Tailwind CSS [https://github.com/rails/tailwindcss-rails]
28
+ gem "tailwindcss-rails", "~> 2.0"
29
+
30
+ # Build JSON APIs with ease [https://github.com/rails/jbuilder]
31
+ gem "jbuilder", "~> 2.11"
32
+
33
+ # Use Redis adapter to run Action Cable in production
34
+ # gem "redis", "~> 4.0"
35
+
36
+ # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
37
+ # gem "kredis"
38
+
39
+ # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
40
+ # gem "bcrypt", "~> 3.1.7"
41
+
42
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
43
+ gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
44
+
45
+ # Reduces boot times through caching; required in config/boot.rb
46
+ gem "bootsnap", "~> 1.13", require: false
47
+
48
+ # Rubocop Rails
49
+ gem "rubocop-rails", "~> 2.16", require: false
50
+
51
+ # Rubocop Rspec
52
+ gem "rubocop-rspec", "~> 2.13", require: false
53
+
54
+ # sidekiq
55
+ gem "sidekiq", "~> 6.5"
56
+
57
+ # Slim template
58
+ gem "slim-rails", "~> 3.5"
59
+
60
+ # Devise
61
+ gem "devise", "~> 4.8"
62
+
63
+ # Rails Controller Testing
64
+ gem "rails-controller-testing", "~> 1.0"
65
+
66
+ # Active Record Import
67
+ gem "activerecord-import"
68
+
69
+
70
+ # Use Sass to process CSS
71
+ # gem "sassc-rails"
72
+
73
+ # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
74
+ # gem "image_processing", "~> 1.2"
75
+
76
+ group :development, :test do
77
+ # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
78
+ gem "debug", "~> 1.6", platforms: %i[ mri mingw x64_mingw ]
79
+ # Rspec for testing
80
+ gem "rspec-rails", "~> 6.0"
81
+ # FactoryBot for testing
82
+ gem "factory_bot_rails", "~> 6.2"
83
+ # Faker for testing
84
+ gem "faker", "~> 2.23"
85
+ # SimpleCov for testing
86
+ gem "simplecov", "~> 0.21"
87
+ # Shoulda Matchers for testing
88
+ gem "shoulda-matchers", "~> 5.0"
89
+ # Database Cleaner for testing
90
+ gem "database_cleaner-active_record", "~> 2.0"
91
+ end
92
+
93
+ group :development do
94
+ # Use console on exceptions pages [https://github.com/rails/web-console]
95
+ gem "web-console", "~> 4.2"
96
+
97
+ # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
98
+ # gem "rack-mini-profiler"
99
+
100
+ # Speed up commands on slow machines / big apps [https://github.com/rails/spring]
101
+ # gem "spring"
102
+ end
103
+
104
+ group :test do
105
+ # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
106
+ gem "capybara", "~> 3.37"
107
+ gem "selenium-webdriver", "~> 4.5"
108
+ gem "webdrivers", "~> 5.2"
109
+ end