Commit iniziale di eminuxCRM: CRM Rails con pipeline, campagne email e Docker.
CI / scan_ruby (push) Failing after 11m20s
CI / scan_js (push) Successful in 10m35s
CI / lint (push) Has been cancelled

Include autenticazione, progetti isolati, mail marketing HTML con SMTP, test A/B e editor WYSIWYG.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-17 23:01:48 +02:00
co-authored by Cursor
commit c4e5f289cf
258 changed files with 11293 additions and 0 deletions
Executable
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
STAMP="$(date +%Y%m%d_%H%M%S)"
OUT_DIR="${BACKUP_DIR:-$ROOT/tmp/backups}"
mkdir -p "$OUT_DIR"
# Prefer Docker Compose postgres service when available
if docker compose -f "$ROOT/docker-compose.yml" ps postgres 2>/dev/null | grep -q "running\|Up"; then
FILE="$OUT_DIR/simplecrm_${STAMP}.sql.gz"
echo "Backup via docker compose → $FILE"
docker compose -f "$ROOT/docker-compose.yml" exec -T postgres \
pg_dump -U "${POSTGRES_USER:-simplecrm}" "${POSTGRES_DB:-simplecrm_development}" | gzip > "$FILE"
else
FILE="$OUT_DIR/simplecrm_${STAMP}.sql.gz"
echo "Backup via local pg_dump → $FILE"
PGPASSWORD="${POSTGRES_PASSWORD:-simplecrm_dev}" pg_dump \
-h "${DATABASE_HOST:-localhost}" \
-U "${POSTGRES_USER:-simplecrm}" \
"${POSTGRES_DB:-simplecrm_development}" | gzip > "$FILE"
fi
echo "OK: $FILE"
Executable
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"
ARGV.unshift("--ensure-latest")
load Gem.bin_path("brakeman", "brakeman")
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env ruby
require_relative "../config/boot"
require "bundler/audit/cli"
ARGV.concat %w[ --config config/bundler-audit.yml ] if ARGV.empty? || ARGV.include?("check")
Bundler::Audit::CLI.start
Executable
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env ruby
require_relative "../config/boot"
require "active_support/continuous_integration"
CI = ActiveSupport::ContinuousIntegration
require_relative "../config/ci.rb"
Executable
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env sh
if ! gem list foreman -i --silent; then
echo "Installing foreman..."
gem install foreman
fi
# Default to port 3000 if not specified
export PORT="${PORT:-3000}"
# Let the debug gem allow remote connections,
# but avoid loading until `debugger` is called
export RUBY_DEBUG_OPEN="true"
export RUBY_DEBUG_LAZY="true"
exec foreman start -f Procfile.dev "$@"
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
set -e
# Wait for postgres if DATABASE_HOST is set
if [ -n "${DATABASE_HOST}" ]; then
echo "Waiting for PostgreSQL at ${DATABASE_HOST}:${DATABASE_PORT:-5432}..."
until pg_isready -h "${DATABASE_HOST}" -p "${DATABASE_PORT:-5432}" -U "${POSTGRES_USER:-simplecrm}" >/dev/null 2>&1; do
sleep 1
done
echo "PostgreSQL is ready."
fi
# Prepare DB (create + migrate). Seed only when explicitly requested.
if [ "${RAILS_ENV}" = "production" ] || [ "${RAILS_ENV}" = "development" ]; then
./bin/rails db:prepare
if [ "${RUN_SEEDS}" = "true" ]; then
./bin/rails db:seed
fi
fi
exec "$@"
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby
require_relative "../config/application"
require "importmap/commands"
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path("../config/application", __dir__)
require_relative "../config/boot"
require "rails/commands"
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby
require_relative "../config/boot"
require "rake"
Rake.application.run
Executable
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
FILE="${1:-}"
if [[ -z "$FILE" ]]; then
echo "Uso: bin/restore <backup.sql.gz>"
exit 1
fi
if [[ ! -f "$FILE" ]]; then
echo "File non trovato: $FILE"
exit 1
fi
echo "ATTENZIONE: il restore sovrascrive il database corrente."
read -r -p "Continuare? [y/N] " confirm
[[ "$confirm" == "y" || "$confirm" == "Y" ]] || exit 1
if docker compose -f "$ROOT/docker-compose.yml" ps postgres 2>/dev/null | grep -q "running\|Up"; then
gunzip -c "$FILE" | docker compose -f "$ROOT/docker-compose.yml" exec -T postgres \
psql -U "${POSTGRES_USER:-simplecrm}" -d "${POSTGRES_DB:-simplecrm_development}"
else
gunzip -c "$FILE" | PGPASSWORD="${POSTGRES_PASSWORD:-simplecrm_dev}" psql \
-h "${DATABASE_HOST:-localhost}" \
-U "${POSTGRES_USER:-simplecrm}" \
-d "${POSTGRES_DB:-simplecrm_development}"
fi
echo "Restore completato."
Executable
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"
# Explicit RuboCop config increases performance slightly while avoiding config confusion.
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
load Gem.bin_path("rubocop", "rubocop")
Executable
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/env ruby
require "fileutils"
APP_ROOT = File.expand_path("..", __dir__)
def system!(*args)
system(*args, exception: true)
end
FileUtils.chdir APP_ROOT do
# This script is a way to set up or update your development environment automatically.
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.
puts "== Installing dependencies =="
system("bundle check") || system!("bundle install")
# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
# end
puts "\n== Preparing database =="
system! "bin/rails db:prepare"
system! "bin/rails db:reset" if ARGV.include?("--reset")
puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"
unless ARGV.include?("--skip-server")
puts "\n== Starting development server =="
STDOUT.flush # flush the output before exec(2) so that it displays
exec "bin/dev"
end
end