Skip to content

Commit da28046

Browse files
committed
Initial commit
0 parents  commit da28046

258 files changed

Lines changed: 12580 additions & 0 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.git
2+
log
3+
tmp
4+
storage
5+
node_modules
6+
vendor/bundle
7+
spec/tmp
8+
coverage
9+
*.log
10+
.DS_Store
11+
db/*.sqlite3
12+
db/*.sqlite3-*
13+
public/assets
14+
public/packs
15+
public/packs-test
16+
npm-debug.log*
17+
yarn-debug.log*
18+
yarn-error.log*
19+
tmp/pids
20+
tmp/cache
21+
tmp/sockets
22+
tmp/storage
23+
*.swp
24+
*.swo

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# See https://git-scm.com/docs/gitattributes for more about git attribute files.
2+
3+
# Mark the database schema as having been generated.
4+
db/schema.rb linguist-generated
5+
6+
# Mark any vendored files as having been vendored.
7+
vendor/* linguist-vendored
8+
config/credentials/*.yml.enc diff=rails_credentials
9+
config/credentials.yml.enc diff=rails_credentials

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
services:
14+
postgres:
15+
image: postgres:16
16+
env:
17+
POSTGRES_USER: postgres
18+
POSTGRES_PASSWORD: postgres
19+
POSTGRES_DB: hackorum_test
20+
ports: ["5432:5432"]
21+
options: >-
22+
--health-cmd="pg_isready -U postgres -d hackorum_test"
23+
--health-interval=10s
24+
--health-timeout=5s
25+
--health-retries=5
26+
27+
env:
28+
RAILS_ENV: test
29+
DATABASE_URL: postgres://postgres:postgres@localhost:5432/hackorum_test
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- uses: ruby/setup-ruby@v1
35+
with:
36+
ruby-version: '3.4'
37+
bundler-cache: true
38+
39+
- name: Install dependencies
40+
run: |
41+
sudo apt-get update -qq
42+
sudo apt-get install -y build-essential libpq-dev pkg-config
43+
44+
- name: Prepare database
45+
run: bin/rails db:prepare
46+
47+
- name: Run specs
48+
run: bundle exec rspec
49+
50+
docker-build:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
- name: Set up Docker Buildx
55+
uses: docker/setup-buildx-action@v3
56+
- name: Build app image
57+
uses: docker/build-push-action@v5
58+
with:
59+
context: .
60+
file: Dockerfile
61+
push: false
62+
tags: hackorum:test

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2+
#
3+
# Temporary files generated by your text editor or operating system
4+
# belong in git's global ignore instead:
5+
# `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore`
6+
7+
# Ignore bundler config.
8+
/.bundle
9+
10+
# Ignore all environment files.
11+
/.env*
12+
13+
# Ignore all logfiles and tempfiles.
14+
/log/*
15+
/tmp/*
16+
!/log/.keep
17+
!/tmp/.keep
18+
19+
# Ignore pidfiles, but keep the directory.
20+
/tmp/pids/*
21+
!/tmp/pids/
22+
!/tmp/pids/.keep
23+
24+
# Ignore storage (uploaded files in development and any SQLite databases).
25+
/storage/*
26+
!/storage/.keep
27+
/tmp/storage/*
28+
!/tmp/storage/
29+
!/tmp/storage/.keep
30+
31+
/public/assets
32+
33+
# Ignore master key for decrypting credentials and more.
34+
/config/master.key
35+
36+
.claude
37+
CLAUDE.md

.rubocop.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Omakase Ruby styling for Rails
2+
inherit_gem: { rubocop-rails-omakase: rubocop.yml }
3+
4+
# Overwrite or add rules to create your own house style
5+
#
6+
# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
7+
# Layout/SpaceInsideArrayLiteralBrackets:
8+
# Enabled: false

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby-3.4.4

Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# syntax=docker/dockerfile:1
2+
3+
ARG RUBY_VERSION=3.4
4+
FROM ruby:${RUBY_VERSION} AS base
5+
6+
ENV BUNDLE_WITHOUT="development:test" \
7+
RAILS_ENV=production \
8+
NODE_ENV=production
9+
10+
RUN apt-get update -qq && \
11+
apt-get install -y --no-install-recommends build-essential libpq-dev git curl && \
12+
rm -rf /var/lib/apt/lists/*
13+
14+
WORKDIR /app
15+
16+
COPY Gemfile Gemfile.lock ./
17+
RUN bundle install --jobs=4 --retry=3
18+
19+
COPY . .
20+
21+
RUN SECRET_KEY_BASE=dummy bundle exec rails assets:precompile
22+
23+
FROM ruby:${RUBY_VERSION}-slim AS final
24+
25+
ENV BUNDLE_WITHOUT="development:test" \
26+
RAILS_ENV=production \
27+
RAILS_LOG_TO_STDOUT=1 \
28+
RAILS_SERVE_STATIC_FILES=1 \
29+
NODE_ENV=production
30+
31+
RUN apt-get update -qq && \
32+
apt-get install -y --no-install-recommends libpq5 curl && \
33+
rm -rf /var/lib/apt/lists/*
34+
35+
WORKDIR /app
36+
37+
COPY --from=base /usr/local/bundle /usr/local/bundle
38+
COPY --from=base /app /app
39+
40+
EXPOSE 3000
41+
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]

Gemfile

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
source "https://rubygems.org"
2+
3+
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
4+
gem "rails", "~> 8.0.2"
5+
# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
6+
gem "propshaft"
7+
# Use postgresql as the database for Active Record
8+
gem "pg", "~> 1.1"
9+
# Use the Puma web server [https://github.com/puma/puma]
10+
gem "puma", ">= 5.0"
11+
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
12+
gem "importmap-rails"
13+
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
14+
gem "turbo-rails"
15+
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
16+
gem "stimulus-rails"
17+
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
18+
gem "jbuilder"
19+
gem "slim"
20+
gem "kaminari"
21+
22+
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
23+
gem "bcrypt", "~> 3.1"
24+
25+
# OmniAuth for Google OIDC
26+
gem "omniauth"
27+
gem "omniauth-rails_csrf_protection"
28+
gem "omniauth-google-oauth2"
29+
30+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
31+
gem "tzinfo-data", platforms: %i[ windows jruby ]
32+
33+
# Use the database-backed adapters for Rails.cache, Active Job, and Action Cable
34+
gem "solid_cache"
35+
gem "solid_queue"
36+
gem "solid_cable"
37+
38+
# Reduces boot times through caching; required in config/boot.rb
39+
gem "bootsnap", require: false
40+
41+
# Deploy this application anywhere as a Docker container [https://kamal-deploy.org]
42+
gem "kamal", require: false
43+
44+
# Add HTTP asset caching/compression and X-Sendfile acceleration to Puma [https://github.com/basecamp/thruster/]
45+
gem "thruster", require: false
46+
47+
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
48+
# gem "image_processing", "~> 1.2"
49+
50+
group :development, :test do
51+
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
52+
gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"
53+
54+
# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
55+
gem "brakeman", require: false
56+
57+
# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
58+
gem "rubocop-rails-omakase", require: false
59+
60+
gem "capybara"
61+
gem "selenium-webdriver"
62+
63+
gem "rspec-rails"
64+
gem "factory_bot_rails"
65+
gem "faker"
66+
gem "shoulda-matchers"
67+
end
68+
69+
group :development do
70+
# Use console on exceptions pages [https://github.com/rails/web-console]
71+
gem "web-console"
72+
73+
# Capture emails in-browser during development
74+
gem "letter_opener"
75+
gem "letter_opener_web"
76+
end

0 commit comments

Comments
 (0)