Skip to content

Commit

Permalink
feat: proof of concept (#1)
Browse files Browse the repository at this point in the history
# Overview

This is v1 of Naisho. See deployed app for more details.
  • Loading branch information
nshki authored Jun 10, 2024
1 parent 960f8d5 commit a7198be
Show file tree
Hide file tree
Showing 86 changed files with 2,524 additions and 44 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI
on: [pull_request]
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true

- name: Set up project
run: bin/setup

- name: Run Standard
run: bundle exec standardrb --fail-level A

- name: Run Annotate
run: bundle exec annotate --frozen

- name: Run Chusaku
run: bundle exec chusaku --dry-run --exit-with-error-on-annotation

- name: Run test suite
run: bin/rails test
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@
# Ignore default Litestack SQLite databases.
/db/**/*.sqlite3
/db/**/*.sqlite3-*

# Codecov.
/coverage

# Fly.io.
fly.toml
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ruby "3.3.2"

gem "bcrypt", "~> 3.1.7"
gem "bootsnap", require: false
gem "csv"
gem "dockerfile-rails", ">= 1.6", group: :development
gem "importmap-rails"
gem "jbuilder"
gem "litestack", github: "oldmoe/litestack"
Expand All @@ -15,6 +17,7 @@ gem "sqlite3", "~> 1.4"
gem "stimulus-rails"
gem "turbo-rails"
gem "tzinfo-data", platforms: %i[windows jruby]
gem "view_component"

group :development, :test do
gem "debug", platforms: %i[mri windows]
Expand All @@ -29,7 +32,6 @@ end

group :test do
gem "capybara"
gem "mocktail"
gem "selenium-webdriver"
gem "simplecov", require: false
end
17 changes: 11 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,14 @@ GEM
concurrent-ruby (1.3.1)
connection_pool (2.4.1)
crass (1.0.6)
csv (3.3.0)
date (3.3.4)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
docile (1.4.0)
dockerfile-rails (1.6.16)
rails (>= 3.0.0)
drb (2.2.1)
erubi (1.12.0)
globalid (1.2.1)
Expand Down Expand Up @@ -149,11 +152,9 @@ GEM
net-smtp
marcel (1.0.4)
matrix (0.4.2)
method_source (1.1.0)
mini_mime (1.1.5)
minitest (5.23.1)
mocktail (2.0.0)
sorbet-eraser (~> 0.3.1)
sorbet-runtime (~> 0.5.9204)
msgpack (1.7.2)
mutex_m (0.2.0)
net-imap (0.4.12)
Expand Down Expand Up @@ -265,8 +266,6 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
sorbet-eraser (0.3.1)
sorbet-runtime (0.5.11415)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
Expand Down Expand Up @@ -306,6 +305,10 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
view_component (3.12.1)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
Expand Down Expand Up @@ -334,11 +337,12 @@ DEPENDENCIES
bootsnap
capybara
chusaku
csv
debug
dockerfile-rails (>= 1.6)
importmap-rails
jbuilder
litestack!
mocktail
puma (>= 5.0)
rails (~> 7.1.3, >= 7.1.3.4)
selenium-webdriver
Expand All @@ -349,6 +353,7 @@ DEPENDENCIES
stimulus-rails
turbo-rails
tzinfo-data
view_component
web-console

RUBY VERSION
Expand Down
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 Nishiki Liu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# PIDR
# Naisho

**P**ersonal **I**nformation **D**eletion **R**equester.
Naisho is a free and open-source tool for sending personal information data deletion request emails to data brokers via SMTP.

## Stack

- [Ruby on Rails](https://rubyonrails.org/) v7.1.3.4
- [Hotwire](https://hotwired.dev/)
- [Litestack](https://github.com/oldmoe/litestack)
- [ViewComponent](https://viewcomponent.org/)

## Local setup (native)

1. Clone the repo.
2. Install [Ruby](https://www.ruby-lang.org/en/) v3.3.2.
3. Install [SQLite3](https://www.sqlite.org/index.html).
4. Run `bin/setup` to install Ruby dependencies and set up the database.
5. Run `bin/rake sync_companies` to pull the latest data broker companies from sources.
6. Run `bin/rails server` to start the Rails server.
13 changes: 13 additions & 0 deletions app/assets/stylesheets/1-config/animations.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@keyframes slide-in {
from {
max-height: 0;
opacity: 0;
overflow-y: hidden;
}

to {
max-height: var(--slide-in-height);
opacity: 1;
overflow-y: visible;
}
}
91 changes: 91 additions & 0 deletions app/assets/stylesheets/1-config/base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
*, *::before, *::after {
box-sizing: border-box;
font-family: inherit;
font-size: inherit;
}

body {
--color-background: var(--color-cream);
--color-text: var(--color-ash);

background-color: var(--color-background);
margin: 0;
font-family: var(--font-body);
line-height: 1.5;
color: var(--color-text);

@media (prefers-color-scheme: dark) {
--color-background: var(--color-night);
--color-text: var(--color-dusk);
}
}

p, h1, h2, h3, h4, h5, h6, ul, ol {
margin: 0;
}

img, svg {
max-width: 100%;
height: auto;
}

h1, h2, h3 {
line-height: 1.2;
text-wrap: balance;
}

h1, h2, h3, h4, h5, h6 {
--color-text: var(--color-black);

color: var(--color-text);

@media (prefers-color-scheme: dark) {
--color-text: var(--color-cream);
}
}

input, textarea, select {
--background:
linear-gradient(
to bottom right,
var(--background-from),
var(--background-to)
);
--background-from: rgba(0, 0, 0, 0.05);
--background-to: rgba(0, 0, 0, 0.025);
--color-text: var(--color-night);

background: var(--background);
appearance: none;
padding: var(--spacing-md);
border: none;
border-radius: var(--radius);
font-family: var(--font-mono);
font-size: 0.875rem;
line-height: inherit;
color: var(--color-text);

@media (prefers-color-scheme: dark) {
--background-from: rgba(0, 0, 0, 0.2);
--background-to: rgba(0, 0, 0, 0.15);
--color-text: var(--color-cream);
}

&:focus {
--background: rgba(0, 0, 0, 0.01);
--color-outline: var(--color-water);
--color-text: var(--color-black);

outline: 2px solid var(--color-outline);

@media (prefers-color-scheme: dark) {
--background: rgba(0, 0, 0, 0.3);
--color-text: var(--color-white);
}
}
}

textarea {
min-height: 30em;
resize: vertical;
}
3 changes: 3 additions & 0 deletions app/assets/stylesheets/1-config/utilities.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.mt-sm {
margin-top: var(--spacing-sm);
}
26 changes: 26 additions & 0 deletions app/assets/stylesheets/1-config/variables.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
:root {
--color-white: #fff;
--color-black: #000;
--color-cream: #fafafa;
--color-ash: #6b7079;
--color-dusk: #979fad;
--color-night: #282c34;
--color-water: #00b0ab;
--color-ocean: #007c72;

--font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
"Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
"Helvetica Neue", sans-serif;
--font-mono: SFMono-Regular, "Consolas", "Liberation Mono", "Menlo", monospace;

--transition: all 0.2s ease-in-out;

--radius: 4px;
--radius-lg: 20px;

--spacing-xs: 0.25rem;
--spacing-sm: 0.5rem;
--spacing-md: 1rem;
--spacing-lg: 2rem;
--spacing-xl: 4rem;
}
46 changes: 46 additions & 0 deletions app/assets/stylesheets/2-components/button.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.button {
--background:
linear-gradient(
to bottom,
var(--background-from),
var(--background-to)
);
--background-from: var(--color-water);
--background-to: var(--color-ocean);
--color-outline: var(--color-water);
--color-text: var(--color-cream);

background: var(--background);
padding: var(--spacing-md);
border: none;
border-radius: var(--radius);
outline: none;
font-weight: 600;
text-align: center;
text-decoration: none;
color: var(--color-text);
cursor: pointer;

&:focus {
outline: 2px solid var(--color-outline);
}

&:active {
--background: var(--color-ocean);
}
}

.button--secondary {
--background: transparent;
--color-text: var(--color-water);

outline: 2px dotted var(--color-outline);

&:active {
--background: transparent;
}

@media (prefers-color-scheme: dark) {
--color-text: var(--color-cream);
}
}
Loading

0 comments on commit a7198be

Please sign in to comment.