Skip to content

Commit

Permalink
Remove redis dep
Browse files Browse the repository at this point in the history
  • Loading branch information
vitallium committed Apr 28, 2024
1 parent 0b4d988 commit 25fcb4f
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 34 deletions.
1 change: 0 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
SECRET_KEY_BASE=verysecret
REDIS_URL=redis://localhost
RACK_MINI_PROFILER=1
ENABLE_QUERY_TRACE=1
APPLICATION_HOST=localhost
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ gem "rails", "~> 6.1"
gem "rails-i18n", "~> 6.0"
gem "recipient_interceptor"
gem "redcarpet", "~> 3.5.1"
gem "redis"
gem "responders"
gem "russian"
gem "sass-rails", "~> 6.0"
Expand Down
2 changes: 0 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ GEM
recipient_interceptor (0.2.0)
mail
redcarpet (3.5.1)
redis (3.3.3)
regexp_parser (2.9.0)
responders (3.1.1)
actionpack (>= 5.2)
Expand Down Expand Up @@ -561,7 +560,6 @@ DEPENDENCIES
rails_stdout_logging
recipient_interceptor
redcarpet (~> 3.5.1)
redis
responders
rspec-rails
rubocop-rails-omakase
Expand Down
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
# It61

[![View performance data on Skylight](https://badges.skylight.io/status/9ACn286v2ne4.svg)](https://oss.skylight.io/app/applications/9ACn286v2ne4)
# IT61

## Requirements

- Ruby 2.4.3 (with bundler)
- PostgreSQL >= 9.5
- Redis
- Ruby 3.1.1
- PostgreSQL 16.2

## Development setup

1. Install gems: `bundle install`
2. **optional:** Install `overcommit` for GIT commit hooks
3. **optional:** Install GIT hooks with `overcommit`: `overcommit --install -f`
4. **optional:** Run `overcommit --sign` to trust the hooks in this repository.
5. Before creating the database you must setup connection strings for PostgreSQL and Redis. Put these default values to `.env` file:

```
DATABASE_URL=postgres://postgres@localhost:5432/it61
REDIS_URL=redis://localhost:6379
```

6. Setup database and run migrations: `rails db:setup`
7. Run server: `./bin/rails server`
5. Setup database and run migrations: `rails db:setup`
6. Run server: `./bin/rails server`

## Docker development setup

Expand Down
11 changes: 7 additions & 4 deletions config/cable.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
development:
adapter: async
adapter: postgresql

test:
adapter: async
adapter: test

staging:
adapter: async
adapter: redis
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
channel_prefix: it61_staging

production:
adapter: redis
url: <%= ENV.fetch("REDIS_URL", "redis://localhost:6379/1") %>
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
channel_prefix: it61_production
4 changes: 0 additions & 4 deletions config/initializers/rack_mini_profiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
end

if defined?(Rack::MiniProfiler)
uri = URI.parse(ENV["REDIS_URL"])
Rack::MiniProfiler.config.storage_options = { host: uri.host, port: uri.port, password: uri.password }
Rack::MiniProfiler.config.storage = Rack::MiniProfiler::RedisStore

skip = [
/assets/,
/\/avatar\//,
Expand Down
1 change: 0 additions & 1 deletion config/initializers/redis.rb

This file was deleted.

7 changes: 1 addition & 6 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '2'
version: "2"
services:
# Main application container
app:
Expand All @@ -14,12 +14,10 @@ services:
- "3000:3000"
environment:
- DATABASE_URL=postgres://postgres@db:5432/it61
- REDIS_URL=redis://redis:6379/1
# Uncomment if you REALLY know what this variable stands for and you REALLY need this
# - BUNDLE_JOBS=6
depends_on:
- db
- redis

# Mounted folder for Gemfile gems container
gems:
Expand All @@ -32,6 +30,3 @@ services:
image: postgres
ports:
- "6543:5432"

redis:
image: redis

0 comments on commit 25fcb4f

Please sign in to comment.