diff --git a/Gemfile b/Gemfile index 345f9deb..f243505e 100644 --- a/Gemfile +++ b/Gemfile @@ -20,8 +20,6 @@ gem "solid_cache" gem "bootsnap", require: false gem "thruster", require: false -gem "redis", "~> 5.4.1" -gem "sidekiq", "~> 8.0" gem "view_component", "~> 4.0" gem "kaminari", "~> 1.2" diff --git a/Gemfile.lock b/Gemfile.lock index ab1f9bad..530699cf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -362,10 +362,6 @@ GEM rdoc (6.14.2) erb psych (>= 4.0.0) - redis (5.4.1) - redis-client (>= 0.22.0) - redis-client (0.25.2) - connection_pool regexp_parser (2.11.3) reline (0.6.2) io-console (~> 0.5) @@ -435,12 +431,6 @@ GEM shoulda-context (2.0.0) shoulda-matchers (4.5.1) activesupport (>= 4.2.0) - sidekiq (8.0.7) - connection_pool (>= 2.5.0) - json (>= 2.9.0) - logger (>= 1.6.2) - rack (>= 3.1.0) - redis-client (>= 0.23.2) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -556,7 +546,6 @@ DEPENDENCIES puma (>= 5.0) rails (~> 8.0.2) rails-controller-testing - redis (~> 5.4.1) rspec (~> 3.13) rspec-rails (~> 8.0) ruby-lsp (~> 0.26) @@ -564,7 +553,6 @@ DEPENDENCIES selenium-webdriver (~> 4.11) shoulda (~> 4.0) shoulda-matchers (~> 4.5) - sidekiq (~> 8.0) simplecov smarter_csv solid_cache diff --git a/Procfile.dev b/Procfile.dev index 3e82819b..c1cb2484 100644 --- a/Procfile.dev +++ b/Procfile.dev @@ -1,4 +1,3 @@ web: env RUBY_DEBUG_OPEN=true bin/rails server js: yarn build --watch css: yarn build:css --watch -worker: bundle exec sidekiq -C config/sidekiq.yml diff --git a/README.md b/README.md index 69d01db5..10feb9a3 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Before you begin, ensure you have the following installed: * Node.js 18.17.0 (we recommend using `nvm` for version management) * Yarn (latest version) * PostgreSQL locally or in a container. -* Docker and Docker Compose (for LocalStack S3 in development) +* Docker and Docker Compose (for LocalStack AWS services in development) ## Rails App Development Setup @@ -53,16 +53,14 @@ This command starts the following processes (defined in `Procfile.dev`): - Rails server - JavaScript build process (with esbuild) - CSS build process (with Tailwind CSS) -- Sidekiq worker for background jobs The application will be available at http://localhost:3000 -## Architecture Overview +## Rails Architecture Overview - **Frontend**: Built with Hotwired (Turbo + Stimulus) and Tailwind CSS - **Backend**: Ruby on Rails 7.0 -- **Background Jobs**: Sidekiq with Redis -- **Testing**: RSpec +- **Testing**: RSpec, Capybara ## Python Components diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb deleted file mode 100644 index df8b2638..00000000 --- a/config/initializers/sidekiq.rb +++ /dev/null @@ -1,9 +0,0 @@ -Sidekiq.configure_server do |config| - config.redis = {url: ENV.fetch("REDIS_URL", "redis://localhost:6379/0")} -end - -Sidekiq.configure_client do |config| - config.redis = {url: ENV.fetch("REDIS_URL", "redis://localhost:6379/0")} -end - -Rails.application.config.active_job.queue_adapter = :sidekiq diff --git a/config/routes.rb b/config/routes.rb index 19c45da8..1eb0c218 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,3 @@ -require "sidekiq/web" - Rails.application.routes.draw do devise_for :users, controllers: { sessions: "users/sessions", diff --git a/config/sidekiq.yml b/config/sidekiq.yml deleted file mode 100644 index 3b9ff780..00000000 --- a/config/sidekiq.yml +++ /dev/null @@ -1,6 +0,0 @@ -:concurrency: 5 -:timeout: 25 -:verbose: false - -:queues: - - default diff --git a/docs/windows_localdev.md b/docs/windows_localdev.md index 58bbf1b9..8aa8ce8d 100644 --- a/docs/windows_localdev.md +++ b/docs/windows_localdev.md @@ -25,7 +25,6 @@ We've tested two approaches for Windows development: **Prerequisites:** - Clone the repository to your WSL home directory (this avoids file permission issues) -- Install Redis: `apt install redis-server` (required but not actively used yet) - Install Yarn: `npm install yarn -y` **Configuration Steps:** @@ -149,8 +148,6 @@ services: # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. # (Adding the "ports" property to this file will not forward from a Codespace.) - redis: - image: redis:latest db: image: postgres:latest restart: unless-stopped diff --git a/terraform/config/prod/outputs.tf b/terraform/config/prod/outputs.tf index 0218462e..6d89d642 100644 --- a/terraform/config/prod/outputs.tf +++ b/terraform/config/prod/outputs.tf @@ -34,16 +34,6 @@ output "db_password_secret_arn" { sensitive = true } -output "redis_endpoint" { - description = "Endpoint of the Redis cluster" - value = module.asap_pdf.redis_endpoint -} - -output "redis_port" { - description = "Port of the Redis cluster" - value = module.asap_pdf.redis_port -} - output "ecs_cluster_name" { description = "Name of the ECS cluster" value = module.asap_pdf.ecs_cluster_name @@ -66,11 +56,6 @@ output "database_url" { sensitive = true } -output "redis_url" { - description = "Redis connection URL" - value = module.asap_pdf.redis_url -} - output "github_actions_role_arn" { description = "The ARN of the IAM role for GitHub Actions" value = module.asap_pdf.github_actions_role_arn diff --git a/terraform/config/staging/outputs.tf b/terraform/config/staging/outputs.tf index 0218462e..6d89d642 100644 --- a/terraform/config/staging/outputs.tf +++ b/terraform/config/staging/outputs.tf @@ -34,16 +34,6 @@ output "db_password_secret_arn" { sensitive = true } -output "redis_endpoint" { - description = "Endpoint of the Redis cluster" - value = module.asap_pdf.redis_endpoint -} - -output "redis_port" { - description = "Port of the Redis cluster" - value = module.asap_pdf.redis_port -} - output "ecs_cluster_name" { description = "Name of the ECS cluster" value = module.asap_pdf.ecs_cluster_name @@ -66,11 +56,6 @@ output "database_url" { sensitive = true } -output "redis_url" { - description = "Redis connection URL" - value = module.asap_pdf.redis_url -} - output "github_actions_role_arn" { description = "The ARN of the IAM role for GitHub Actions" value = module.asap_pdf.github_actions_role_arn diff --git a/terraform/modules/asap_pdf/main.tf b/terraform/modules/asap_pdf/main.tf index 6a356df1..1458b133 100644 --- a/terraform/modules/asap_pdf/main.tf +++ b/terraform/modules/asap_pdf/main.tf @@ -21,18 +21,13 @@ module "secrets" { DB_PASSWORD = { description = "Database password" } - - # Redis credentials + # Rails credentials RAILS_MASTER_KEY = { description = "Rails master key" } SECRET_KEY_BASE = { description = "Rails secret key" } - REDIS_URL = { - description = "Redis/Elasticache URL" - } - # SMTP credentials SMTP_ENDPOINT = { description = "SMTP endpoint" @@ -105,16 +100,6 @@ module "database" { multi_az = var.rds_multi_az } -# Redis for Sidekiq -module "cache" { - source = "../cache" - - project_name = var.project_name - environment = var.environment - subnet_ids = module.networking.private_subnet_ids - security_group_id = module.networking.redis_security_group_id -} - # Deployment resources (ECR, GitHub Actions, Secrets) module "deployment" { source = "../deployment" @@ -148,7 +133,6 @@ module "ecs" { smtp_endpoint_secret_arn = module.secrets.secrets["SMTP_ENDPOINT"].secret_arn smtp_user_secret_arn = module.secrets.secrets["SMTP_USER"].secret_arn smtp_password_secret_arn = module.secrets.secrets["SMTP_PASSWORD"].secret_arn - redis_url_secret_arn = module.secrets.secrets["REDIS_URL"].secret_arn google_analytics_key_arn = module.secrets.secrets["GOOGLE_ANALYTICS_KEY"].secret_arn vpc_id = module.networking.vpc_id diff --git a/terraform/modules/asap_pdf/outputs.tf b/terraform/modules/asap_pdf/outputs.tf index 92a6be32..f9397b4c 100644 --- a/terraform/modules/asap_pdf/outputs.tf +++ b/terraform/modules/asap_pdf/outputs.tf @@ -34,16 +34,6 @@ output "db_password_secret_arn" { sensitive = true } -output "redis_endpoint" { - description = "Endpoint of the Redis cluster" - value = module.cache.redis_endpoint -} - -output "redis_port" { - description = "Port of the Redis cluster" - value = module.cache.redis_port -} - output "ecs_cluster_name" { description = "Name of the ECS cluster" value = module.ecs.cluster_name @@ -76,14 +66,6 @@ output "database_url" { sensitive = true } -output "redis_url" { - description = "Redis connection URL" - value = format("redis://%s:%s", - module.cache.redis_endpoint, - module.cache.redis_port - ) -} - output "github_actions_role_arn" { description = "The ARN of the IAM role for GitHub Actions" value = module.deployment.github_actions_role_arn diff --git a/terraform/modules/cache/main.tf b/terraform/modules/cache/main.tf deleted file mode 100644 index b7b00468..00000000 --- a/terraform/modules/cache/main.tf +++ /dev/null @@ -1,47 +0,0 @@ -# Redis subnet group -resource "aws_elasticache_subnet_group" "main" { - name = "${var.project_name}-${var.environment}" - description = "Subnet group for Redis cluster" - subnet_ids = var.subnet_ids -} - -# Redis parameter group -resource "aws_elasticache_parameter_group" "main" { - family = "redis7" - name = "${var.project_name}-${var.environment}" - - parameter { - name = "maxmemory-policy" - value = "allkeys-lru" - } - - parameter { - name = "timeout" - value = "300" - } - - tags = { - Name = "${var.project_name}-${var.environment}-parameter-group" - } -} - -# Redis cluster -resource "aws_elasticache_cluster" "main" { - cluster_id = "${var.project_name}-${var.environment}" - engine = "redis" - node_type = "cache.t3.micro" - num_cache_nodes = 1 - parameter_group_name = aws_elasticache_parameter_group.main.name - port = 6379 - subnet_group_name = aws_elasticache_subnet_group.main.name - security_group_ids = [var.security_group_id] - - maintenance_window = "sun:05:00-sun:06:00" - snapshot_window = "04:00-05:00" - - snapshot_retention_limit = 7 - - tags = { - Name = "${var.project_name}-${var.environment}-redis" - } -} diff --git a/terraform/modules/cache/outputs.tf b/terraform/modules/cache/outputs.tf deleted file mode 100644 index 4ccb24a2..00000000 --- a/terraform/modules/cache/outputs.tf +++ /dev/null @@ -1,19 +0,0 @@ -output "redis_endpoint" { - description = "The endpoint of the Redis cluster" - value = aws_elasticache_cluster.main.cache_nodes[0].address -} - -output "redis_port" { - description = "The port number of the Redis cluster" - value = aws_elasticache_cluster.main.cache_nodes[0].port -} - -output "redis_security_group_id" { - description = "The ID of the Redis security group" - value = var.security_group_id -} - -output "redis_connection_string" { - description = "Redis connection string (without authentication)" - value = "redis://${aws_elasticache_cluster.main.cache_nodes[0].address}:${aws_elasticache_cluster.main.cache_nodes[0].port}" -} diff --git a/terraform/modules/cache/variables.tf b/terraform/modules/cache/variables.tf deleted file mode 100644 index 89119067..00000000 --- a/terraform/modules/cache/variables.tf +++ /dev/null @@ -1,19 +0,0 @@ -variable "project_name" { - description = "Name of the project, used in resource naming" - type = string -} - -variable "environment" { - description = "Environment name" - type = string -} - -variable "subnet_ids" { - description = "List of subnet IDs where Redis will be placed" - type = list(string) -} - -variable "security_group_id" { - description = "ID of the security group for Redis" - type = string -} diff --git a/terraform/modules/ecs/main.tf b/terraform/modules/ecs/main.tf index df5f9833..ba4a4964 100644 --- a/terraform/modules/ecs/main.tf +++ b/terraform/modules/ecs/main.tf @@ -41,7 +41,6 @@ module "fargate_service" { DB_PASSWORD : var.db_password_secret_arn SECRET_KEY_BASE : var.secret_key_base_secret_arn RAILS_MASTER_KEY : var.rails_master_key_secret_arn - REDIS_URL : var.redis_url_secret_arn, SMTP_ENDPOINT : var.smtp_endpoint_secret_arn, SMTP_USER : var.smtp_user_secret_arn, SMTP_PASSWORD : var.smtp_password_secret_arn, @@ -68,7 +67,6 @@ resource "aws_iam_policy" "ecs_task_secrets_policy" { var.db_password_secret_arn, var.secret_key_base_secret_arn, var.rails_master_key_secret_arn, - var.redis_url_secret_arn, var.smtp_endpoint_secret_arn, var.smtp_user_secret_arn, var.smtp_password_secret_arn, diff --git a/terraform/modules/ecs/variables.tf b/terraform/modules/ecs/variables.tf index 1314f2cd..e3187aa5 100644 --- a/terraform/modules/ecs/variables.tf +++ b/terraform/modules/ecs/variables.tf @@ -69,11 +69,6 @@ variable "google_analytics_key_arn" { type = string } -variable "redis_url_secret_arn" { - description = "ARN of the Redis URL secret in Secrets Manager" - type = string -} - variable "vpc_id" { description = "The VPC id from our network friend." type = string diff --git a/terraform/modules/networking/main.tf b/terraform/modules/networking/main.tf index 754dd5c1..84422286 100644 --- a/terraform/modules/networking/main.tf +++ b/terraform/modules/networking/main.tf @@ -53,27 +53,3 @@ resource "aws_security_group" "rds" { Name = "${var.project_name}-${var.environment}-rds-sg" } } - -resource "aws_security_group" "redis" { - name = "${var.project_name}-${var.environment}-redis-sg" - description = "Security group for Redis cluster" - vpc_id = module.vpc.vpc_id - - ingress { - from_port = 6379 - to_port = 6379 - protocol = "tcp" - cidr_blocks = module.vpc.private_subnets_cidr_blocks - } - - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - - tags = { - Name = "${var.project_name}-${var.environment}-redis-sg" - } -} diff --git a/terraform/modules/networking/outputs.tf b/terraform/modules/networking/outputs.tf index 5780ffb8..198d052d 100644 --- a/terraform/modules/networking/outputs.tf +++ b/terraform/modules/networking/outputs.tf @@ -21,9 +21,4 @@ output "lambda_security_group_id" { output "rds_security_group_id" { description = "ID of the RDS security group" value = aws_security_group.rds.id -} - -output "redis_security_group_id" { - description = "The ID of the Redis security group" - value = aws_security_group.redis.id -} +} \ No newline at end of file