Skip to content

Commit 33abc61

Browse files
initial commit
0 parents  commit 33abc61

109 files changed

Lines changed: 3202 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.

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Get test keys from https://dashboard.paystack.com/#/settings/developers
2+
# Copy this file to .env and fill in your own test keys (never commit .env).
3+
PAYSTACK_SECRET_KEY=sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

.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/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: bundler
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: "/"
10+
schedule:
11+
interval: weekly
12+
open-pull-requests-limit: 10

.github/workflows/ci.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ main ]
7+
8+
jobs:
9+
scan_ruby:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v5
15+
16+
- name: Set up Ruby
17+
uses: ruby/setup-ruby@v1
18+
with:
19+
bundler-cache: true
20+
21+
- name: Scan for common Rails security vulnerabilities using static analysis
22+
run: bin/brakeman --no-pager
23+
24+
- name: Scan for known security vulnerabilities in gems used
25+
run: bin/bundler-audit
26+
27+
scan_js:
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v5
33+
34+
- name: Set up Ruby
35+
uses: ruby/setup-ruby@v1
36+
with:
37+
bundler-cache: true
38+
39+
- name: Scan for security vulnerabilities in JavaScript dependencies
40+
run: bin/importmap audit
41+
42+
lint:
43+
runs-on: ubuntu-latest
44+
env:
45+
RUBOCOP_CACHE_ROOT: tmp/rubocop
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v5
49+
50+
- name: Set up Ruby
51+
uses: ruby/setup-ruby@v1
52+
with:
53+
bundler-cache: true
54+
55+
- name: Prepare RuboCop cache
56+
uses: actions/cache@v4
57+
env:
58+
DEPENDENCIES_HASH: ${{ hashFiles('.ruby-version', '**/.rubocop.yml', '**/.rubocop_todo.yml', 'Gemfile.lock') }}
59+
with:
60+
path: ${{ env.RUBOCOP_CACHE_ROOT }}
61+
key: rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-${{ github.ref_name == github.event.repository.default_branch && github.run_id || 'default' }}
62+
restore-keys: |
63+
rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-
64+
65+
- name: Lint code for consistent style
66+
run: bin/rubocop -f github
67+
68+
test:
69+
runs-on: ubuntu-latest
70+
71+
# services:
72+
# redis:
73+
# image: valkey/valkey:8
74+
# ports:
75+
# - 6379:6379
76+
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
77+
steps:
78+
- name: Checkout code
79+
uses: actions/checkout@v5
80+
81+
- name: Set up Ruby
82+
uses: ruby/setup-ruby@v1
83+
with:
84+
bundler-cache: true
85+
86+
- name: Run tests
87+
env:
88+
RAILS_ENV: test
89+
# RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
90+
# REDIS_URL: redis://localhost:6379/0
91+
run: bin/rails db:test:prepare test
92+
93+
system-test:
94+
runs-on: ubuntu-latest
95+
96+
# services:
97+
# redis:
98+
# image: valkey/valkey:8
99+
# ports:
100+
# - 6379:6379
101+
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
102+
steps:
103+
- name: Checkout code
104+
uses: actions/checkout@v5
105+
106+
- name: Set up Ruby
107+
uses: ruby/setup-ruby@v1
108+
with:
109+
bundler-cache: true
110+
111+
- name: Run System Tests
112+
env:
113+
RAILS_ENV: test
114+
# RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
115+
# REDIS_URL: redis://localhost:6379/0
116+
run: bin/rails db:test:prepare test:system
117+
118+
- name: Keep screenshots from failed system tests
119+
uses: actions/upload-artifact@v4
120+
if: failure()
121+
with:
122+
name: screenshots
123+
path: ${{ github.workspace }}/tmp/screenshots
124+
if-no-files-found: ignore

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
!/.env.example
13+
14+
# Ignore all logfiles and tempfiles.
15+
/log/*
16+
/tmp/*
17+
!/log/.keep
18+
!/tmp/.keep
19+
20+
# Ignore pidfiles, but keep the directory.
21+
/tmp/pids/*
22+
!/tmp/pids/
23+
!/tmp/pids/.keep
24+
25+
# Ignore storage (uploaded files in development and any SQLite databases).
26+
/storage/*
27+
!/storage/.keep
28+
/tmp/storage/*
29+
!/tmp/storage/
30+
!/tmp/storage/.keep
31+
32+
/public/assets
33+
34+
# Ignore key files for decrypting credentials and more.
35+
/config/*.key
36+

.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+
3.4.9

Gemfile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
source "https://rubygems.org"
2+
3+
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
4+
gem "rails", "~> 8.1.1"
5+
# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
6+
gem "propshaft"
7+
# Use sqlite3 as the database for Active Record
8+
gem "sqlite3", ">= 2.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+
20+
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
21+
# gem "bcrypt", "~> 3.1.7"
22+
23+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
24+
gem "tzinfo-data", platforms: %i[ windows jruby ]
25+
26+
# Use the database-backed adapters for Rails.cache, Active Job, and Action Cable
27+
gem "solid_cache"
28+
gem "solid_queue"
29+
gem "solid_cable"
30+
31+
# Reduces boot times through caching; required in config/boot.rb
32+
gem "bootsnap", require: false
33+
34+
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
35+
gem "image_processing", "~> 1.2"
36+
37+
# Ruby SDK for the Paystack API [https://github.com/PaystackOSS/paystack-ruby]
38+
gem "paystack-ruby", ">= 1.0.1", require: "paystack"
39+
40+
group :development, :test do
41+
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
42+
gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"
43+
44+
# Audits gems for known security defects (use config/bundler-audit.yml to ignore issues)
45+
gem "bundler-audit", require: false
46+
47+
# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
48+
gem "brakeman", require: false
49+
50+
# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
51+
gem "rubocop-rails-omakase", require: false
52+
53+
# Load PAYSTACK_* keys from .env in development/test [https://github.com/bkeepers/dotenv]
54+
gem "dotenv-rails"
55+
end
56+
57+
group :development do
58+
# Use console on exceptions pages [https://github.com/rails/web-console]
59+
gem "web-console"
60+
end
61+
62+
group :test do
63+
# Pin minitest below 6.0, which split MiniTest::Mock out into a separate gem
64+
gem "minitest", "~> 5.27"
65+
66+
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
67+
gem "capybara"
68+
gem "selenium-webdriver"
69+
end

0 commit comments

Comments
 (0)