From f09ab8d41382819e606b0305a05ebbe31ebe27b7 Mon Sep 17 00:00:00 2001 From: Kartik-Josh Date: Mon, 20 Jan 2025 19:00:58 +0530 Subject: [PATCH] Created AiCruit Application --- RoR_App/aicruit-admin/.dockerignore | 51 +++ RoR_App/aicruit-admin/.gitattributes | 9 + RoR_App/aicruit-admin/.github/dependabot.yml | 12 + .../aicruit-admin/.github/workflows/ci.yml | 101 +++++ RoR_App/aicruit-admin/.gitignore | 34 ++ .../.kamal/hooks/docker-setup.sample | 3 + .../.kamal/hooks/post-deploy.sample | 14 + .../.kamal/hooks/post-proxy-reboot.sample | 3 + .../.kamal/hooks/pre-build.sample | 51 +++ .../.kamal/hooks/pre-connect.sample | 47 ++ .../.kamal/hooks/pre-deploy.sample | 109 +++++ .../.kamal/hooks/pre-proxy-reboot.sample | 3 + RoR_App/aicruit-admin/.kamal/secrets | 17 + RoR_App/aicruit-admin/.rspec | 1 + RoR_App/aicruit-admin/.rubocop.yml | 8 + RoR_App/aicruit-admin/.ruby-version | 1 + RoR_App/aicruit-admin/Dockerfile | 72 +++ RoR_App/aicruit-admin/Gemfile | 72 +++ RoR_App/aicruit-admin/Gemfile.lock | 420 ++++++++++++++++++ RoR_App/aicruit-admin/README.md | 24 + RoR_App/aicruit-admin/Rakefile | 6 + RoR_App/aicruit-admin/app/assets/images/.keep | 0 .../app/assets/images/Josh_B_logo_1.png | Bin 0 -> 1884 bytes .../app/assets/images/edit-text.png | Bin 0 -> 10038 bytes .../aicruit-admin/app/assets/images/eye_1.png | Bin 0 -> 647 bytes .../app/assets/images/trash_1.png | Bin 0 -> 401 bytes .../app/assets/stylesheets/application.css | 51 +++ .../controllers/admin/dashboard_controller.rb | 19 + .../app/controllers/application_controller.rb | 20 + .../app/controllers/companies_controller.rb | 68 +++ .../app/controllers/concerns/.keep | 0 .../app/controllers/jds_controller.rb | 66 +++ .../app/controllers/users_controller.rb | 57 +++ .../app/helpers/application_helper.rb | 2 + .../app/javascript/application.js | 3 + .../app/javascript/controllers/application.js | 16 + .../controllers/hello_controller.js | 7 + .../app/javascript/controllers/index.js | 4 + .../aicruit-admin/app/jobs/application_job.rb | 7 + .../app/mailers/application_mailer.rb | 4 + RoR_App/aicruit-admin/app/models/ability.rb | 18 + .../app/models/application_record.rb | 3 + RoR_App/aicruit-admin/app/models/company.rb | 4 + .../aicruit-admin/app/models/concerns/.keep | 0 RoR_App/aicruit-admin/app/models/jd.rb | 16 + RoR_App/aicruit-admin/app/models/resume.rb | 14 + .../app/models/resume_analysis.rb | 11 + RoR_App/aicruit-admin/app/models/role.rb | 3 + RoR_App/aicruit-admin/app/models/user.rb | 26 ++ .../app/views/admin/dashboard/index.html.erb | 62 +++ .../app/views/company/_form.html.erb | 0 .../app/views/company/_show.html.erb | 0 .../views/devise/confirmations/new.html.erb | 16 + .../mailer/confirmation_instructions.html.erb | 5 + .../devise/mailer/email_changed.html.erb | 7 + .../devise/mailer/password_change.html.erb | 3 + .../reset_password_instructions.html.erb | 8 + .../mailer/unlock_instructions.html.erb | 7 + .../app/views/devise/passwords/edit.html.erb | 25 ++ .../app/views/devise/passwords/new.html.erb | 16 + .../views/devise/registrations/edit.html.erb | 43 ++ .../views/devise/registrations/new.html.erb | 54 +++ .../app/views/devise/sessions/new.html.erb | 36 ++ .../devise/shared/_error_messages.html.erb | 15 + .../app/views/devise/shared/_links.html.erb | 25 ++ .../app/views/devise/unlocks/new.html.erb | 16 + .../app/views/layouts/application.html.erb | 99 +++++ .../app/views/layouts/mailer.html.erb | 13 + .../app/views/layouts/mailer.text.erb | 1 + .../app/views/pwa/manifest.json.erb | 22 + .../app/views/pwa/service-worker.js | 26 ++ .../app/views/user/_form.html.erb | 40 ++ .../app/views/user/_show.html.erb | 14 + RoR_App/aicruit-admin/bin/brakeman | 7 + RoR_App/aicruit-admin/bin/bundle | 109 +++++ RoR_App/aicruit-admin/bin/dev | 2 + RoR_App/aicruit-admin/bin/docker-entrypoint | 14 + RoR_App/aicruit-admin/bin/importmap | 4 + RoR_App/aicruit-admin/bin/jobs | 6 + RoR_App/aicruit-admin/bin/kamal | 27 ++ RoR_App/aicruit-admin/bin/rails | 4 + RoR_App/aicruit-admin/bin/rake | 4 + RoR_App/aicruit-admin/bin/rubocop | 8 + RoR_App/aicruit-admin/bin/setup | 34 ++ RoR_App/aicruit-admin/bin/thrust | 5 + RoR_App/aicruit-admin/config.ru | 6 + RoR_App/aicruit-admin/config/application.rb | 28 ++ RoR_App/aicruit-admin/config/boot.rb | 4 + RoR_App/aicruit-admin/config/cable.yml | 17 + RoR_App/aicruit-admin/config/cache.yml | 16 + .../aicruit-admin/config/credentials.yml.enc | 1 + RoR_App/aicruit-admin/config/database.yml | 103 +++++ RoR_App/aicruit-admin/config/deploy.yml | 116 +++++ RoR_App/aicruit-admin/config/environment.rb | 5 + .../config/environments/development.rb | 72 +++ .../config/environments/production.rb | 90 ++++ .../aicruit-admin/config/environments/test.rb | 53 +++ RoR_App/aicruit-admin/config/importmap.rb | 7 + .../config/initializers/assets.rb | 7 + .../initializers/content_security_policy.rb | 25 ++ .../config/initializers/devise.rb | 313 +++++++++++++ .../initializers/filter_parameter_logging.rb | 8 + .../config/initializers/inflections.rb | 16 + .../config/locales/devise.en.yml | 65 +++ RoR_App/aicruit-admin/config/locales/en.yml | 31 ++ RoR_App/aicruit-admin/config/puma.rb | 41 ++ RoR_App/aicruit-admin/config/queue.yml | 18 + RoR_App/aicruit-admin/config/recurring.yml | 10 + RoR_App/aicruit-admin/config/routes.rb | 40 ++ RoR_App/aicruit-admin/config/storage.yml | 34 ++ RoR_App/aicruit-admin/db/cable_schema.rb | 11 + RoR_App/aicruit-admin/db/cache_schema.rb | 14 + .../db/migrate/20250115103535_create_roles.rb | 9 + .../20250115103550_create_companies.rb | 9 + .../20250115105900_devise_create_users.rb | 51 +++ .../db/migrate/20250117055334_create_jds.rb | 19 + .../migrate/20250117062052_create_resumes.rb | 24 + .../20250120054233_create_resume_analyses.rb | 18 + RoR_App/aicruit-admin/db/queue_schema.rb | 129 ++++++ RoR_App/aicruit-admin/db/schema.rb | 94 ++++ RoR_App/aicruit-admin/db/seeds.rb | 9 + RoR_App/aicruit-admin/lib/tasks/.keep | 0 RoR_App/aicruit-admin/log/.keep | 0 RoR_App/aicruit-admin/public/400.html | 114 +++++ RoR_App/aicruit-admin/public/404.html | 114 +++++ .../public/406-unsupported-browser.html | 114 +++++ RoR_App/aicruit-admin/public/422.html | 114 +++++ RoR_App/aicruit-admin/public/500.html | 114 +++++ RoR_App/aicruit-admin/public/icon.png | Bin 0 -> 4166 bytes RoR_App/aicruit-admin/public/icon.svg | 3 + RoR_App/aicruit-admin/public/robots.txt | 1 + RoR_App/aicruit-admin/script/.keep | 0 .../spec/models/resume_analysis_spec.rb | 5 + RoR_App/aicruit-admin/spec/rails_helper.rb | 70 +++ RoR_App/aicruit-admin/spec/spec_helper.rb | 94 ++++ RoR_App/aicruit-admin/storage/.keep | 0 .../test/application_system_test_case.rb | 5 + RoR_App/aicruit-admin/test/controllers/.keep | 0 .../aicruit-admin/test/fixtures/files/.keep | 0 RoR_App/aicruit-admin/test/fixtures/jds.yml | 17 + .../aicruit-admin/test/fixtures/resumes.yml | 27 ++ RoR_App/aicruit-admin/test/fixtures/users.yml | 11 + RoR_App/aicruit-admin/test/helpers/.keep | 0 RoR_App/aicruit-admin/test/integration/.keep | 0 RoR_App/aicruit-admin/test/mailers/.keep | 0 RoR_App/aicruit-admin/test/models/.keep | 0 RoR_App/aicruit-admin/test/models/jd_test.rb | 7 + .../aicruit-admin/test/models/resume_test.rb | 7 + .../aicruit-admin/test/models/user_test.rb | 7 + RoR_App/aicruit-admin/test/system/.keep | 0 RoR_App/aicruit-admin/test/test_helper.rb | 15 + RoR_App/aicruit-admin/tmp/.keep | 0 RoR_App/aicruit-admin/tmp/pids/.keep | 0 RoR_App/aicruit-admin/tmp/storage/.keep | 0 RoR_App/aicruit-admin/vendor/.keep | 0 RoR_App/aicruit-admin/vendor/javascript/.keep | 0 156 files changed, 4606 insertions(+) create mode 100644 RoR_App/aicruit-admin/.dockerignore create mode 100644 RoR_App/aicruit-admin/.gitattributes create mode 100644 RoR_App/aicruit-admin/.github/dependabot.yml create mode 100644 RoR_App/aicruit-admin/.github/workflows/ci.yml create mode 100644 RoR_App/aicruit-admin/.gitignore create mode 100755 RoR_App/aicruit-admin/.kamal/hooks/docker-setup.sample create mode 100755 RoR_App/aicruit-admin/.kamal/hooks/post-deploy.sample create mode 100755 RoR_App/aicruit-admin/.kamal/hooks/post-proxy-reboot.sample create mode 100755 RoR_App/aicruit-admin/.kamal/hooks/pre-build.sample create mode 100755 RoR_App/aicruit-admin/.kamal/hooks/pre-connect.sample create mode 100755 RoR_App/aicruit-admin/.kamal/hooks/pre-deploy.sample create mode 100755 RoR_App/aicruit-admin/.kamal/hooks/pre-proxy-reboot.sample create mode 100644 RoR_App/aicruit-admin/.kamal/secrets create mode 100644 RoR_App/aicruit-admin/.rspec create mode 100644 RoR_App/aicruit-admin/.rubocop.yml create mode 100644 RoR_App/aicruit-admin/.ruby-version create mode 100644 RoR_App/aicruit-admin/Dockerfile create mode 100644 RoR_App/aicruit-admin/Gemfile create mode 100644 RoR_App/aicruit-admin/Gemfile.lock create mode 100644 RoR_App/aicruit-admin/README.md create mode 100644 RoR_App/aicruit-admin/Rakefile create mode 100644 RoR_App/aicruit-admin/app/assets/images/.keep create mode 100644 RoR_App/aicruit-admin/app/assets/images/Josh_B_logo_1.png create mode 100644 RoR_App/aicruit-admin/app/assets/images/edit-text.png create mode 100644 RoR_App/aicruit-admin/app/assets/images/eye_1.png create mode 100644 RoR_App/aicruit-admin/app/assets/images/trash_1.png create mode 100644 RoR_App/aicruit-admin/app/assets/stylesheets/application.css create mode 100644 RoR_App/aicruit-admin/app/controllers/admin/dashboard_controller.rb create mode 100644 RoR_App/aicruit-admin/app/controllers/application_controller.rb create mode 100644 RoR_App/aicruit-admin/app/controllers/companies_controller.rb create mode 100644 RoR_App/aicruit-admin/app/controllers/concerns/.keep create mode 100644 RoR_App/aicruit-admin/app/controllers/jds_controller.rb create mode 100644 RoR_App/aicruit-admin/app/controllers/users_controller.rb create mode 100644 RoR_App/aicruit-admin/app/helpers/application_helper.rb create mode 100644 RoR_App/aicruit-admin/app/javascript/application.js create mode 100644 RoR_App/aicruit-admin/app/javascript/controllers/application.js create mode 100644 RoR_App/aicruit-admin/app/javascript/controllers/hello_controller.js create mode 100644 RoR_App/aicruit-admin/app/javascript/controllers/index.js create mode 100644 RoR_App/aicruit-admin/app/jobs/application_job.rb create mode 100644 RoR_App/aicruit-admin/app/mailers/application_mailer.rb create mode 100644 RoR_App/aicruit-admin/app/models/ability.rb create mode 100644 RoR_App/aicruit-admin/app/models/application_record.rb create mode 100644 RoR_App/aicruit-admin/app/models/company.rb create mode 100644 RoR_App/aicruit-admin/app/models/concerns/.keep create mode 100644 RoR_App/aicruit-admin/app/models/jd.rb create mode 100644 RoR_App/aicruit-admin/app/models/resume.rb create mode 100644 RoR_App/aicruit-admin/app/models/resume_analysis.rb create mode 100644 RoR_App/aicruit-admin/app/models/role.rb create mode 100644 RoR_App/aicruit-admin/app/models/user.rb create mode 100644 RoR_App/aicruit-admin/app/views/admin/dashboard/index.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/company/_form.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/company/_show.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/devise/confirmations/new.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/devise/mailer/confirmation_instructions.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/devise/mailer/email_changed.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/devise/mailer/password_change.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/devise/mailer/reset_password_instructions.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/devise/mailer/unlock_instructions.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/devise/passwords/edit.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/devise/passwords/new.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/devise/registrations/edit.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/devise/registrations/new.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/devise/sessions/new.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/devise/shared/_error_messages.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/devise/shared/_links.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/devise/unlocks/new.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/layouts/application.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/layouts/mailer.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/layouts/mailer.text.erb create mode 100644 RoR_App/aicruit-admin/app/views/pwa/manifest.json.erb create mode 100644 RoR_App/aicruit-admin/app/views/pwa/service-worker.js create mode 100644 RoR_App/aicruit-admin/app/views/user/_form.html.erb create mode 100644 RoR_App/aicruit-admin/app/views/user/_show.html.erb create mode 100755 RoR_App/aicruit-admin/bin/brakeman create mode 100755 RoR_App/aicruit-admin/bin/bundle create mode 100755 RoR_App/aicruit-admin/bin/dev create mode 100755 RoR_App/aicruit-admin/bin/docker-entrypoint create mode 100755 RoR_App/aicruit-admin/bin/importmap create mode 100755 RoR_App/aicruit-admin/bin/jobs create mode 100755 RoR_App/aicruit-admin/bin/kamal create mode 100755 RoR_App/aicruit-admin/bin/rails create mode 100755 RoR_App/aicruit-admin/bin/rake create mode 100755 RoR_App/aicruit-admin/bin/rubocop create mode 100755 RoR_App/aicruit-admin/bin/setup create mode 100755 RoR_App/aicruit-admin/bin/thrust create mode 100644 RoR_App/aicruit-admin/config.ru create mode 100644 RoR_App/aicruit-admin/config/application.rb create mode 100644 RoR_App/aicruit-admin/config/boot.rb create mode 100644 RoR_App/aicruit-admin/config/cable.yml create mode 100644 RoR_App/aicruit-admin/config/cache.yml create mode 100644 RoR_App/aicruit-admin/config/credentials.yml.enc create mode 100644 RoR_App/aicruit-admin/config/database.yml create mode 100644 RoR_App/aicruit-admin/config/deploy.yml create mode 100644 RoR_App/aicruit-admin/config/environment.rb create mode 100644 RoR_App/aicruit-admin/config/environments/development.rb create mode 100644 RoR_App/aicruit-admin/config/environments/production.rb create mode 100644 RoR_App/aicruit-admin/config/environments/test.rb create mode 100644 RoR_App/aicruit-admin/config/importmap.rb create mode 100644 RoR_App/aicruit-admin/config/initializers/assets.rb create mode 100644 RoR_App/aicruit-admin/config/initializers/content_security_policy.rb create mode 100644 RoR_App/aicruit-admin/config/initializers/devise.rb create mode 100644 RoR_App/aicruit-admin/config/initializers/filter_parameter_logging.rb create mode 100644 RoR_App/aicruit-admin/config/initializers/inflections.rb create mode 100644 RoR_App/aicruit-admin/config/locales/devise.en.yml create mode 100644 RoR_App/aicruit-admin/config/locales/en.yml create mode 100644 RoR_App/aicruit-admin/config/puma.rb create mode 100644 RoR_App/aicruit-admin/config/queue.yml create mode 100644 RoR_App/aicruit-admin/config/recurring.yml create mode 100644 RoR_App/aicruit-admin/config/routes.rb create mode 100644 RoR_App/aicruit-admin/config/storage.yml create mode 100644 RoR_App/aicruit-admin/db/cable_schema.rb create mode 100644 RoR_App/aicruit-admin/db/cache_schema.rb create mode 100644 RoR_App/aicruit-admin/db/migrate/20250115103535_create_roles.rb create mode 100644 RoR_App/aicruit-admin/db/migrate/20250115103550_create_companies.rb create mode 100644 RoR_App/aicruit-admin/db/migrate/20250115105900_devise_create_users.rb create mode 100644 RoR_App/aicruit-admin/db/migrate/20250117055334_create_jds.rb create mode 100644 RoR_App/aicruit-admin/db/migrate/20250117062052_create_resumes.rb create mode 100644 RoR_App/aicruit-admin/db/migrate/20250120054233_create_resume_analyses.rb create mode 100644 RoR_App/aicruit-admin/db/queue_schema.rb create mode 100644 RoR_App/aicruit-admin/db/schema.rb create mode 100644 RoR_App/aicruit-admin/db/seeds.rb create mode 100644 RoR_App/aicruit-admin/lib/tasks/.keep create mode 100644 RoR_App/aicruit-admin/log/.keep create mode 100644 RoR_App/aicruit-admin/public/400.html create mode 100644 RoR_App/aicruit-admin/public/404.html create mode 100644 RoR_App/aicruit-admin/public/406-unsupported-browser.html create mode 100644 RoR_App/aicruit-admin/public/422.html create mode 100644 RoR_App/aicruit-admin/public/500.html create mode 100644 RoR_App/aicruit-admin/public/icon.png create mode 100644 RoR_App/aicruit-admin/public/icon.svg create mode 100644 RoR_App/aicruit-admin/public/robots.txt create mode 100644 RoR_App/aicruit-admin/script/.keep create mode 100644 RoR_App/aicruit-admin/spec/models/resume_analysis_spec.rb create mode 100644 RoR_App/aicruit-admin/spec/rails_helper.rb create mode 100644 RoR_App/aicruit-admin/spec/spec_helper.rb create mode 100644 RoR_App/aicruit-admin/storage/.keep create mode 100644 RoR_App/aicruit-admin/test/application_system_test_case.rb create mode 100644 RoR_App/aicruit-admin/test/controllers/.keep create mode 100644 RoR_App/aicruit-admin/test/fixtures/files/.keep create mode 100644 RoR_App/aicruit-admin/test/fixtures/jds.yml create mode 100644 RoR_App/aicruit-admin/test/fixtures/resumes.yml create mode 100644 RoR_App/aicruit-admin/test/fixtures/users.yml create mode 100644 RoR_App/aicruit-admin/test/helpers/.keep create mode 100644 RoR_App/aicruit-admin/test/integration/.keep create mode 100644 RoR_App/aicruit-admin/test/mailers/.keep create mode 100644 RoR_App/aicruit-admin/test/models/.keep create mode 100644 RoR_App/aicruit-admin/test/models/jd_test.rb create mode 100644 RoR_App/aicruit-admin/test/models/resume_test.rb create mode 100644 RoR_App/aicruit-admin/test/models/user_test.rb create mode 100644 RoR_App/aicruit-admin/test/system/.keep create mode 100644 RoR_App/aicruit-admin/test/test_helper.rb create mode 100644 RoR_App/aicruit-admin/tmp/.keep create mode 100644 RoR_App/aicruit-admin/tmp/pids/.keep create mode 100644 RoR_App/aicruit-admin/tmp/storage/.keep create mode 100644 RoR_App/aicruit-admin/vendor/.keep create mode 100644 RoR_App/aicruit-admin/vendor/javascript/.keep diff --git a/RoR_App/aicruit-admin/.dockerignore b/RoR_App/aicruit-admin/.dockerignore new file mode 100644 index 0000000..325bfc0 --- /dev/null +++ b/RoR_App/aicruit-admin/.dockerignore @@ -0,0 +1,51 @@ +# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files. + +# Ignore git directory. +/.git/ +/.gitignore + +# Ignore bundler config. +/.bundle + +# Ignore all environment files. +/.env* + +# Ignore all default key files. +/config/master.key +/config/credentials/*.key + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore pidfiles, but keep the directory. +/tmp/pids/* +!/tmp/pids/.keep + +# Ignore storage (uploaded files in development and any SQLite databases). +/storage/* +!/storage/.keep +/tmp/storage/* +!/tmp/storage/.keep + +# Ignore assets. +/node_modules/ +/app/assets/builds/* +!/app/assets/builds/.keep +/public/assets + +# Ignore CI service files. +/.github + +# Ignore Kamal files. +/config/deploy*.yml +/.kamal + +# Ignore development files +/.devcontainer + +# Ignore Docker-related files +/.dockerignore +/Dockerfile* diff --git a/RoR_App/aicruit-admin/.gitattributes b/RoR_App/aicruit-admin/.gitattributes new file mode 100644 index 0000000..8dc4323 --- /dev/null +++ b/RoR_App/aicruit-admin/.gitattributes @@ -0,0 +1,9 @@ +# See https://git-scm.com/docs/gitattributes for more about git attribute files. + +# Mark the database schema as having been generated. +db/schema.rb linguist-generated + +# Mark any vendored files as having been vendored. +vendor/* linguist-vendored +config/credentials/*.yml.enc diff=rails_credentials +config/credentials.yml.enc diff=rails_credentials diff --git a/RoR_App/aicruit-admin/.github/dependabot.yml b/RoR_App/aicruit-admin/.github/dependabot.yml new file mode 100644 index 0000000..f0527e6 --- /dev/null +++ b/RoR_App/aicruit-admin/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: +- package-ecosystem: bundler + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 diff --git a/RoR_App/aicruit-admin/.github/workflows/ci.yml b/RoR_App/aicruit-admin/.github/workflows/ci.yml new file mode 100644 index 0000000..ed3ce78 --- /dev/null +++ b/RoR_App/aicruit-admin/.github/workflows/ci.yml @@ -0,0 +1,101 @@ +name: CI + +on: + pull_request: + push: + branches: [ main ] + +jobs: + scan_ruby: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Scan for common Rails security vulnerabilities using static analysis + run: bin/brakeman --no-pager + + scan_js: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Scan for security vulnerabilities in JavaScript dependencies + run: bin/importmap audit + + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Lint code for consistent style + run: bin/rubocop -f github + + test: + runs-on: ubuntu-latest + + services: + postgres: + image: postgres + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + ports: + - 5432:5432 + options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3 + + # redis: + # image: redis + # ports: + # - 6379:6379 + # options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 + + steps: + - name: Install packages + run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git libpq-dev pkg-config google-chrome-stable + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Run tests + env: + RAILS_ENV: test + DATABASE_URL: postgres://postgres:postgres@localhost:5432 + # REDIS_URL: redis://localhost:6379/0 + run: bin/rails db:test:prepare test test:system + + - name: Keep screenshots from failed system tests + uses: actions/upload-artifact@v4 + if: failure() + with: + name: screenshots + path: ${{ github.workspace }}/tmp/screenshots + if-no-files-found: ignore diff --git a/RoR_App/aicruit-admin/.gitignore b/RoR_App/aicruit-admin/.gitignore new file mode 100644 index 0000000..f92525c --- /dev/null +++ b/RoR_App/aicruit-admin/.gitignore @@ -0,0 +1,34 @@ +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# Temporary files generated by your text editor or operating system +# belong in git's global ignore instead: +# `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore` + +# Ignore bundler config. +/.bundle + +# Ignore all environment files. +/.env* + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore pidfiles, but keep the directory. +/tmp/pids/* +!/tmp/pids/ +!/tmp/pids/.keep + +# Ignore storage (uploaded files in development and any SQLite databases). +/storage/* +!/storage/.keep +/tmp/storage/* +!/tmp/storage/ +!/tmp/storage/.keep + +/public/assets + +# Ignore master key for decrypting credentials and more. +/config/master.key diff --git a/RoR_App/aicruit-admin/.kamal/hooks/docker-setup.sample b/RoR_App/aicruit-admin/.kamal/hooks/docker-setup.sample new file mode 100755 index 0000000..2fb07d7 --- /dev/null +++ b/RoR_App/aicruit-admin/.kamal/hooks/docker-setup.sample @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Docker set up on $KAMAL_HOSTS..." diff --git a/RoR_App/aicruit-admin/.kamal/hooks/post-deploy.sample b/RoR_App/aicruit-admin/.kamal/hooks/post-deploy.sample new file mode 100755 index 0000000..75efafc --- /dev/null +++ b/RoR_App/aicruit-admin/.kamal/hooks/post-deploy.sample @@ -0,0 +1,14 @@ +#!/bin/sh + +# A sample post-deploy hook +# +# These environment variables are available: +# KAMAL_RECORDED_AT +# KAMAL_PERFORMER +# KAMAL_VERSION +# KAMAL_HOSTS +# KAMAL_ROLE (if set) +# KAMAL_DESTINATION (if set) +# KAMAL_RUNTIME + +echo "$KAMAL_PERFORMER deployed $KAMAL_VERSION to $KAMAL_DESTINATION in $KAMAL_RUNTIME seconds" diff --git a/RoR_App/aicruit-admin/.kamal/hooks/post-proxy-reboot.sample b/RoR_App/aicruit-admin/.kamal/hooks/post-proxy-reboot.sample new file mode 100755 index 0000000..1435a67 --- /dev/null +++ b/RoR_App/aicruit-admin/.kamal/hooks/post-proxy-reboot.sample @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Rebooted kamal-proxy on $KAMAL_HOSTS" diff --git a/RoR_App/aicruit-admin/.kamal/hooks/pre-build.sample b/RoR_App/aicruit-admin/.kamal/hooks/pre-build.sample new file mode 100755 index 0000000..f87d811 --- /dev/null +++ b/RoR_App/aicruit-admin/.kamal/hooks/pre-build.sample @@ -0,0 +1,51 @@ +#!/bin/sh + +# A sample pre-build hook +# +# Checks: +# 1. We have a clean checkout +# 2. A remote is configured +# 3. The branch has been pushed to the remote +# 4. The version we are deploying matches the remote +# +# These environment variables are available: +# KAMAL_RECORDED_AT +# KAMAL_PERFORMER +# KAMAL_VERSION +# KAMAL_HOSTS +# KAMAL_ROLE (if set) +# KAMAL_DESTINATION (if set) + +if [ -n "$(git status --porcelain)" ]; then + echo "Git checkout is not clean, aborting..." >&2 + git status --porcelain >&2 + exit 1 +fi + +first_remote=$(git remote) + +if [ -z "$first_remote" ]; then + echo "No git remote set, aborting..." >&2 + exit 1 +fi + +current_branch=$(git branch --show-current) + +if [ -z "$current_branch" ]; then + echo "Not on a git branch, aborting..." >&2 + exit 1 +fi + +remote_head=$(git ls-remote $first_remote --tags $current_branch | cut -f1) + +if [ -z "$remote_head" ]; then + echo "Branch not pushed to remote, aborting..." >&2 + exit 1 +fi + +if [ "$KAMAL_VERSION" != "$remote_head" ]; then + echo "Version ($KAMAL_VERSION) does not match remote HEAD ($remote_head), aborting..." >&2 + exit 1 +fi + +exit 0 diff --git a/RoR_App/aicruit-admin/.kamal/hooks/pre-connect.sample b/RoR_App/aicruit-admin/.kamal/hooks/pre-connect.sample new file mode 100755 index 0000000..18e61d7 --- /dev/null +++ b/RoR_App/aicruit-admin/.kamal/hooks/pre-connect.sample @@ -0,0 +1,47 @@ +#!/usr/bin/env ruby + +# A sample pre-connect check +# +# Warms DNS before connecting to hosts in parallel +# +# These environment variables are available: +# KAMAL_RECORDED_AT +# KAMAL_PERFORMER +# KAMAL_VERSION +# KAMAL_HOSTS +# KAMAL_ROLE (if set) +# KAMAL_DESTINATION (if set) +# KAMAL_RUNTIME + +hosts = ENV["KAMAL_HOSTS"].split(",") +results = nil +max = 3 + +elapsed = Benchmark.realtime do + results = hosts.map do |host| + Thread.new do + tries = 1 + + begin + Socket.getaddrinfo(host, 0, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) + rescue SocketError + if tries < max + puts "Retrying DNS warmup: #{host}" + tries += 1 + sleep rand + retry + else + puts "DNS warmup failed: #{host}" + host + end + end + + tries + end + end.map(&:value) +end + +retries = results.sum - hosts.size +nopes = results.count { |r| r == max } + +puts "Prewarmed %d DNS lookups in %.2f sec: %d retries, %d failures" % [ hosts.size, elapsed, retries, nopes ] diff --git a/RoR_App/aicruit-admin/.kamal/hooks/pre-deploy.sample b/RoR_App/aicruit-admin/.kamal/hooks/pre-deploy.sample new file mode 100755 index 0000000..1b280c7 --- /dev/null +++ b/RoR_App/aicruit-admin/.kamal/hooks/pre-deploy.sample @@ -0,0 +1,109 @@ +#!/usr/bin/env ruby + +# A sample pre-deploy hook +# +# Checks the Github status of the build, waiting for a pending build to complete for up to 720 seconds. +# +# Fails unless the combined status is "success" +# +# These environment variables are available: +# KAMAL_RECORDED_AT +# KAMAL_PERFORMER +# KAMAL_VERSION +# KAMAL_HOSTS +# KAMAL_COMMAND +# KAMAL_SUBCOMMAND +# KAMAL_ROLE (if set) +# KAMAL_DESTINATION (if set) + +# Only check the build status for production deployments +if ENV["KAMAL_COMMAND"] == "rollback" || ENV["KAMAL_DESTINATION"] != "production" + exit 0 +end + +require "bundler/inline" + +# true = install gems so this is fast on repeat invocations +gemfile(true, quiet: true) do + source "https://rubygems.org" + + gem "octokit" + gem "faraday-retry" +end + +MAX_ATTEMPTS = 72 +ATTEMPTS_GAP = 10 + +def exit_with_error(message) + $stderr.puts message + exit 1 +end + +class GithubStatusChecks + attr_reader :remote_url, :git_sha, :github_client, :combined_status + + def initialize + @remote_url = `git config --get remote.origin.url`.strip.delete_prefix("https://github.com/") + @git_sha = `git rev-parse HEAD`.strip + @github_client = Octokit::Client.new(access_token: ENV["GITHUB_TOKEN"]) + refresh! + end + + def refresh! + @combined_status = github_client.combined_status(remote_url, git_sha) + end + + def state + combined_status[:state] + end + + def first_status_url + first_status = combined_status[:statuses].find { |status| status[:state] == state } + first_status && first_status[:target_url] + end + + def complete_count + combined_status[:statuses].count { |status| status[:state] != "pending"} + end + + def total_count + combined_status[:statuses].count + end + + def current_status + if total_count > 0 + "Completed #{complete_count}/#{total_count} checks, see #{first_status_url} ..." + else + "Build not started..." + end + end +end + + +$stdout.sync = true + +puts "Checking build status..." +attempts = 0 +checks = GithubStatusChecks.new + +begin + loop do + case checks.state + when "success" + puts "Checks passed, see #{checks.first_status_url}" + exit 0 + when "failure" + exit_with_error "Checks failed, see #{checks.first_status_url}" + when "pending" + attempts += 1 + end + + exit_with_error "Checks are still pending, gave up after #{MAX_ATTEMPTS * ATTEMPTS_GAP} seconds" if attempts == MAX_ATTEMPTS + + puts checks.current_status + sleep(ATTEMPTS_GAP) + checks.refresh! + end +rescue Octokit::NotFound + exit_with_error "Build status could not be found" +end diff --git a/RoR_App/aicruit-admin/.kamal/hooks/pre-proxy-reboot.sample b/RoR_App/aicruit-admin/.kamal/hooks/pre-proxy-reboot.sample new file mode 100755 index 0000000..061f805 --- /dev/null +++ b/RoR_App/aicruit-admin/.kamal/hooks/pre-proxy-reboot.sample @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Rebooting kamal-proxy on $KAMAL_HOSTS..." diff --git a/RoR_App/aicruit-admin/.kamal/secrets b/RoR_App/aicruit-admin/.kamal/secrets new file mode 100644 index 0000000..9a771a3 --- /dev/null +++ b/RoR_App/aicruit-admin/.kamal/secrets @@ -0,0 +1,17 @@ +# Secrets defined here are available for reference under registry/password, env/secret, builder/secrets, +# and accessories/*/env/secret in config/deploy.yml. All secrets should be pulled from either +# password manager, ENV, or a file. DO NOT ENTER RAW CREDENTIALS HERE! This file needs to be safe for git. + +# Example of extracting secrets from 1password (or another compatible pw manager) +# SECRETS=$(kamal secrets fetch --adapter 1password --account your-account --from Vault/Item KAMAL_REGISTRY_PASSWORD RAILS_MASTER_KEY) +# KAMAL_REGISTRY_PASSWORD=$(kamal secrets extract KAMAL_REGISTRY_PASSWORD ${SECRETS}) +# RAILS_MASTER_KEY=$(kamal secrets extract RAILS_MASTER_KEY ${SECRETS}) + +# Use a GITHUB_TOKEN if private repositories are needed for the image +# GITHUB_TOKEN=$(gh config get -h github.com oauth_token) + +# Grab the registry password from ENV +KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD + +# Improve security by using a password manager. Never check config/master.key into git! +RAILS_MASTER_KEY=$(cat config/master.key) diff --git a/RoR_App/aicruit-admin/.rspec b/RoR_App/aicruit-admin/.rspec new file mode 100644 index 0000000..c99d2e7 --- /dev/null +++ b/RoR_App/aicruit-admin/.rspec @@ -0,0 +1 @@ +--require spec_helper diff --git a/RoR_App/aicruit-admin/.rubocop.yml b/RoR_App/aicruit-admin/.rubocop.yml new file mode 100644 index 0000000..f9d86d4 --- /dev/null +++ b/RoR_App/aicruit-admin/.rubocop.yml @@ -0,0 +1,8 @@ +# Omakase Ruby styling for Rails +inherit_gem: { rubocop-rails-omakase: rubocop.yml } + +# Overwrite or add rules to create your own house style +# +# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]` +# Layout/SpaceInsideArrayLiteralBrackets: +# Enabled: false diff --git a/RoR_App/aicruit-admin/.ruby-version b/RoR_App/aicruit-admin/.ruby-version new file mode 100644 index 0000000..be94e6f --- /dev/null +++ b/RoR_App/aicruit-admin/.ruby-version @@ -0,0 +1 @@ +3.2.2 diff --git a/RoR_App/aicruit-admin/Dockerfile b/RoR_App/aicruit-admin/Dockerfile new file mode 100644 index 0000000..af05086 --- /dev/null +++ b/RoR_App/aicruit-admin/Dockerfile @@ -0,0 +1,72 @@ +# syntax=docker/dockerfile:1 +# check=error=true + +# This Dockerfile is designed for production, not development. Use with Kamal or build'n'run by hand: +# docker build -t aicruit_admin . +# docker run -d -p 80:80 -e RAILS_MASTER_KEY= --name aicruit_admin aicruit_admin + +# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html + +# Make sure RUBY_VERSION matches the Ruby version in .ruby-version +ARG RUBY_VERSION=3.2.2 +FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base + +# Rails app lives here +WORKDIR /rails + +# Install base packages +RUN apt-get update -qq && \ + apt-get install --no-install-recommends -y curl libjemalloc2 libvips postgresql-client && \ + rm -rf /var/lib/apt/lists /var/cache/apt/archives + +# Set production environment +ENV RAILS_ENV="production" \ + BUNDLE_DEPLOYMENT="1" \ + BUNDLE_PATH="/usr/local/bundle" \ + BUNDLE_WITHOUT="development" + +# Throw-away build stage to reduce size of final image +FROM base AS build + +# Install packages needed to build gems +RUN apt-get update -qq && \ + apt-get install --no-install-recommends -y build-essential git libpq-dev pkg-config && \ + rm -rf /var/lib/apt/lists /var/cache/apt/archives + +# Install application gems +COPY Gemfile Gemfile.lock ./ +RUN bundle install && \ + rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \ + bundle exec bootsnap precompile --gemfile + +# Copy application code +COPY . . + +# Precompile bootsnap code for faster boot times +RUN bundle exec bootsnap precompile app/ lib/ + +# Precompiling assets for production without requiring secret RAILS_MASTER_KEY +RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile + + + + +# Final stage for app image +FROM base + +# Copy built artifacts: gems, application +COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}" +COPY --from=build /rails /rails + +# Run and own only the runtime files as a non-root user for security +RUN groupadd --system --gid 1000 rails && \ + useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash && \ + chown -R rails:rails db log storage tmp +USER 1000:1000 + +# Entrypoint prepares the database. +ENTRYPOINT ["/rails/bin/docker-entrypoint"] + +# Start server via Thruster by default, this can be overwritten at runtime +EXPOSE 80 +CMD ["./bin/thrust", "./bin/rails", "server"] diff --git a/RoR_App/aicruit-admin/Gemfile b/RoR_App/aicruit-admin/Gemfile new file mode 100644 index 0000000..6d6754f --- /dev/null +++ b/RoR_App/aicruit-admin/Gemfile @@ -0,0 +1,72 @@ +source "https://rubygems.org" + +# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" +gem "rails", "~> 8.0.1" +# The modern asset pipeline for Rails [https://github.com/rails/propshaft] +gem "propshaft" +# Use postgresql as the database for Active Record +gem "pg", "~> 1.1" +# Use the Puma web server [https://github.com/puma/puma] +gem "puma", ">= 5.0" +# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] +gem "importmap-rails" +# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] +gem "turbo-rails" +# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] +gem "stimulus-rails" +# Build JSON APIs with ease [https://github.com/rails/jbuilder] +gem "jbuilder" + +# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] +# gem "bcrypt", "~> 3.1.7" + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem "tzinfo-data", platforms: %i[ windows jruby ] + +# Use the database-backed adapters for Rails.cache, Active Job, and Action Cable +gem "solid_cache" +gem "solid_queue" +gem "solid_cable" + +# Reduces boot times through caching; required in config/boot.rb +gem "bootsnap", require: false + +# Deploy this application anywhere as a Docker container [https://kamal-deploy.org] +gem "kamal", require: false + +# Add HTTP asset caching/compression and X-Sendfile acceleration to Puma [https://github.com/basecamp/thruster/] +gem "thruster", require: false + +# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] +# gem "image_processing", "~> 1.2" + +group :development, :test do + # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem + gem "debug", platforms: %i[ mri windows ], require: "debug/prelude" + + # Static analysis for security vulnerabilities [https://brakemanscanner.org/] + gem "brakeman", require: false + + # Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/] + gem "rubocop-rails-omakase", require: false + + gem 'dotenv-rails', '~> 2.7' +end + +group :development do + # Use console on exceptions pages [https://github.com/rails/web-console] + gem "web-console" +end + +group :test do + # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] + gem "capybara" + gem "selenium-webdriver" +end + +gem 'devise', '~> 4.9' + +gem 'cancancan', '~> 3.0' + + +gem "rspec-rails", "~> 7.1" diff --git a/RoR_App/aicruit-admin/Gemfile.lock b/RoR_App/aicruit-admin/Gemfile.lock new file mode 100644 index 0000000..8d5d5c7 --- /dev/null +++ b/RoR_App/aicruit-admin/Gemfile.lock @@ -0,0 +1,420 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) + mail (>= 2.8.0) + actionmailer (8.0.1) + actionpack (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activesupport (= 8.0.1) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.0.1) + actionview (= 8.0.1) + activesupport (= 8.0.1) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (8.0.1) + actionpack (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (8.0.1) + activesupport (= 8.0.1) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (8.0.1) + activesupport (= 8.0.1) + globalid (>= 0.3.6) + activemodel (8.0.1) + activesupport (= 8.0.1) + activerecord (8.0.1) + activemodel (= 8.0.1) + activesupport (= 8.0.1) + timeout (>= 0.4.0) + activestorage (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activesupport (= 8.0.1) + marcel (~> 1.0) + activesupport (8.0.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + ast (2.4.2) + base64 (0.2.0) + bcrypt (3.1.20) + bcrypt_pbkdf (1.1.1) + bcrypt_pbkdf (1.1.1-arm64-darwin) + bcrypt_pbkdf (1.1.1-x86_64-darwin) + benchmark (0.4.0) + bigdecimal (3.1.9) + bindex (0.8.1) + bootsnap (1.18.4) + msgpack (~> 1.2) + brakeman (7.0.0) + racc + builder (3.3.0) + cancancan (3.6.1) + capybara (3.40.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + concurrent-ruby (1.3.4) + connection_pool (2.5.0) + crass (1.0.6) + date (3.4.1) + debug (1.10.0) + irb (~> 1.10) + reline (>= 0.3.8) + devise (4.9.4) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0) + responders + warden (~> 1.2.3) + diff-lcs (1.5.1) + dotenv (2.8.1) + dotenv-rails (2.8.1) + dotenv (= 2.8.1) + railties (>= 3.2) + drb (2.2.1) + ed25519 (1.3.0) + erubi (1.13.1) + et-orbi (1.2.11) + tzinfo + fugit (1.11.1) + et-orbi (~> 1, >= 1.2.11) + raabro (~> 1.4) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.6) + concurrent-ruby (~> 1.0) + importmap-rails (2.1.0) + actionpack (>= 6.0.0) + activesupport (>= 6.0.0) + railties (>= 6.0.0) + io-console (0.8.0) + irb (1.14.3) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jbuilder (2.13.0) + actionview (>= 5.0.0) + activesupport (>= 5.0.0) + json (2.9.1) + kamal (1.9.2) + activesupport (>= 7.0) + base64 (~> 0.2) + bcrypt_pbkdf (~> 1.0) + concurrent-ruby (~> 1.2) + dotenv (~> 2.8) + ed25519 (~> 1.2) + net-ssh (~> 7.0) + sshkit (>= 1.23.0, < 2.0) + thor (~> 1.2) + zeitwerk (~> 2.5) + language_server-protocol (3.17.0.3) + logger (1.6.5) + loofah (2.24.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.4) + matrix (0.4.2) + mini_mime (1.1.5) + minitest (5.25.4) + msgpack (1.7.5) + net-imap (0.5.5) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-scp (4.0.0) + net-ssh (>= 2.6.5, < 8.0.0) + net-sftp (4.0.0) + net-ssh (>= 5.0.0, < 8.0.0) + net-smtp (0.5.0) + net-protocol + net-ssh (7.3.0) + nio4r (2.7.4) + nokogiri (1.18.1-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.1-aarch64-linux-musl) + racc (~> 1.4) + nokogiri (1.18.1-arm-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.1-arm-linux-musl) + racc (~> 1.4) + nokogiri (1.18.1-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.1-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.18.1-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.1-x86_64-linux-musl) + racc (~> 1.4) + orm_adapter (0.5.0) + ostruct (0.6.1) + parallel (1.26.3) + parser (3.3.6.0) + ast (~> 2.4.1) + racc + pg (1.5.9) + propshaft (1.1.0) + actionpack (>= 7.0.0) + activesupport (>= 7.0.0) + rack + railties (>= 7.0.0) + psych (5.2.2) + date + stringio + public_suffix (6.0.1) + puma (6.5.0) + nio4r (~> 2.0) + raabro (1.4.0) + racc (1.8.1) + rack (3.1.8) + rack-session (2.1.0) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.2.1) + rack (>= 3) + rails (8.0.1) + actioncable (= 8.0.1) + actionmailbox (= 8.0.1) + actionmailer (= 8.0.1) + actionpack (= 8.0.1) + actiontext (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activemodel (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) + bundler (>= 1.15.0) + railties (= 8.0.1) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.2.1) + rdoc (6.10.0) + psych (>= 4.0.0) + regexp_parser (2.10.0) + reline (0.6.0) + io-console (~> 0.5) + responders (3.1.1) + actionpack (>= 5.2) + railties (>= 5.2) + rexml (3.4.0) + rspec-core (3.13.2) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-rails (7.1.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.2) + rubocop (1.70.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.36.2, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.37.0) + parser (>= 3.3.1.0) + rubocop-minitest (0.36.0) + rubocop (>= 1.61, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-performance (1.23.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.28.0) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.52.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails-omakase (1.0.0) + rubocop + rubocop-minitest + rubocop-performance + rubocop-rails + ruby-progressbar (1.13.0) + rubyzip (2.4.1) + securerandom (0.4.1) + selenium-webdriver (4.27.0) + base64 (~> 0.2) + logger (~> 1.4) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) + solid_cable (3.0.5) + actioncable (>= 7.2) + activejob (>= 7.2) + activerecord (>= 7.2) + railties (>= 7.2) + solid_cache (1.0.6) + activejob (>= 7.2) + activerecord (>= 7.2) + railties (>= 7.2) + solid_queue (1.1.2) + activejob (>= 7.1) + activerecord (>= 7.1) + concurrent-ruby (>= 1.3.1) + fugit (~> 1.11.0) + railties (>= 7.1) + thor (~> 1.3.1) + sshkit (1.23.2) + base64 + net-scp (>= 1.1.2) + net-sftp (>= 2.1.2) + net-ssh (>= 2.8.0) + ostruct + stimulus-rails (1.3.4) + railties (>= 6.0.0) + stringio (3.1.2) + thor (1.3.2) + thruster (0.1.10) + thruster (0.1.10-aarch64-linux) + thruster (0.1.10-arm64-darwin) + thruster (0.1.10-x86_64-darwin) + thruster (0.1.10-x86_64-linux) + timeout (0.4.3) + turbo-rails (2.0.11) + actionpack (>= 6.0.0) + railties (>= 6.0.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) + uri (1.0.2) + useragent (0.16.11) + warden (1.2.9) + rack (>= 2.0.9) + web-console (4.2.1) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) + bindex (>= 0.4.0) + railties (>= 6.0.0) + websocket (1.2.11) + websocket-driver (0.7.7) + base64 + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.7.1) + +PLATFORMS + aarch64-linux + aarch64-linux-gnu + aarch64-linux-musl + arm-linux-gnu + arm-linux-musl + arm64-darwin + x86_64-darwin + x86_64-linux + x86_64-linux-gnu + x86_64-linux-musl + +DEPENDENCIES + bootsnap + brakeman + cancancan (~> 3.0) + capybara + debug + devise (~> 4.9) + dotenv-rails (~> 2.7) + importmap-rails + jbuilder + kamal + pg (~> 1.1) + propshaft + puma (>= 5.0) + rails (~> 8.0.1) + rspec-rails (~> 7.1) + rubocop-rails-omakase + selenium-webdriver + solid_cable + solid_cache + solid_queue + stimulus-rails + thruster + turbo-rails + tzinfo-data + web-console + +BUNDLED WITH + 2.5.23 diff --git a/RoR_App/aicruit-admin/README.md b/RoR_App/aicruit-admin/README.md new file mode 100644 index 0000000..7db80e4 --- /dev/null +++ b/RoR_App/aicruit-admin/README.md @@ -0,0 +1,24 @@ +# README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... diff --git a/RoR_App/aicruit-admin/Rakefile b/RoR_App/aicruit-admin/Rakefile new file mode 100644 index 0000000..9a5ea73 --- /dev/null +++ b/RoR_App/aicruit-admin/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative "config/application" + +Rails.application.load_tasks diff --git a/RoR_App/aicruit-admin/app/assets/images/.keep b/RoR_App/aicruit-admin/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/app/assets/images/Josh_B_logo_1.png b/RoR_App/aicruit-admin/app/assets/images/Josh_B_logo_1.png new file mode 100644 index 0000000000000000000000000000000000000000..97533790f7addf575166098e8f2233029eb4490a GIT binary patch literal 1884 zcmV-i2c!6jP)@@f$^KouyUQ9+cFv=AUbiQoeXzW5^#K|u^c0u)7!wrETdA|^lr2!!%d zB*td~@@j#IZLt(9v_T4Jcob?Y&r;ehGoG_|hu%(SwuS7hi`g&vlDYSuojY^SJ?EZt zW(95o=zutwn(`4{zGEjN08P{N39Cx-4j+CHML9X}A&Q`I;Wj|gu;gUu`ix*Qy3jXm zI9|A4i$T`Ir5J-Knnc7azj)xl4w^2qAVf<$8G4D_;>z;5)xO%*)a*%~V&&9MNI?`q z5z)$LcVFwNn@g7u*b9mCWc6u#%TG+wa6{o<;*!Z7a3`X$MMNu~&iQeg5U&Lh@d;=% zmKEnE2!UC`fAj|+kmQQN+KKJa8c|pxVwImeI5|Prks+XaZH07vwYns4w{YQOYBjQQ zp<|Ti4va<=mWWv8$9gb^thuw@xUTDauhhDy)wm$w}}aibjZ7<$E-& zC#yedGknpfU7uG{adJ{OcYHCmf3lIQc4^35QGhx`(FhT%{9Zfr&ehcE!|4z|tM+p~ zPn%-eZ)ImYL)S9fdRt}2d0UOAp(CbS(5Zp9m!83oh{6&P9q=XZ$v>gHbT01bMxPFS zV}4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tRT$Z`^*gq6ICu&Ow-q+pgo_4!~!}`YHOuSJvS8!Yzu%f#swy)v;8g z2VnZ+La;2lpx<@%7A3KEP#(+)?D?SN$4^*kP2I!%juv9X2KB{%clNU>6{!>v)2}E6 z)glAi8+yiN&jd|b(&fG?@nU%j-aa?Xzc{90`F#&F2l2I7&gWt5>7^V-9M9xZwevA5y1%mEFXn)zfup zXcW=ZIaGzaNu$29+_&xXU|5~eDG4C2rFZT*#x1yP->KalDDHx8 zA5Z==`+}n7FQex_?#eEYIWPU$RW!-h2g NxFa^EFO1!z{}&JmkJbPH literal 0 HcmV?d00001 diff --git a/RoR_App/aicruit-admin/app/assets/images/eye_1.png b/RoR_App/aicruit-admin/app/assets/images/eye_1.png new file mode 100644 index 0000000000000000000000000000000000000000..0453358002a16a38847587dde839dcb5caddf19f GIT binary patch literal 647 zcmV;20(kw2P)200009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP618MB|cwTRIsLW}qMjp<=z35!nK)VHsEJesK3G-b>nZ zqX8-ynE=v75V<4RGh{dPDZ_KEgb=*z(3x$K>fTwFxZ1V*5m#?vgR5L8x0QA2E?Yz< zr-hmN66C$cT97N`VAxHH#1m&V0U)oK6DzsCbIvx1mAE&#LbY|SFhIhI*-gM%l~6jN zZwLwIsMM+X3h;ZK<+lQ(@l4h?Z6Ir6$mQYEBO!D((?#T-R{M71gjYalFILX`a;+2n z)-B?-b`{%mRwK6F5DEH%Yfc|!;g&T3#4bB=!SH8$kqkByswsk%Gv|T>ElcuYZQwBb zu4Qp`m&dF~fAw5oHm~AjC;H0P8?bj5H(_^*`200009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yPTya-$(c3=l+2c`nC0!uI*XbG50Ko8o1NeASTfQKEw=nH`?Avxrf z%zJy-`SU-s%g$%&2+tci&0LcB<8>Tv1A^egmU;1vlE6Uwb_uow)`R#?H~@K2hqJ1t-F+EWi*QY$UsVmT-$^Cx-_5omP${xLP00000NkvXXu0mjfx1^p2 literal 0 HcmV?d00001 diff --git a/RoR_App/aicruit-admin/app/assets/stylesheets/application.css b/RoR_App/aicruit-admin/app/assets/stylesheets/application.css new file mode 100644 index 0000000..d3905d0 --- /dev/null +++ b/RoR_App/aicruit-admin/app/assets/stylesheets/application.css @@ -0,0 +1,51 @@ +/* + * This is a manifest file that'll be compiled into application.css. + * + * With Propshaft, assets are served efficiently without preprocessing steps. You can still include + * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard + * cascading order, meaning styles declared later in the document or manifest will override earlier ones, + * depending on specificity. + * + * Consider organizing styles into separate files for maintainability. + */ + + + /* Frame 1 */ +.custom_head { +position: relative; +width: auto; +height: 76px; +left: 0px; +top: 0px; + +background: #ffffff; + +/* Center the text horizontally and vertically */ +display: flex; +align-items: center; /* Vertically center the text */ +justify-content: left; /* Horizontally center the text */ +padding: 0 20px; /* Optional: add horizontal padding if you need some space on the sides */ +} + +body{ + position: relative; + background: #fafafaaf; + +} + +.custom_div{ + display: flex; + flex-direction: column; + align-items: center; /* Vertically center the text */ + justify-content: center; /* Horizontally center the text */ + padding: 0 20px; /* Optional: add horizontal padding if you need some space on the sides */ +} + +.my-custom-btn { + text-align: center; + cursor: pointer; +} + + + + diff --git a/RoR_App/aicruit-admin/app/controllers/admin/dashboard_controller.rb b/RoR_App/aicruit-admin/app/controllers/admin/dashboard_controller.rb new file mode 100644 index 0000000..b7b5119 --- /dev/null +++ b/RoR_App/aicruit-admin/app/controllers/admin/dashboard_controller.rb @@ -0,0 +1,19 @@ +class Admin::DashboardController < ApplicationController + before_action :authenticate_user!, :check_admin + # load_and_authorize_resource + + def index + @users = User.all + # if @users.present? + # render json: @users.to_h, status: :ok + # else + # render json: {data: "No data"}, status: :unprocessable_entity + # end + end + + private + + def check_admin + redirect_to root_path, alert: 'Not authorized' unless current_user.admin? + end +end \ No newline at end of file diff --git a/RoR_App/aicruit-admin/app/controllers/application_controller.rb b/RoR_App/aicruit-admin/app/controllers/application_controller.rb new file mode 100644 index 0000000..10363f9 --- /dev/null +++ b/RoR_App/aicruit-admin/app/controllers/application_controller.rb @@ -0,0 +1,20 @@ +class ApplicationController < ActionController::Base + # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has. + allow_browser versions: :modern + + # require 'cancan/matchers' + + before_action :authenticate_user! + + + rescue_from CanCan::AccessDenied do |exception| + redirect_to root_url, alert: exception.message + end + + private + + def after_sign_in_path_for(resource) + flash[:notice] = "Welcome back, #{resource.email}!" + admin_dashboard_index_path # or any other path you'd like to redirect to after login + end +end diff --git a/RoR_App/aicruit-admin/app/controllers/companies_controller.rb b/RoR_App/aicruit-admin/app/controllers/companies_controller.rb new file mode 100644 index 0000000..2a199e9 --- /dev/null +++ b/RoR_App/aicruit-admin/app/controllers/companies_controller.rb @@ -0,0 +1,68 @@ +class CompaniesController < ApplicationController + before_action :authenticate_user!, :check_admin + load_and_authorize_resource + + def index + @companies = Company.all + render json: @companies, status: :ok + end + + def new + @company = Company.new + # No need to check for present? on a new record, just render a new empty object + render json: @company, status: :ok + end + + def create + @company = Company.new(company_params) + if @company.save + render json: @company, status: :created # HTTP status code 201 for created + else + render json: { data: "No data", errors: @company.errors.full_messages }, status: :unprocessable_entity + end + end + + def show + @company = Company.find_by(id: params[:id]) + if @company + render json: @company, status: :ok + else + render json: { data: "No data found" }, status: :not_found + end + end + + def edit + @company = Company.find_by(id: params[:id]) + if @company + render json: @company, status: :ok + else + render json: { data: "No data found" }, status: :not_found + end + end + + def update + @company = Company.find_by(id: params[:id]) + if @company&.update(company_params) + render json: @company, status: :ok + else + render json: { data: "No data found", errors: @company.errors.full_messages }, status: :not_found + end + end + + def delete + @company = Company.find_by(id: params[:id]) + if @company + @company.destroy + render json: { message: 'Company deleted successfully' }, status: :ok + else + render json: { data: "No data found" }, status: :not_found + end + end + + private + + # Ensure that the company_params method is defined correctly. + def company_params + params.require(:company).permit(:name, :address, :contact_email, :phone_number) + end +end diff --git a/RoR_App/aicruit-admin/app/controllers/concerns/.keep b/RoR_App/aicruit-admin/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/app/controllers/jds_controller.rb b/RoR_App/aicruit-admin/app/controllers/jds_controller.rb new file mode 100644 index 0000000..475095f --- /dev/null +++ b/RoR_App/aicruit-admin/app/controllers/jds_controller.rb @@ -0,0 +1,66 @@ +class JdsController < ApplicationController + before_action :authenticate_user! + load_and_authorize_resource + + def index + @jds = Jd.all + render json: @jds, status: :ok + end + + def show + @jd = Jd.find_by(id: params[:id]) + if @jd + render json: @jd, status: :ok + else + render json: { message: "No data found" }, status: :not_found + end + end + + def new + @jd = Jd.new + render json: @jd, status: :ok + end + + def create + @jd = Jd.new(jd_params) + if @jd.save + render json: @jd, status: :created # HTTP status code 201 for created + else + render json: { message: "Unable to create JD", errors: @jd.errors.full_messages }, status: :unprocessable_entity + end + end + + def edit + @jd = Jd.find_by(id: params[:id]) + if @jd + render json: @jd, status: :ok + else + render json: { message: "No data found" }, status: :not_found + end + end + + def update + @jd = Jd.find_by(id: params[:id]) + if @jd&.update(jd_params) + render json: @jd, status: :ok + else + render json: { message: "Unable to update JD", errors: @jd.errors.full_messages }, status: :not_found + end + end + + def destroy + @jd = Jd.find_by(id: params[:id]) + if @jd + @jd.destroy + render json: { message: 'JD deleted successfully' }, status: :ok + else + render json: { message: "No data found" }, status: :not_found + end + end + + private + + def jd_params + params.require(:jd).permit(:user_id, :company_id, :title, :link_to_file, :status, :parsed_data) + end +end diff --git a/RoR_App/aicruit-admin/app/controllers/users_controller.rb b/RoR_App/aicruit-admin/app/controllers/users_controller.rb new file mode 100644 index 0000000..a90aba9 --- /dev/null +++ b/RoR_App/aicruit-admin/app/controllers/users_controller.rb @@ -0,0 +1,57 @@ +class UsersController < ApplicationController + before_action :authenticate_user!, :check_admin + load_and_authorize_resource + + def new + @user = User.new + render 'user/_form' + end + + def create + @user = User.new(user_params) + if @user.save + redirect_to admin_dashboard_index_path, notice: 'Customer account created successfully' + else + render 'user/_form' # Render form for the same page to show errors + end + end + + def show + @user = User.find(params[:id]) + render 'user/_show', locals: { user: @user } # Instead of rendering a partial, render the full 'show' view + end + + def edit + @user = User.find(params[:id]) + render 'user/_form' # Use the same form for editing + end + + def update + @user = User.find(params[:id]) + if @user.update(user_params) + redirect_to admin_dashboard_index_path, notice: 'Profile updated successfully' + else + render 'user/_form' # Render form to show errors + end + end + + def destroy + @user = User.find(params[:id]) + if @user + @user.destroy + redirect_to admin_dashboard_index_path, notice: 'Customer account deleted successfully' + else + redirect_to aadmin_dashboard_index_path, alert: 'Customer not found' + end + end + + private + + def check_admin + redirect_to root_path, alert: 'Not authorized' unless current_user.admin? + end + + def user_params + params.require(:user).permit(:first_name, :last_name, :email, :password, :phone_number, :address, :role) + end +end diff --git a/RoR_App/aicruit-admin/app/helpers/application_helper.rb b/RoR_App/aicruit-admin/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/RoR_App/aicruit-admin/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/RoR_App/aicruit-admin/app/javascript/application.js b/RoR_App/aicruit-admin/app/javascript/application.js new file mode 100644 index 0000000..0d7b494 --- /dev/null +++ b/RoR_App/aicruit-admin/app/javascript/application.js @@ -0,0 +1,3 @@ +// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails +import "@hotwired/turbo-rails" +import "controllers" diff --git a/RoR_App/aicruit-admin/app/javascript/controllers/application.js b/RoR_App/aicruit-admin/app/javascript/controllers/application.js new file mode 100644 index 0000000..f4bb1aa --- /dev/null +++ b/RoR_App/aicruit-admin/app/javascript/controllers/application.js @@ -0,0 +1,16 @@ +import { Application } from "@hotwired/stimulus" + +import { Turbo } from "@hotwired/turbo-rails"; +import Rails from "@rails/ujs"; +Rails.start(); + + +const application = Application.start() + +// Configure Stimulus development experience +application.debug = false +window.Stimulus = application + +export { application } + + diff --git a/RoR_App/aicruit-admin/app/javascript/controllers/hello_controller.js b/RoR_App/aicruit-admin/app/javascript/controllers/hello_controller.js new file mode 100644 index 0000000..5975c07 --- /dev/null +++ b/RoR_App/aicruit-admin/app/javascript/controllers/hello_controller.js @@ -0,0 +1,7 @@ +import { Controller } from "@hotwired/stimulus" + +export default class extends Controller { + connect() { + this.element.textContent = "Hello World!" + } +} diff --git a/RoR_App/aicruit-admin/app/javascript/controllers/index.js b/RoR_App/aicruit-admin/app/javascript/controllers/index.js new file mode 100644 index 0000000..1156bf8 --- /dev/null +++ b/RoR_App/aicruit-admin/app/javascript/controllers/index.js @@ -0,0 +1,4 @@ +// Import and register all your controllers from the importmap via controllers/**/*_controller +import { application } from "controllers/application" +import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" +eagerLoadControllersFrom("controllers", application) diff --git a/RoR_App/aicruit-admin/app/jobs/application_job.rb b/RoR_App/aicruit-admin/app/jobs/application_job.rb new file mode 100644 index 0000000..d394c3d --- /dev/null +++ b/RoR_App/aicruit-admin/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/RoR_App/aicruit-admin/app/mailers/application_mailer.rb b/RoR_App/aicruit-admin/app/mailers/application_mailer.rb new file mode 100644 index 0000000..3c34c81 --- /dev/null +++ b/RoR_App/aicruit-admin/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: "from@example.com" + layout "mailer" +end diff --git a/RoR_App/aicruit-admin/app/models/ability.rb b/RoR_App/aicruit-admin/app/models/ability.rb new file mode 100644 index 0000000..d9317d7 --- /dev/null +++ b/RoR_App/aicruit-admin/app/models/ability.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class Ability + include CanCan::Ability + + def initialize(user) + + user ||= User.new + if user.role&.name == "super_admin" + can :manage, :all + elsif user.role&.name == "admin" + can :manage, User + can :manage, Company + elsif user.role&.name == "hr_admin" + can :read, :all + end + end +end diff --git a/RoR_App/aicruit-admin/app/models/application_record.rb b/RoR_App/aicruit-admin/app/models/application_record.rb new file mode 100644 index 0000000..b63caeb --- /dev/null +++ b/RoR_App/aicruit-admin/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + primary_abstract_class +end diff --git a/RoR_App/aicruit-admin/app/models/company.rb b/RoR_App/aicruit-admin/app/models/company.rb new file mode 100644 index 0000000..8a8efc5 --- /dev/null +++ b/RoR_App/aicruit-admin/app/models/company.rb @@ -0,0 +1,4 @@ +class Company < ApplicationRecord + has_many :users + # has_many :jds, foreign_key: 'company_id' +end \ No newline at end of file diff --git a/RoR_App/aicruit-admin/app/models/concerns/.keep b/RoR_App/aicruit-admin/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/app/models/jd.rb b/RoR_App/aicruit-admin/app/models/jd.rb new file mode 100644 index 0000000..a1b488c --- /dev/null +++ b/RoR_App/aicruit-admin/app/models/jd.rb @@ -0,0 +1,16 @@ +class Jd < ApplicationRecord + # Enum for the status field + enum status: { open: 'open', close: 'close' } + + # Associations + # belongs_to :user + # belongs_to :company + # has_many :resumes, foreign_key: 'jd_id' + + # Validations + validates :user_id, presence: true + validates :company_id, presence: true + validates :title, presence: true + validates :link_to_file, presence: true + validates :status, inclusion: { in: statuses.keys } +end diff --git a/RoR_App/aicruit-admin/app/models/resume.rb b/RoR_App/aicruit-admin/app/models/resume.rb new file mode 100644 index 0000000..eb586d5 --- /dev/null +++ b/RoR_App/aicruit-admin/app/models/resume.rb @@ -0,0 +1,14 @@ +class Resume < ApplicationRecord + # Associations + # belongs_to :jd + # belongs_to :uploaded_by_user, class_name: 'User', foreign_key: 'uploaded_by' + + # Validations + validates :jd_id, presence: true + validates :candidate_name, presence: true + validates :link_to_file, presence: true + validates :years_of_experience, numericality: { only_integer: true, greater_than_or_equal_to: 0 } + validates :primary_skills, presence: true + validates :secondary_skills, presence: true + +end diff --git a/RoR_App/aicruit-admin/app/models/resume_analysis.rb b/RoR_App/aicruit-admin/app/models/resume_analysis.rb new file mode 100644 index 0000000..92463d9 --- /dev/null +++ b/RoR_App/aicruit-admin/app/models/resume_analysis.rb @@ -0,0 +1,11 @@ +class ResumeAnalysis < ApplicationRecord + # Associations + belongs_to :job_description, foreign_key: :jd_id + belongs_to :resume + + # Validations (optional) + validates :ratings, presence: true + validates :matching_skills, presence: true + validates :missing_skills, presence: true + validates :additional_skills, presence: true +end diff --git a/RoR_App/aicruit-admin/app/models/role.rb b/RoR_App/aicruit-admin/app/models/role.rb new file mode 100644 index 0000000..07282bb --- /dev/null +++ b/RoR_App/aicruit-admin/app/models/role.rb @@ -0,0 +1,3 @@ +class Role < ApplicationRecord + has_many :users +end \ No newline at end of file diff --git a/RoR_App/aicruit-admin/app/models/user.rb b/RoR_App/aicruit-admin/app/models/user.rb new file mode 100644 index 0000000..6831c69 --- /dev/null +++ b/RoR_App/aicruit-admin/app/models/user.rb @@ -0,0 +1,26 @@ +class User < ApplicationRecord + # Include default devise modules. Others available are: + # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable + devise :database_authenticatable, :registerable, + :recoverable, :rememberable, :validatable + + belongs_to :company #, default: -> { Company.find_by(id: 1) } + belongs_to :role #, default: -> { Role.find_by(id: 1) } + # has_many :jds, foreign_key: 'user_id' + # has_many :resumes, foreign_key: 'uploaded_by' + + # Validations (optional) + validates :first_name, presence: true + validates :last_name, presence: true + validates :contact_number, presence: true, uniqueness: true + validates :email, presence: true, uniqueness: true + + # Optional: Define a custom admin? method + def admin? + role_id == 1 or role_id == 2 + end + + def customer? + role == 'customer' + end +end diff --git a/RoR_App/aicruit-admin/app/views/admin/dashboard/index.html.erb b/RoR_App/aicruit-admin/app/views/admin/dashboard/index.html.erb new file mode 100644 index 0000000..fa127de --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/admin/dashboard/index.html.erb @@ -0,0 +1,62 @@ +

User List

+ + + + + + + + + + + + + <% if @users.any? %> + <% @users.each do |user| %> + + + + + + + + + + <% end %> + <% else %> +

No users found matching your search.

+ <% end %> + +
NameEmailContact NumberRoleAction
<%= user.first_name+' '+user.last_name %><%= user.email %><%= user.contact_number %><%= user.role.name %><%= link_to user_path(user), class: 'my-custom-btn' do %> + <%= image_tag 'eye_1.png', alt: 'Show', style: 'height: 20px; width: 20px;' %> + <% end %> + <%= link_to edit_user_path(user), class: 'my-custom-btn' do %> + <%= image_tag 'edit-text.png', alt: 'Edit', style: 'height: 20px; width: 20px;' %> + <% end %> + <%= button_to user_path(user), method: :delete, data: { confirm: 'Are you sure?' }, class: 'delete-button' do %> + <%= image_tag 'trash_1.png', alt: 'Delete', style: 'height: 20px; width: 20px;' %> + <% end %> +
+ + \ No newline at end of file diff --git a/RoR_App/aicruit-admin/app/views/company/_form.html.erb b/RoR_App/aicruit-admin/app/views/company/_form.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/app/views/company/_show.html.erb b/RoR_App/aicruit-admin/app/views/company/_show.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/app/views/devise/confirmations/new.html.erb b/RoR_App/aicruit-admin/app/views/devise/confirmations/new.html.erb new file mode 100644 index 0000000..b12dd0c --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/devise/confirmations/new.html.erb @@ -0,0 +1,16 @@ +

Resend confirmation instructions

+ +<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> + +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %> +
+ +
+ <%= f.submit "Resend confirmation instructions" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/RoR_App/aicruit-admin/app/views/devise/mailer/confirmation_instructions.html.erb b/RoR_App/aicruit-admin/app/views/devise/mailer/confirmation_instructions.html.erb new file mode 100644 index 0000000..dc55f64 --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/devise/mailer/confirmation_instructions.html.erb @@ -0,0 +1,5 @@ +

Welcome <%= @email %>!

+ +

You can confirm your account email through the link below:

+ +

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>

diff --git a/RoR_App/aicruit-admin/app/views/devise/mailer/email_changed.html.erb b/RoR_App/aicruit-admin/app/views/devise/mailer/email_changed.html.erb new file mode 100644 index 0000000..32f4ba8 --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/devise/mailer/email_changed.html.erb @@ -0,0 +1,7 @@ +

Hello <%= @email %>!

+ +<% if @resource.try(:unconfirmed_email?) %> +

We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.

+<% else %> +

We're contacting you to notify you that your email has been changed to <%= @resource.email %>.

+<% end %> diff --git a/RoR_App/aicruit-admin/app/views/devise/mailer/password_change.html.erb b/RoR_App/aicruit-admin/app/views/devise/mailer/password_change.html.erb new file mode 100644 index 0000000..b41daf4 --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/devise/mailer/password_change.html.erb @@ -0,0 +1,3 @@ +

Hello <%= @resource.email %>!

+ +

We're contacting you to notify you that your password has been changed.

diff --git a/RoR_App/aicruit-admin/app/views/devise/mailer/reset_password_instructions.html.erb b/RoR_App/aicruit-admin/app/views/devise/mailer/reset_password_instructions.html.erb new file mode 100644 index 0000000..f667dc1 --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/devise/mailer/reset_password_instructions.html.erb @@ -0,0 +1,8 @@ +

Hello <%= @resource.email %>!

+ +

Someone has requested a link to change your password. You can do this through the link below.

+ +

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>

+ +

If you didn't request this, please ignore this email.

+

Your password won't change until you access the link above and create a new one.

diff --git a/RoR_App/aicruit-admin/app/views/devise/mailer/unlock_instructions.html.erb b/RoR_App/aicruit-admin/app/views/devise/mailer/unlock_instructions.html.erb new file mode 100644 index 0000000..41e148b --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/devise/mailer/unlock_instructions.html.erb @@ -0,0 +1,7 @@ +

Hello <%= @resource.email %>!

+ +

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

+ +

Click the link below to unlock your account:

+ +

<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>

diff --git a/RoR_App/aicruit-admin/app/views/devise/passwords/edit.html.erb b/RoR_App/aicruit-admin/app/views/devise/passwords/edit.html.erb new file mode 100644 index 0000000..5fbb9ff --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/devise/passwords/edit.html.erb @@ -0,0 +1,25 @@ +

Change your password

+ +<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> + <%= f.hidden_field :reset_password_token %> + +
+ <%= f.label :password, "New password" %>
+ <% if @minimum_password_length %> + (<%= @minimum_password_length %> characters minimum)
+ <% end %> + <%= f.password_field :password, autofocus: true, autocomplete: "new-password" %> +
+ +
+ <%= f.label :password_confirmation, "Confirm new password" %>
+ <%= f.password_field :password_confirmation, autocomplete: "new-password" %> +
+ +
+ <%= f.submit "Change my password" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/RoR_App/aicruit-admin/app/views/devise/passwords/new.html.erb b/RoR_App/aicruit-admin/app/views/devise/passwords/new.html.erb new file mode 100644 index 0000000..9b486b8 --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/devise/passwords/new.html.erb @@ -0,0 +1,16 @@ +

Forgot your password?

+ +<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> + +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %> +
+ +
+ <%= f.submit "Send me reset password instructions" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/RoR_App/aicruit-admin/app/views/devise/registrations/edit.html.erb b/RoR_App/aicruit-admin/app/views/devise/registrations/edit.html.erb new file mode 100644 index 0000000..b82e336 --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/devise/registrations/edit.html.erb @@ -0,0 +1,43 @@ +

Edit <%= resource_name.to_s.humanize %>

+ +<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> + +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %> +
+ + <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> +
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
+ <% end %> + +
+ <%= f.label :password %> (leave blank if you don't want to change it)
+ <%= f.password_field :password, autocomplete: "new-password" %> + <% if @minimum_password_length %> +
+ <%= @minimum_password_length %> characters minimum + <% end %> +
+ +
+ <%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation, autocomplete: "new-password" %> +
+ +
+ <%= f.label :current_password %> (we need your current password to confirm your changes)
+ <%= f.password_field :current_password, autocomplete: "current-password" %> +
+ +
+ <%= f.submit "Update" %> +
+<% end %> + +

Cancel my account

+ +
Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?" }, method: :delete %>
+ +<%= link_to "Back", :back %> diff --git a/RoR_App/aicruit-admin/app/views/devise/registrations/new.html.erb b/RoR_App/aicruit-admin/app/views/devise/registrations/new.html.erb new file mode 100644 index 0000000..b77e8df --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/devise/registrations/new.html.erb @@ -0,0 +1,54 @@ +

Sign up

+ +<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> + + + +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %> +
+ +
+ <%= f.label :password %> + <% if @minimum_password_length %> + (<%= @minimum_password_length %> characters minimum) + <% end %>
+ <%= f.password_field :password, autocomplete: "new-password" %> +
+ +
+ <%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation, autocomplete: "new-password" %> +
+ +
+ <%= f.submit "Sign up" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/RoR_App/aicruit-admin/app/views/devise/sessions/new.html.erb b/RoR_App/aicruit-admin/app/views/devise/sessions/new.html.erb new file mode 100644 index 0000000..4acafa8 --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/devise/sessions/new.html.erb @@ -0,0 +1,36 @@ +

Log in

+<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> + + + + + + + + + + + + <% if devise_mapping.rememberable? %> + + + + + <% end %> + + + + +
<%= f.label :email %> + <%= f.email_field :email, autofocus: true, autocomplete: "email" %> +
<%= f.label :password %> + <%= f.password_field :password, autocomplete: "current-password" %> +
<%= f.label :remember_me %> + <%= f.check_box :remember_me %> +
+ <%= f.submit "Log in", class: 'btn btn-primary' %> +
+ +<% end %>
+ +<%= render "devise/shared/links", style: "text-align: left;" %> \ No newline at end of file diff --git a/RoR_App/aicruit-admin/app/views/devise/shared/_error_messages.html.erb b/RoR_App/aicruit-admin/app/views/devise/shared/_error_messages.html.erb new file mode 100644 index 0000000..cabfe30 --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/devise/shared/_error_messages.html.erb @@ -0,0 +1,15 @@ +<% if resource.errors.any? %> +
+

+ <%= I18n.t("errors.messages.not_saved", + count: resource.errors.count, + resource: resource.class.model_name.human.downcase) + %> +

+
    + <% resource.errors.full_messages.each do |message| %> +
  • <%= message %>
  • + <% end %> +
+
+<% end %> diff --git a/RoR_App/aicruit-admin/app/views/devise/shared/_links.html.erb b/RoR_App/aicruit-admin/app/views/devise/shared/_links.html.erb new file mode 100644 index 0000000..7a75304 --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/devise/shared/_links.html.erb @@ -0,0 +1,25 @@ +<%- if controller_name != 'sessions' %> + <%= link_to "Log in", new_session_path(resource_name) %>
+<% end %> + +<%- if devise_mapping.registerable? && controller_name != 'registrations' %> + <%= link_to "Sign up", new_registration_path(resource_name) %>
+<% end %> + +<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> + <%= link_to "Forgot your password?", new_password_path(resource_name) %>
+<% end %> + +<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> + <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
+<% end %> + +<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> + <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
+<% end %> + +<%- if devise_mapping.omniauthable? %> + <%- resource_class.omniauth_providers.each do |provider| %> + <%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %>
+ <% end %> +<% end %> diff --git a/RoR_App/aicruit-admin/app/views/devise/unlocks/new.html.erb b/RoR_App/aicruit-admin/app/views/devise/unlocks/new.html.erb new file mode 100644 index 0000000..ffc34de --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/devise/unlocks/new.html.erb @@ -0,0 +1,16 @@ +

Resend unlock instructions

+ +<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> + +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %> +
+ +
+ <%= f.submit "Resend unlock instructions" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/RoR_App/aicruit-admin/app/views/layouts/application.html.erb b/RoR_App/aicruit-admin/app/views/layouts/application.html.erb new file mode 100644 index 0000000..0bd1ccd --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/layouts/application.html.erb @@ -0,0 +1,99 @@ + + + + <%= content_for(:title) || "Aicruit Admin" %> + + + + + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + + <%= yield :head %> + + <%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %> + <%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %> + + + + + + <%# Includes all stylesheet files in app/assets/stylesheets %> + <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %> + <%= javascript_importmap_tags %> + + + + + + + + + + + + + + + + + + + + + +
+ <% if notice %> +

<%= notice %>

+ <% end %> + + <% if alert %> +

<%= alert %>

+ <% end %> + + + <%= yield :form_content %> + + <%= yield %> + +
+ + diff --git a/RoR_App/aicruit-admin/app/views/layouts/mailer.html.erb b/RoR_App/aicruit-admin/app/views/layouts/mailer.html.erb new file mode 100644 index 0000000..3aac900 --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/RoR_App/aicruit-admin/app/views/layouts/mailer.text.erb b/RoR_App/aicruit-admin/app/views/layouts/mailer.text.erb new file mode 100644 index 0000000..37f0bdd --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/RoR_App/aicruit-admin/app/views/pwa/manifest.json.erb b/RoR_App/aicruit-admin/app/views/pwa/manifest.json.erb new file mode 100644 index 0000000..2d164f3 --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/pwa/manifest.json.erb @@ -0,0 +1,22 @@ +{ + "name": "AicruitAdmin", + "icons": [ + { + "src": "/icon.png", + "type": "image/png", + "sizes": "512x512" + }, + { + "src": "/icon.png", + "type": "image/png", + "sizes": "512x512", + "purpose": "maskable" + } + ], + "start_url": "/", + "display": "standalone", + "scope": "/", + "description": "AicruitAdmin.", + "theme_color": "red", + "background_color": "red" +} diff --git a/RoR_App/aicruit-admin/app/views/pwa/service-worker.js b/RoR_App/aicruit-admin/app/views/pwa/service-worker.js new file mode 100644 index 0000000..b3a13fb --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/pwa/service-worker.js @@ -0,0 +1,26 @@ +// Add a service worker for processing Web Push notifications: +// +// self.addEventListener("push", async (event) => { +// const { title, options } = await event.data.json() +// event.waitUntil(self.registration.showNotification(title, options)) +// }) +// +// self.addEventListener("notificationclick", function(event) { +// event.notification.close() +// event.waitUntil( +// clients.matchAll({ type: "window" }).then((clientList) => { +// for (let i = 0; i < clientList.length; i++) { +// let client = clientList[i] +// let clientPath = (new URL(client.url)).pathname +// +// if (clientPath == event.notification.data.path && "focus" in client) { +// return client.focus() +// } +// } +// +// if (clients.openWindow) { +// return clients.openWindow(event.notification.data.path) +// } +// }) +// ) +// }) diff --git a/RoR_App/aicruit-admin/app/views/user/_form.html.erb b/RoR_App/aicruit-admin/app/views/user/_form.html.erb new file mode 100644 index 0000000..00b5090 --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/user/_form.html.erb @@ -0,0 +1,40 @@ + +

<%= action_name == 'new' ? 'Create New User' : 'Edit User' %>

+ +<%= form_with(model: @user, url: (@user.new_record? ? new_user_path : user_path(@user)), local: true) do |form| %> + <% if @user.errors.any? %> +
+

<%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:

+
    + <% @user.errors.full_messages.each do |message| %> +
  • <%= message %>
  • + <% end %> +
+
+ <% end %> + + + + + + + + + + + + + + + + + + + + + +
<%= form.label :first_name %><%= form.text_field :first_name, class: 'form-control' %>
<%= form.label :last_name %><%= form.text_field :last_name, class: 'form-control' %>
<%= form.label :email %><%= form.email_field :email, class: 'form-control' %>
<%= form.label :password %><%= form.password_field :password, class: 'form-control' %>
+ <%= form.submit action_name == 'new' ? 'Create Account' : 'Update User', class: 'btn btn-primary' %> +
+ +<% end %> diff --git a/RoR_App/aicruit-admin/app/views/user/_show.html.erb b/RoR_App/aicruit-admin/app/views/user/_show.html.erb new file mode 100644 index 0000000..c3ecdd7 --- /dev/null +++ b/RoR_App/aicruit-admin/app/views/user/_show.html.erb @@ -0,0 +1,14 @@ +

User Details

+ + +
+

ID: <%= @user.id %>

+

First Name: <%= @user.first_name %>

+

List Name: <%= @user.last_name %>

+

Email: <%= @user.email %>

+

Phone Number: <%= @user.contact_number %>

+

Role: <%= @user.role.name %>

+

Joined on: <%= @user.created_at.strftime("%B %d, %Y") %>

+
+ + diff --git a/RoR_App/aicruit-admin/bin/brakeman b/RoR_App/aicruit-admin/bin/brakeman new file mode 100755 index 0000000..ace1c9b --- /dev/null +++ b/RoR_App/aicruit-admin/bin/brakeman @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +ARGV.unshift("--ensure-latest") + +load Gem.bin_path("brakeman", "brakeman") diff --git a/RoR_App/aicruit-admin/bin/bundle b/RoR_App/aicruit-admin/bin/bundle new file mode 100755 index 0000000..50da5fd --- /dev/null +++ b/RoR_App/aicruit-admin/bin/bundle @@ -0,0 +1,109 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'bundle' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "rubygems" + +m = Module.new do + module_function + + def invoked_as_script? + File.expand_path($0) == File.expand_path(__FILE__) + end + + def env_var_version + ENV["BUNDLER_VERSION"] + end + + def cli_arg_version + return unless invoked_as_script? # don't want to hijack other binstubs + return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` + bundler_version = nil + update_index = nil + ARGV.each_with_index do |a, i| + if update_index && update_index.succ == i && a.match?(Gem::Version::ANCHORED_VERSION_PATTERN) + bundler_version = a + end + next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ + bundler_version = $1 + update_index = i + end + bundler_version + end + + def gemfile + gemfile = ENV["BUNDLE_GEMFILE"] + return gemfile if gemfile && !gemfile.empty? + + File.expand_path("../Gemfile", __dir__) + end + + def lockfile + lockfile = + case File.basename(gemfile) + when "gems.rb" then gemfile.sub(/\.rb$/, ".locked") + else "#{gemfile}.lock" + end + File.expand_path(lockfile) + end + + def lockfile_version + return unless File.file?(lockfile) + lockfile_contents = File.read(lockfile) + return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ + Regexp.last_match(1) + end + + def bundler_requirement + @bundler_requirement ||= + env_var_version || + cli_arg_version || + bundler_requirement_for(lockfile_version) + end + + def bundler_requirement_for(version) + return "#{Gem::Requirement.default}.a" unless version + + bundler_gem_version = Gem::Version.new(version) + + bundler_gem_version.approximate_recommendation + end + + def load_bundler! + ENV["BUNDLE_GEMFILE"] ||= gemfile + + activate_bundler + end + + def activate_bundler + gem_error = activation_error_handling do + gem "bundler", bundler_requirement + end + return if gem_error.nil? + require_error = activation_error_handling do + require "bundler/version" + end + return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) + warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" + exit 42 + end + + def activation_error_handling + yield + nil + rescue StandardError, LoadError => e + e + end +end + +m.load_bundler! + +if m.invoked_as_script? + load Gem.bin_path("bundler", "bundle") +end diff --git a/RoR_App/aicruit-admin/bin/dev b/RoR_App/aicruit-admin/bin/dev new file mode 100755 index 0000000..5f91c20 --- /dev/null +++ b/RoR_App/aicruit-admin/bin/dev @@ -0,0 +1,2 @@ +#!/usr/bin/env ruby +exec "./bin/rails", "server", *ARGV diff --git a/RoR_App/aicruit-admin/bin/docker-entrypoint b/RoR_App/aicruit-admin/bin/docker-entrypoint new file mode 100755 index 0000000..57567d6 --- /dev/null +++ b/RoR_App/aicruit-admin/bin/docker-entrypoint @@ -0,0 +1,14 @@ +#!/bin/bash -e + +# Enable jemalloc for reduced memory usage and latency. +if [ -z "${LD_PRELOAD+x}" ]; then + LD_PRELOAD=$(find /usr/lib -name libjemalloc.so.2 -print -quit) + export LD_PRELOAD +fi + +# If running the rails server then create or migrate existing database +if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then + ./bin/rails db:prepare +fi + +exec "${@}" diff --git a/RoR_App/aicruit-admin/bin/importmap b/RoR_App/aicruit-admin/bin/importmap new file mode 100755 index 0000000..36502ab --- /dev/null +++ b/RoR_App/aicruit-admin/bin/importmap @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby + +require_relative "../config/application" +require "importmap/commands" diff --git a/RoR_App/aicruit-admin/bin/jobs b/RoR_App/aicruit-admin/bin/jobs new file mode 100755 index 0000000..dcf59f3 --- /dev/null +++ b/RoR_App/aicruit-admin/bin/jobs @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby + +require_relative "../config/environment" +require "solid_queue/cli" + +SolidQueue::Cli.start(ARGV) diff --git a/RoR_App/aicruit-admin/bin/kamal b/RoR_App/aicruit-admin/bin/kamal new file mode 100755 index 0000000..cbe59b9 --- /dev/null +++ b/RoR_App/aicruit-admin/bin/kamal @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'kamal' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("kamal", "kamal") diff --git a/RoR_App/aicruit-admin/bin/rails b/RoR_App/aicruit-admin/bin/rails new file mode 100755 index 0000000..efc0377 --- /dev/null +++ b/RoR_App/aicruit-admin/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/RoR_App/aicruit-admin/bin/rake b/RoR_App/aicruit-admin/bin/rake new file mode 100755 index 0000000..4fbf10b --- /dev/null +++ b/RoR_App/aicruit-admin/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/RoR_App/aicruit-admin/bin/rubocop b/RoR_App/aicruit-admin/bin/rubocop new file mode 100755 index 0000000..40330c0 --- /dev/null +++ b/RoR_App/aicruit-admin/bin/rubocop @@ -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") diff --git a/RoR_App/aicruit-admin/bin/setup b/RoR_App/aicruit-admin/bin/setup new file mode 100755 index 0000000..be3db3c --- /dev/null +++ b/RoR_App/aicruit-admin/bin/setup @@ -0,0 +1,34 @@ +#!/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" + + 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 diff --git a/RoR_App/aicruit-admin/bin/thrust b/RoR_App/aicruit-admin/bin/thrust new file mode 100755 index 0000000..36bde2d --- /dev/null +++ b/RoR_App/aicruit-admin/bin/thrust @@ -0,0 +1,5 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("thruster", "thrust") diff --git a/RoR_App/aicruit-admin/config.ru b/RoR_App/aicruit-admin/config.ru new file mode 100644 index 0000000..4a3c09a --- /dev/null +++ b/RoR_App/aicruit-admin/config.ru @@ -0,0 +1,6 @@ +# This file is used by Rack-based servers to start the application. + +require_relative "config/environment" + +run Rails.application +Rails.application.load_server diff --git a/RoR_App/aicruit-admin/config/application.rb b/RoR_App/aicruit-admin/config/application.rb new file mode 100644 index 0000000..e29a5f0 --- /dev/null +++ b/RoR_App/aicruit-admin/config/application.rb @@ -0,0 +1,28 @@ +require_relative "boot" + +require "rails/all" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module AicruitAdmin + class Application < Rails::Application + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 8.0 + + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib(ignore: %w[assets tasks]) + + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # + # config.time_zone = "Central Time (US & Canada)" + # config.eager_load_paths << Rails.root.join("extras") + + end +end diff --git a/RoR_App/aicruit-admin/config/boot.rb b/RoR_App/aicruit-admin/config/boot.rb new file mode 100644 index 0000000..988a5dd --- /dev/null +++ b/RoR_App/aicruit-admin/config/boot.rb @@ -0,0 +1,4 @@ +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +require "bundler/setup" # Set up gems listed in the Gemfile. +require "bootsnap/setup" # Speed up boot time by caching expensive operations. diff --git a/RoR_App/aicruit-admin/config/cable.yml b/RoR_App/aicruit-admin/config/cable.yml new file mode 100644 index 0000000..b9adc5a --- /dev/null +++ b/RoR_App/aicruit-admin/config/cable.yml @@ -0,0 +1,17 @@ +# Async adapter only works within the same process, so for manually triggering cable updates from a console, +# and seeing results in the browser, you must do so from the web console (running inside the dev process), +# not a terminal started via bin/rails console! Add "console" to any action or any ERB template view +# to make the web console appear. +development: + adapter: async + +test: + adapter: test + +production: + adapter: solid_cable + connects_to: + database: + writing: cable + polling_interval: 0.1.seconds + message_retention: 1.day diff --git a/RoR_App/aicruit-admin/config/cache.yml b/RoR_App/aicruit-admin/config/cache.yml new file mode 100644 index 0000000..19d4908 --- /dev/null +++ b/RoR_App/aicruit-admin/config/cache.yml @@ -0,0 +1,16 @@ +default: &default + store_options: + # Cap age of oldest cache entry to fulfill retention policies + # max_age: <%= 60.days.to_i %> + max_size: <%= 256.megabytes %> + namespace: <%= Rails.env %> + +development: + <<: *default + +test: + <<: *default + +production: + database: cache + <<: *default diff --git a/RoR_App/aicruit-admin/config/credentials.yml.enc b/RoR_App/aicruit-admin/config/credentials.yml.enc new file mode 100644 index 0000000..bd0b231 --- /dev/null +++ b/RoR_App/aicruit-admin/config/credentials.yml.enc @@ -0,0 +1 @@ +KH+QcGDuNOBBmgH3WwfeU/X0MRe/ZLwrJpWbwmwa7YoazDfGMI5Rg7GVd+yc7+IwMgePw0ELDrx1D5dXERe/pK2YPvPvT8ynJoPKiBDbRtzomhCF2XSljdebNhrpyMRKSYmYQwRVAZNBsdxVdoE+QBmu7fjVN3eTBgNwKaUHaN3R+nBTVCneIbX5k43PXv6cPnTOJZB5xljpMUROkEZGUslz7JNXa5aaLUYQxJ0Guf+0qBnUEQmSFE4xM43XZF9iG8XOSDaXKpRsIcS9ZaG87l6OJ2fIe7Iuolpw1G1FvMMGFz6O1jqGAYpGC2bwT4BWcIHyTBxRDfH9KBLjqOoVdH2fW/UFfds7p/dXt2s9DBrvGNhquaPdInwmwKN6GBzyYhx2E3yIVQt7BNHFQbtbA4miNLnJdpxei/OCpOp32T9qWjg4ud/pt4xOPctopdvaFVyA1sYjxOZRavR8I4lqRChlUKJGiXx1avia2Y7EN/BPW/bQXH8aeaZc--1rjHFQEfE9OUD/MV--rk3My/L/v5wIbHS+AAqxrw== \ No newline at end of file diff --git a/RoR_App/aicruit-admin/config/database.yml b/RoR_App/aicruit-admin/config/database.yml new file mode 100644 index 0000000..0fc2f71 --- /dev/null +++ b/RoR_App/aicruit-admin/config/database.yml @@ -0,0 +1,103 @@ +# PostgreSQL. Versions 9.3 and up are supported. +# +# Install the pg driver: +# gem install pg +# On macOS with Homebrew: +# gem install pg -- --with-pg-config=/usr/local/bin/pg_config +# On Windows: +# gem install pg +# Choose the win32 build. +# Install PostgreSQL and put its /bin directory on your path. +# +# Configure Using Gemfile +# gem "pg" +# +default: &default + adapter: postgresql + encoding: unicode + # For details on connection pooling, see Rails configuration guide + # https://guides.rubyonrails.org/configuring.html#database-pooling + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + host: <%= ENV['DATABASE_HOST'] %> + username: <%= ENV['DATABASE_USERNAME'] %> + password: <%= ENV['DATABASE_PASSWORD'] %> + database: <%= ENV['DATABASE_NAME'] %> + port: <%= ENV['DATABASE_PORT'] %> + + +development: + <<: *default + database: aicruit_admin_development + + # The specified database role being used to connect to PostgreSQL. + # To create additional roles in PostgreSQL see `$ createuser --help`. + # When left blank, PostgreSQL will use the default role. This is + # the same name as the operating system user running Rails. + #username: aicruit_admin + + # The password associated with the PostgreSQL role (username). + #password: + + # Connect on a TCP socket. Omitted by default since the client uses a + # domain socket that doesn't need configuration. Windows does not have + # domain sockets, so uncomment these lines. + #host: localhost + + # The TCP port the server listens on. Defaults to 5432. + # If your server runs on a different port number, change accordingly. + #port: 5432 + + # Schema search path. The server defaults to $user,public + #schema_search_path: myapp,sharedapp,public + + # Minimum log levels, in increasing order: + # debug5, debug4, debug3, debug2, debug1, + # log, notice, warning, error, fatal, and panic + # Defaults to warning. + #min_messages: notice + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: aicruit_admin_test + +# As with config/credentials.yml, you never want to store sensitive information, +# like your database password, in your source code. If your source code is +# ever seen by anyone, they now have access to your database. +# +# Instead, provide the password or a full connection URL as an environment +# variable when you boot the app. For example: +# +# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" +# +# If the connection URL is provided in the special DATABASE_URL environment +# variable, Rails will automatically merge its configuration values on top of +# the values provided in this file. Alternatively, you can specify a connection +# URL environment variable explicitly: +# +# production: +# url: <%= ENV["MY_APP_DATABASE_URL"] %> +# +# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database +# for a full overview on how database connection configuration can be specified. +# +production: + primary: &primary_production + <<: *default + database: aicruit_admin_production + username: aicruit_admin + password: <%= ENV["AICRUIT_ADMIN_DATABASE_PASSWORD"] %> + cache: + <<: *primary_production + database: aicruit_admin_production_cache + migrations_paths: db/cache_migrate + queue: + <<: *primary_production + database: aicruit_admin_production_queue + migrations_paths: db/queue_migrate + cable: + <<: *primary_production + database: aicruit_admin_production_cable + migrations_paths: db/cable_migrate diff --git a/RoR_App/aicruit-admin/config/deploy.yml b/RoR_App/aicruit-admin/config/deploy.yml new file mode 100644 index 0000000..db9b94f --- /dev/null +++ b/RoR_App/aicruit-admin/config/deploy.yml @@ -0,0 +1,116 @@ +# Name of your application. Used to uniquely configure containers. +service: aicruit_admin + +# Name of the container image. +image: your-user/aicruit_admin + +# Deploy to these servers. +servers: + web: + - 192.168.0.1 + # job: + # hosts: + # - 192.168.0.1 + # cmd: bin/jobs + +# Enable SSL auto certification via Let's Encrypt and allow for multiple apps on a single web server. +# Remove this section when using multiple web servers and ensure you terminate SSL at your load balancer. +# +# Note: If using Cloudflare, set encryption mode in SSL/TLS setting to "Full" to enable CF-to-app encryption. +proxy: + ssl: true + host: app.example.com + +# Credentials for your image host. +registry: + # Specify the registry server, if you're not using Docker Hub + # server: registry.digitalocean.com / ghcr.io / ... + username: your-user + + # Always use an access token rather than real password when possible. + password: + - KAMAL_REGISTRY_PASSWORD + +# Inject ENV variables into containers (secrets come from .kamal/secrets). +env: + secret: + - RAILS_MASTER_KEY + clear: + # Run the Solid Queue Supervisor inside the web server's Puma process to do jobs. + # When you start using multiple servers, you should split out job processing to a dedicated machine. + SOLID_QUEUE_IN_PUMA: true + + # Set number of processes dedicated to Solid Queue (default: 1) + # JOB_CONCURRENCY: 3 + + # Set number of cores available to the application on each server (default: 1). + # WEB_CONCURRENCY: 2 + + # Match this to any external database server to configure Active Record correctly + # Use aicruit_admin-db for a db accessory server on same machine via local kamal docker network. + # DB_HOST: 192.168.0.2 + + # Log everything from Rails + # RAILS_LOG_LEVEL: debug + +# Aliases are triggered with "bin/kamal ". You can overwrite arguments on invocation: +# "bin/kamal logs -r job" will tail logs from the first server in the job section. +aliases: + console: app exec --interactive --reuse "bin/rails console" + shell: app exec --interactive --reuse "bash" + logs: app logs -f + dbc: app exec --interactive --reuse "bin/rails dbconsole" + + +# Use a persistent storage volume for sqlite database files and local Active Storage files. +# Recommended to change this to a mounted volume path that is backed up off server. +volumes: + - "aicruit_admin_storage:/rails/storage" + + +# Bridge fingerprinted assets, like JS and CSS, between versions to avoid +# hitting 404 on in-flight requests. Combines all files from new and old +# version inside the asset_path. +asset_path: /rails/public/assets + +# Configure the image builder. +builder: + arch: amd64 + + # # Build image via remote server (useful for faster amd64 builds on arm64 computers) + # remote: ssh://docker@docker-builder-server + # + # # Pass arguments and secrets to the Docker build process + # args: + # RUBY_VERSION: 3.2.2 + # secrets: + # - GITHUB_TOKEN + # - RAILS_MASTER_KEY + +# Use a different ssh user than root +# ssh: +# user: app + +# Use accessory services (secrets come from .kamal/secrets). +# accessories: +# db: +# image: mysql:8.0 +# host: 192.168.0.2 +# # Change to 3306 to expose port to the world instead of just local network. +# port: "127.0.0.1:3306:3306" +# env: +# clear: +# MYSQL_ROOT_HOST: '%' +# secret: +# - MYSQL_ROOT_PASSWORD +# files: +# - config/mysql/production.cnf:/etc/mysql/my.cnf +# - db/production.sql:/docker-entrypoint-initdb.d/setup.sql +# directories: +# - data:/var/lib/mysql +# redis: +# image: redis:7.0 +# host: 192.168.0.2 +# port: 6379 +# directories: +# - data:/data diff --git a/RoR_App/aicruit-admin/config/environment.rb b/RoR_App/aicruit-admin/config/environment.rb new file mode 100644 index 0000000..cac5315 --- /dev/null +++ b/RoR_App/aicruit-admin/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative "application" + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/RoR_App/aicruit-admin/config/environments/development.rb b/RoR_App/aicruit-admin/config/environments/development.rb new file mode 100644 index 0000000..4cc21c4 --- /dev/null +++ b/RoR_App/aicruit-admin/config/environments/development.rb @@ -0,0 +1,72 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Make code changes take effect immediately without server restart. + config.enable_reloading = true + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable server timing. + config.server_timing = true + + # Enable/disable Action Controller caching. By default Action Controller caching is disabled. + # Run rails dev:cache to toggle Action Controller caching. + if Rails.root.join("tmp/caching-dev.txt").exist? + config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true + config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" } + else + config.action_controller.perform_caching = false + end + + # Change to :null_store to avoid any caching. + config.cache_store = :memory_store + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Make template changes take effect immediately. + config.action_mailer.perform_caching = false + + # Set localhost to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "localhost", port: 3000 } + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Append comments with runtime information tags to SQL queries in logs. + config.active_record.query_log_tags_enabled = true + + # Highlight code that enqueued background job in logs. + config.active_job.verbose_enqueue_logs = true + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + config.action_view.annotate_rendered_view_with_filenames = true + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true + + # Raise error when a before_action's only/except options reference missing actions. + config.action_controller.raise_on_missing_callback_actions = true + + # Apply autocorrection by RuboCop to files generated by `bin/rails generate`. + # config.generators.apply_rubocop_autocorrect_after_generate! +end diff --git a/RoR_App/aicruit-admin/config/environments/production.rb b/RoR_App/aicruit-admin/config/environments/production.rb new file mode 100644 index 0000000..bdcd01d --- /dev/null +++ b/RoR_App/aicruit-admin/config/environments/production.rb @@ -0,0 +1,90 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.enable_reloading = false + + # Eager load code on boot for better performance and memory savings (ignored by Rake tasks). + config.eager_load = true + + # Full error reports are disabled. + config.consider_all_requests_local = false + + # Turn on fragment caching in view templates. + config.action_controller.perform_caching = true + + # Cache assets for far-future expiry since they are all digest stamped. + config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.asset_host = "http://assets.example.com" + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Assume all access to the app is happening through a SSL-terminating reverse proxy. + config.assume_ssl = true + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + config.force_ssl = true + + # Skip http-to-https redirect for the default health check endpoint. + # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } + + # Log to STDOUT with the current request id as a default log tag. + config.log_tags = [ :request_id ] + config.logger = ActiveSupport::TaggedLogging.logger(STDOUT) + + # Change to "debug" to log everything (including potentially personally-identifiable information!) + config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") + + # Prevent health checks from clogging up the logs. + config.silence_healthcheck_path = "/up" + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Replace the default in-process memory cache store with a durable alternative. + config.cache_store = :solid_cache_store + + # Replace the default in-process and non-durable queuing backend for Active Job. + config.active_job.queue_adapter = :solid_queue + config.solid_queue.connects_to = { database: { writing: :queue } } + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Set host to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "example.com" } + + # Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit. + # config.action_mailer.smtp_settings = { + # user_name: Rails.application.credentials.dig(:smtp, :user_name), + # password: Rails.application.credentials.dig(:smtp, :password), + # address: "smtp.example.com", + # port: 587, + # authentication: :plain + # } + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false + + # Only use :id for inspections in production. + config.active_record.attributes_for_inspect = [ :id ] + + # Enable DNS rebinding protection and other `Host` header attacks. + # config.hosts = [ + # "example.com", # Allow requests from example.com + # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` + # ] + # + # Skip DNS rebinding protection for the default health check endpoint. + # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } +end diff --git a/RoR_App/aicruit-admin/config/environments/test.rb b/RoR_App/aicruit-admin/config/environments/test.rb new file mode 100644 index 0000000..c2095b1 --- /dev/null +++ b/RoR_App/aicruit-admin/config/environments/test.rb @@ -0,0 +1,53 @@ +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # While tests run files are not watched, reloading is not necessary. + config.enable_reloading = false + + # Eager loading loads your entire application. When running a single test locally, + # this is usually not necessary, and can slow down your test suite. However, it's + # recommended that you enable it in continuous integration systems to ensure eager + # loading is working properly before deploying your code. + config.eager_load = ENV["CI"].present? + + # Configure public file server for tests with cache-control for performance. + config.public_file_server.headers = { "cache-control" => "public, max-age=3600" } + + # Show full error reports. + config.consider_all_requests_local = true + config.cache_store = :null_store + + # Render exception templates for rescuable exceptions and raise for other exceptions. + config.action_dispatch.show_exceptions = :rescuable + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Store uploaded files on the local file system in a temporary directory. + config.active_storage.service = :test + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Set host to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "example.com" } + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Raise error when a before_action's only/except options reference missing actions. + config.action_controller.raise_on_missing_callback_actions = true +end diff --git a/RoR_App/aicruit-admin/config/importmap.rb b/RoR_App/aicruit-admin/config/importmap.rb new file mode 100644 index 0000000..909dfc5 --- /dev/null +++ b/RoR_App/aicruit-admin/config/importmap.rb @@ -0,0 +1,7 @@ +# Pin npm packages by running ./bin/importmap + +pin "application" +pin "@hotwired/turbo-rails", to: "turbo.min.js" +pin "@hotwired/stimulus", to: "stimulus.min.js" +pin "@hotwired/stimulus-loading", to: "stimulus-loading.js" +pin_all_from "app/javascript/controllers", under: "controllers" diff --git a/RoR_App/aicruit-admin/config/initializers/assets.rb b/RoR_App/aicruit-admin/config/initializers/assets.rb new file mode 100644 index 0000000..4873244 --- /dev/null +++ b/RoR_App/aicruit-admin/config/initializers/assets.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = "1.0" + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path diff --git a/RoR_App/aicruit-admin/config/initializers/content_security_policy.rb b/RoR_App/aicruit-admin/config/initializers/content_security_policy.rb new file mode 100644 index 0000000..b3076b3 --- /dev/null +++ b/RoR_App/aicruit-admin/config/initializers/content_security_policy.rb @@ -0,0 +1,25 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy. +# See the Securing Rails Applications Guide for more information: +# https://guides.rubyonrails.org/security.html#content-security-policy-header + +# Rails.application.configure do +# config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end +# +# # Generate session nonces for permitted importmap, inline scripts, and inline styles. +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_directives = %w(script-src style-src) +# +# # Report violations without enforcing the policy. +# # config.content_security_policy_report_only = true +# end diff --git a/RoR_App/aicruit-admin/config/initializers/devise.rb b/RoR_App/aicruit-admin/config/initializers/devise.rb new file mode 100644 index 0000000..b09f4e6 --- /dev/null +++ b/RoR_App/aicruit-admin/config/initializers/devise.rb @@ -0,0 +1,313 @@ +# frozen_string_literal: true + +# Assuming you have not yet modified this file, each configuration option below +# is set to its default value. Note that some are commented out while others +# are not: uncommented lines are intended to protect your configuration from +# breaking changes in upgrades (i.e., in the event that future versions of +# Devise change the default values for those options). +# +# Use this hook to configure devise mailer, warden hooks and so forth. +# Many of these configuration options can be set straight in your model. +Devise.setup do |config| + # The secret key used by Devise. Devise uses this key to generate + # random tokens. Changing this key will render invalid all existing + # confirmation, reset password and unlock tokens in the database. + # Devise will use the `secret_key_base` as its `secret_key` + # by default. You can change it below and use your own secret key. + # config.secret_key = 'c4a1205e034d47524964294fd50936af955b4a14e37b9ff1a9a399d6d72fff732af7875fbb21a2d73f92c4d95a7bbb7934306111e584040389b5d2d020c15655' + + # ==> Controller configuration + # Configure the parent class to the devise controllers. + # config.parent_controller = 'DeviseController' + + # ==> Mailer Configuration + # Configure the e-mail address which will be shown in Devise::Mailer, + # note that it will be overwritten if you use your own mailer class + # with default "from" parameter. + config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' + + # Configure the class responsible to send e-mails. + # config.mailer = 'Devise::Mailer' + + # Configure the parent class responsible to send e-mails. + # config.parent_mailer = 'ActionMailer::Base' + + # ==> ORM configuration + # Load and configure the ORM. Supports :active_record (default) and + # :mongoid (bson_ext recommended) by default. Other ORMs may be + # available as additional gems. + require 'devise/orm/active_record' + + # ==> Configuration for any authentication mechanism + # Configure which keys are used when authenticating a user. The default is + # just :email. You can configure it to use [:username, :subdomain], so for + # authenticating a user, both parameters are required. Remember that those + # parameters are used only when authenticating and not when retrieving from + # session. If you need permissions, you should implement that in a before filter. + # You can also supply a hash where the value is a boolean determining whether + # or not authentication should be aborted when the value is not present. + # config.authentication_keys = [:email] + + # Configure parameters from the request object used for authentication. Each entry + # given should be a request method and it will automatically be passed to the + # find_for_authentication method and considered in your model lookup. For instance, + # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. + # The same considerations mentioned for authentication_keys also apply to request_keys. + # config.request_keys = [] + + # Configure which authentication keys should be case-insensitive. + # These keys will be downcased upon creating or modifying a user and when used + # to authenticate or find a user. Default is :email. + config.case_insensitive_keys = [:email] + + # Configure which authentication keys should have whitespace stripped. + # These keys will have whitespace before and after removed upon creating or + # modifying a user and when used to authenticate or find a user. Default is :email. + config.strip_whitespace_keys = [:email] + + # Tell if authentication through request.params is enabled. True by default. + # It can be set to an array that will enable params authentication only for the + # given strategies, for example, `config.params_authenticatable = [:database]` will + # enable it only for database (email + password) authentication. + # config.params_authenticatable = true + + # Tell if authentication through HTTP Auth is enabled. False by default. + # It can be set to an array that will enable http authentication only for the + # given strategies, for example, `config.http_authenticatable = [:database]` will + # enable it only for database authentication. + # For API-only applications to support authentication "out-of-the-box", you will likely want to + # enable this with :database unless you are using a custom strategy. + # The supported strategies are: + # :database = Support basic authentication with authentication key + password + # config.http_authenticatable = false + + # If 401 status code should be returned for AJAX requests. True by default. + # config.http_authenticatable_on_xhr = true + + # The realm used in Http Basic Authentication. 'Application' by default. + # config.http_authentication_realm = 'Application' + + # It will change confirmation, password recovery and other workflows + # to behave the same regardless if the e-mail provided was right or wrong. + # Does not affect registerable. + # config.paranoid = true + + # By default Devise will store the user in session. You can skip storage for + # particular strategies by setting this option. + # Notice that if you are skipping storage for all authentication paths, you + # may want to disable generating routes to Devise's sessions controller by + # passing skip: :sessions to `devise_for` in your config/routes.rb + config.skip_session_storage = [:http_auth] + + # By default, Devise cleans up the CSRF token on authentication to + # avoid CSRF token fixation attacks. This means that, when using AJAX + # requests for sign in and sign up, you need to get a new CSRF token + # from the server. You can disable this option at your own risk. + # config.clean_up_csrf_token_on_authentication = true + + # When false, Devise will not attempt to reload routes on eager load. + # This can reduce the time taken to boot the app but if your application + # requires the Devise mappings to be loaded during boot time the application + # won't boot properly. + # config.reload_routes = true + + # ==> Configuration for :database_authenticatable + # For bcrypt, this is the cost for hashing the password and defaults to 12. If + # using other algorithms, it sets how many times you want the password to be hashed. + # The number of stretches used for generating the hashed password are stored + # with the hashed password. This allows you to change the stretches without + # invalidating existing passwords. + # + # Limiting the stretches to just one in testing will increase the performance of + # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use + # a value less than 10 in other environments. Note that, for bcrypt (the default + # algorithm), the cost increases exponentially with the number of stretches (e.g. + # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation). + config.stretches = Rails.env.test? ? 1 : 12 + + # Set up a pepper to generate the hashed password. + # config.pepper = '5976d4a5e8e300c349be48d2e14499a84017c05919d7620f660b412612fc8f7ec241be050c071055a24c11f99629d0b80f1d3ab25b8f5eccbdc200a2e4e899b4' + + # Send a notification to the original email when the user's email is changed. + # config.send_email_changed_notification = false + + # Send a notification email when the user's password is changed. + # config.send_password_change_notification = false + + # ==> Configuration for :confirmable + # A period that the user is allowed to access the website even without + # confirming their account. For instance, if set to 2.days, the user will be + # able to access the website for two days without confirming their account, + # access will be blocked just in the third day. + # You can also set it to nil, which will allow the user to access the website + # without confirming their account. + # Default is 0.days, meaning the user cannot access the website without + # confirming their account. + # config.allow_unconfirmed_access_for = 2.days + + # A period that the user is allowed to confirm their account before their + # token becomes invalid. For example, if set to 3.days, the user can confirm + # their account within 3 days after the mail was sent, but on the fourth day + # their account can't be confirmed with the token any more. + # Default is nil, meaning there is no restriction on how long a user can take + # before confirming their account. + # config.confirm_within = 3.days + + # If true, requires any email changes to be confirmed (exactly the same way as + # initial account confirmation) to be applied. Requires additional unconfirmed_email + # db field (see migrations). Until confirmed, new email is stored in + # unconfirmed_email column, and copied to email column on successful confirmation. + config.reconfirmable = true + + # Defines which key will be used when confirming an account + # config.confirmation_keys = [:email] + + # ==> Configuration for :rememberable + # The time the user will be remembered without asking for credentials again. + # config.remember_for = 2.weeks + + # Invalidates all the remember me tokens when the user signs out. + config.expire_all_remember_me_on_sign_out = true + + # If true, extends the user's remember period when remembered via cookie. + # config.extend_remember_period = false + + # Options to be passed to the created cookie. For instance, you can set + # secure: true in order to force SSL only cookies. + # config.rememberable_options = {} + + # ==> Configuration for :validatable + # Range for password length. + config.password_length = 6..128 + + # Email regex used to validate email formats. It simply asserts that + # one (and only one) @ exists in the given string. This is mainly + # to give user feedback and not to assert the e-mail validity. + config.email_regexp = /\A[^@\s]+@[^@\s]+\z/ + + # ==> Configuration for :timeoutable + # The time you want to timeout the user session without activity. After this + # time the user will be asked for credentials again. Default is 30 minutes. + # config.timeout_in = 30.minutes + + # ==> Configuration for :lockable + # Defines which strategy will be used to lock an account. + # :failed_attempts = Locks an account after a number of failed attempts to sign in. + # :none = No lock strategy. You should handle locking by yourself. + # config.lock_strategy = :failed_attempts + + # Defines which key will be used when locking and unlocking an account + # config.unlock_keys = [:email] + + # Defines which strategy will be used to unlock an account. + # :email = Sends an unlock link to the user email + # :time = Re-enables login after a certain amount of time (see :unlock_in below) + # :both = Enables both strategies + # :none = No unlock strategy. You should handle unlocking by yourself. + # config.unlock_strategy = :both + + # Number of authentication tries before locking an account if lock_strategy + # is failed attempts. + # config.maximum_attempts = 20 + + # Time interval to unlock the account if :time is enabled as unlock_strategy. + # config.unlock_in = 1.hour + + # Warn on the last attempt before the account is locked. + # config.last_attempt_warning = true + + # ==> Configuration for :recoverable + # + # Defines which key will be used when recovering the password for an account + # config.reset_password_keys = [:email] + + # Time interval you can reset your password with a reset password key. + # Don't put a too small interval or your users won't have the time to + # change their passwords. + config.reset_password_within = 6.hours + + # When set to false, does not sign a user in automatically after their password is + # reset. Defaults to true, so a user is signed in automatically after a reset. + # config.sign_in_after_reset_password = true + + # ==> Configuration for :encryptable + # Allow you to use another hashing or encryption algorithm besides bcrypt (default). + # You can use :sha1, :sha512 or algorithms from others authentication tools as + # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20 + # for default behavior) and :restful_authentication_sha1 (then you should set + # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper). + # + # Require the `devise-encryptable` gem when using anything other than bcrypt + # config.encryptor = :sha512 + + # ==> Scopes configuration + # Turn scoped views on. Before rendering "sessions/new", it will first check for + # "users/sessions/new". It's turned off by default because it's slower if you + # are using only default views. + # config.scoped_views = false + + # Configure the default scope given to Warden. By default it's the first + # devise role declared in your routes (usually :user). + # config.default_scope = :user + + # Set this configuration to false if you want /users/sign_out to sign out + # only the current scope. By default, Devise signs out all scopes. + # config.sign_out_all_scopes = true + + # ==> Navigation configuration + # Lists the formats that should be treated as navigational. Formats like + # :html should redirect to the sign in page when the user does not have + # access, but formats like :xml or :json, should return 401. + # + # If you have any extra navigational formats, like :iphone or :mobile, you + # should add them to the navigational formats lists. + # + # The "*/*" below is required to match Internet Explorer requests. + # config.navigational_formats = ['*/*', :html, :turbo_stream] + + # The default HTTP method used to sign out a resource. Default is :delete. + config.sign_out_via = :delete + + # ==> OmniAuth + # Add a new OmniAuth provider. Check the wiki for more information on setting + # up on your models and hooks. + # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo' + + # ==> Warden configuration + # If you want to use other strategies, that are not supported by Devise, or + # change the failure app, you can configure them inside the config.warden block. + # + # config.warden do |manager| + # manager.intercept_401 = false + # manager.default_strategies(scope: :user).unshift :some_external_strategy + # end + + # ==> Mountable engine configurations + # When using Devise inside an engine, let's call it `MyEngine`, and this engine + # is mountable, there are some extra configurations to be taken into account. + # The following options are available, assuming the engine is mounted as: + # + # mount MyEngine, at: '/my_engine' + # + # The router that invoked `devise_for`, in the example above, would be: + # config.router_name = :my_engine + # + # When using OmniAuth, Devise cannot automatically set OmniAuth path, + # so you need to do it manually. For the users scope, it would be: + # config.omniauth_path_prefix = '/my_engine/users/auth' + + # ==> Hotwire/Turbo configuration + # When using Devise with Hotwire/Turbo, the http status for error responses + # and some redirects must match the following. The default in Devise for existing + # apps is `200 OK` and `302 Found` respectively, but new apps are generated with + # these new defaults that match Hotwire/Turbo behavior. + # Note: These might become the new default in future versions of Devise. + config.responder.error_status = :unprocessable_entity + config.responder.redirect_status = :see_other + + # ==> Configuration for :registerable + + # When set to false, does not sign a user in automatically after their password is + # changed. Defaults to true, so a user is signed in automatically after changing a password. + # config.sign_in_after_change_password = true +end diff --git a/RoR_App/aicruit-admin/config/initializers/filter_parameter_logging.rb b/RoR_App/aicruit-admin/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..c0b717f --- /dev/null +++ b/RoR_App/aicruit-admin/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. +# Use this to limit dissemination of sensitive information. +# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. +Rails.application.config.filter_parameters += [ + :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc +] diff --git a/RoR_App/aicruit-admin/config/initializers/inflections.rb b/RoR_App/aicruit-admin/config/initializers/inflections.rb new file mode 100644 index 0000000..3860f65 --- /dev/null +++ b/RoR_App/aicruit-admin/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym "RESTful" +# end diff --git a/RoR_App/aicruit-admin/config/locales/devise.en.yml b/RoR_App/aicruit-admin/config/locales/devise.en.yml new file mode 100644 index 0000000..260e1c4 --- /dev/null +++ b/RoR_App/aicruit-admin/config/locales/devise.en.yml @@ -0,0 +1,65 @@ +# Additional translations at https://github.com/heartcombo/devise/wiki/I18n + +en: + devise: + confirmations: + confirmed: "Your email address has been successfully confirmed." + send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes." + send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes." + failure: + already_authenticated: "You are already signed in." + inactive: "Your account is not activated yet." + invalid: "Invalid %{authentication_keys} or password." + locked: "Your account is locked." + last_attempt: "You have one more attempt before your account is locked." + not_found_in_database: "Invalid %{authentication_keys} or password." + timeout: "Your session expired. Please sign in again to continue." + unauthenticated: "You need to sign in or sign up before continuing." + unconfirmed: "You have to confirm your email address before continuing." + mailer: + confirmation_instructions: + subject: "Confirmation instructions" + reset_password_instructions: + subject: "Reset password instructions" + unlock_instructions: + subject: "Unlock instructions" + email_changed: + subject: "Email Changed" + password_change: + subject: "Password Changed" + omniauth_callbacks: + failure: "Could not authenticate you from %{kind} because \"%{reason}\"." + success: "Successfully authenticated from %{kind} account." + passwords: + no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." + send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes." + send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." + updated: "Your password has been changed successfully. You are now signed in." + updated_not_active: "Your password has been changed successfully." + registrations: + destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon." + signed_up: "Welcome! You have signed up successfully." + signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." + signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." + signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account." + update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address." + updated: "Your account has been updated successfully." + updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again." + sessions: + signed_in: "Signed in successfully." + signed_out: "Signed out successfully." + already_signed_out: "Signed out successfully." + unlocks: + send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes." + send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes." + unlocked: "Your account has been unlocked successfully. Please sign in to continue." + errors: + messages: + already_confirmed: "was already confirmed, please try signing in" + confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" + expired: "has expired, please request a new one" + not_found: "not found" + not_locked: "was not locked" + not_saved: + one: "1 error prohibited this %{resource} from being saved:" + other: "%{count} errors prohibited this %{resource} from being saved:" diff --git a/RoR_App/aicruit-admin/config/locales/en.yml b/RoR_App/aicruit-admin/config/locales/en.yml new file mode 100644 index 0000000..6c349ae --- /dev/null +++ b/RoR_App/aicruit-admin/config/locales/en.yml @@ -0,0 +1,31 @@ +# Files in the config/locales directory are used for internationalization and +# are automatically loaded by Rails. If you want to use locales other than +# English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t "hello" +# +# In views, this is aliased to just `t`: +# +# <%= t("hello") %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more about the API, please read the Rails Internationalization guide +# at https://guides.rubyonrails.org/i18n.html. +# +# Be aware that YAML interprets the following case-insensitive strings as +# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings +# must be quoted to be interpreted as strings. For example: +# +# en: +# "yes": yup +# enabled: "ON" + +en: + hello: "Hello world" diff --git a/RoR_App/aicruit-admin/config/puma.rb b/RoR_App/aicruit-admin/config/puma.rb new file mode 100644 index 0000000..a248513 --- /dev/null +++ b/RoR_App/aicruit-admin/config/puma.rb @@ -0,0 +1,41 @@ +# This configuration file will be evaluated by Puma. The top-level methods that +# are invoked here are part of Puma's configuration DSL. For more information +# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. +# +# Puma starts a configurable number of processes (workers) and each process +# serves each request in a thread from an internal thread pool. +# +# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You +# should only set this value when you want to run 2 or more workers. The +# default is already 1. +# +# The ideal number of threads per worker depends both on how much time the +# application spends waiting for IO operations and on how much you wish to +# prioritize throughput over latency. +# +# As a rule of thumb, increasing the number of threads will increase how much +# traffic a given process can handle (throughput), but due to CRuby's +# Global VM Lock (GVL) it has diminishing returns and will degrade the +# response time (latency) of the application. +# +# The default is set to 3 threads as it's deemed a decent compromise between +# throughput and latency for the average Rails application. +# +# Any libraries that use a connection pool or another resource pool should +# be configured to provide at least as many connections as the number of +# threads. This includes Active Record's `pool` parameter in `database.yml`. +threads_count = ENV.fetch("RAILS_MAX_THREADS", 3) +threads threads_count, threads_count + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +port ENV.fetch("PORT", 3000) + +# Allow puma to be restarted by `bin/rails restart` command. +plugin :tmp_restart + +# Run the Solid Queue supervisor inside of Puma for single-server deployments +plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] + +# Specify the PID file. Defaults to tmp/pids/server.pid in development. +# In other environments, only set the PID file if requested. +pidfile ENV["PIDFILE"] if ENV["PIDFILE"] diff --git a/RoR_App/aicruit-admin/config/queue.yml b/RoR_App/aicruit-admin/config/queue.yml new file mode 100644 index 0000000..9eace59 --- /dev/null +++ b/RoR_App/aicruit-admin/config/queue.yml @@ -0,0 +1,18 @@ +default: &default + dispatchers: + - polling_interval: 1 + batch_size: 500 + workers: + - queues: "*" + threads: 3 + processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %> + polling_interval: 0.1 + +development: + <<: *default + +test: + <<: *default + +production: + <<: *default diff --git a/RoR_App/aicruit-admin/config/recurring.yml b/RoR_App/aicruit-admin/config/recurring.yml new file mode 100644 index 0000000..d045b19 --- /dev/null +++ b/RoR_App/aicruit-admin/config/recurring.yml @@ -0,0 +1,10 @@ +# production: +# periodic_cleanup: +# class: CleanSoftDeletedRecordsJob +# queue: background +# args: [ 1000, { batch_size: 500 } ] +# schedule: every hour +# periodic_command: +# command: "SoftDeletedRecord.due.delete_all" +# priority: 2 +# schedule: at 5am every day diff --git a/RoR_App/aicruit-admin/config/routes.rb b/RoR_App/aicruit-admin/config/routes.rb new file mode 100644 index 0000000..9fb1bbd --- /dev/null +++ b/RoR_App/aicruit-admin/config/routes.rb @@ -0,0 +1,40 @@ +Rails.application.routes.draw do + devise_for :users # , path: 'auth', path_names: { sign_in: 'login', sign_out: 'logout' } + # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html + + # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. + # Can be used by load balancers and uptime monitors to verify that the app is live. + get "up" => "rails/health#show", as: :rails_health_check + + # Render dynamic PWA files from app/views/pwa/* (remember to link manifest in application.html.erb) + # get "manifest" => "rails/pwa#manifest", as: :pwa_manifest + # get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker + + # Defines the root path route ("/") + # root "home#index" + devise_scope :user do + root to: "devise/sessions#new" + end + + get "home/index", to: 'home#index' + + namespace :admin do + get "dashboard/index", to: 'dashboard#index' + # get "user/new", to:'user#new' + # post "user/create", to:'user#create' + # get "user/edit", to:'user#edit' + # patch "user/update", to:'user#update' + # delete "user/delete", to:'user#destroy' + # get "user/show/:id", to:'user#show', as: 'user/show' + end + + resources :users, only: [:new, :create, :show, :edit, :update, :destroy] + + resources :resume_analyses, except: [:edit] do + member do + post :approve + end + end + + +end diff --git a/RoR_App/aicruit-admin/config/storage.yml b/RoR_App/aicruit-admin/config/storage.yml new file mode 100644 index 0000000..4942ab6 --- /dev/null +++ b/RoR_App/aicruit-admin/config/storage.yml @@ -0,0 +1,34 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) +# amazon: +# service: S3 +# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> +# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> +# region: us-east-1 +# bucket: your_own_bucket-<%= Rails.env %> + +# Remember not to checkin your GCS keyfile to a repository +# google: +# service: GCS +# project: your_project +# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> +# bucket: your_own_bucket-<%= Rails.env %> + +# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) +# microsoft: +# service: AzureStorage +# storage_account_name: your_account_name +# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> +# container: your_container_name-<%= Rails.env %> + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] diff --git a/RoR_App/aicruit-admin/db/cable_schema.rb b/RoR_App/aicruit-admin/db/cable_schema.rb new file mode 100644 index 0000000..2366660 --- /dev/null +++ b/RoR_App/aicruit-admin/db/cable_schema.rb @@ -0,0 +1,11 @@ +ActiveRecord::Schema[7.1].define(version: 1) do + create_table "solid_cable_messages", force: :cascade do |t| + t.binary "channel", limit: 1024, null: false + t.binary "payload", limit: 536870912, null: false + t.datetime "created_at", null: false + t.integer "channel_hash", limit: 8, null: false + t.index ["channel"], name: "index_solid_cable_messages_on_channel" + t.index ["channel_hash"], name: "index_solid_cable_messages_on_channel_hash" + t.index ["created_at"], name: "index_solid_cable_messages_on_created_at" + end +end diff --git a/RoR_App/aicruit-admin/db/cache_schema.rb b/RoR_App/aicruit-admin/db/cache_schema.rb new file mode 100644 index 0000000..6005a29 --- /dev/null +++ b/RoR_App/aicruit-admin/db/cache_schema.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +ActiveRecord::Schema[7.2].define(version: 1) do + create_table "solid_cache_entries", force: :cascade do |t| + t.binary "key", limit: 1024, null: false + t.binary "value", limit: 536870912, null: false + t.datetime "created_at", null: false + t.integer "key_hash", limit: 8, null: false + t.integer "byte_size", limit: 4, null: false + t.index ["byte_size"], name: "index_solid_cache_entries_on_byte_size" + t.index ["key_hash", "byte_size"], name: "index_solid_cache_entries_on_key_hash_and_byte_size" + t.index ["key_hash"], name: "index_solid_cache_entries_on_key_hash", unique: true + end +end diff --git a/RoR_App/aicruit-admin/db/migrate/20250115103535_create_roles.rb b/RoR_App/aicruit-admin/db/migrate/20250115103535_create_roles.rb new file mode 100644 index 0000000..f9dde13 --- /dev/null +++ b/RoR_App/aicruit-admin/db/migrate/20250115103535_create_roles.rb @@ -0,0 +1,9 @@ +class CreateRoles < ActiveRecord::Migration[8.0] + def change + create_table :roles do |t| + t.string :name + + t.timestamps + end + end +end diff --git a/RoR_App/aicruit-admin/db/migrate/20250115103550_create_companies.rb b/RoR_App/aicruit-admin/db/migrate/20250115103550_create_companies.rb new file mode 100644 index 0000000..2cfcf9a --- /dev/null +++ b/RoR_App/aicruit-admin/db/migrate/20250115103550_create_companies.rb @@ -0,0 +1,9 @@ +class CreateCompanies < ActiveRecord::Migration[8.0] + def change + create_table :companies do |t| + t.string :name + + t.timestamps + end + end +end diff --git a/RoR_App/aicruit-admin/db/migrate/20250115105900_devise_create_users.rb b/RoR_App/aicruit-admin/db/migrate/20250115105900_devise_create_users.rb new file mode 100644 index 0000000..55d0455 --- /dev/null +++ b/RoR_App/aicruit-admin/db/migrate/20250115105900_devise_create_users.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +class DeviseCreateUsers < ActiveRecord::Migration[8.0] + def change + create_table :users do |t| + ## Database authenticatable + t.string :email, null: false, default: "" + t.string :encrypted_password, null: false, default: "" + + ## Recoverable + t.string :reset_password_token + t.datetime :reset_password_sent_at + + ## Rememberable + t.datetime :remember_created_at + + ## Trackable + # t.integer :sign_in_count, default: 0, null: false + # t.datetime :current_sign_in_at + # t.datetime :last_sign_in_at + # t.string :current_sign_in_ip + # t.string :last_sign_in_ip + + ## Confirmable + # t.string :confirmation_token + # t.datetime :confirmed_at + # t.datetime :confirmation_sent_at + # t.string :unconfirmed_email # Only if using reconfirmable + + ## Lockable + # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts + # t.string :unlock_token # Only if unlock strategy is :email or :both + # t.datetime :locked_at + + ## Custom fields + t.references :company, null: false, foreign_key: true + t.references :role, null: false, foreign_key: true + t.string :first_name + t.string :last_name + t.string :contact_number + + + t.timestamps null: false + end + + add_index :users, :email, unique: true + add_index :users, :reset_password_token, unique: true + # add_index :users, :confirmation_token, unique: true + # add_index :users, :unlock_token, unique: true + end +end diff --git a/RoR_App/aicruit-admin/db/migrate/20250117055334_create_jds.rb b/RoR_App/aicruit-admin/db/migrate/20250117055334_create_jds.rb new file mode 100644 index 0000000..edb88c3 --- /dev/null +++ b/RoR_App/aicruit-admin/db/migrate/20250117055334_create_jds.rb @@ -0,0 +1,19 @@ +class CreateJds < ActiveRecord::Migration[8.0] + def change + create_table :jds do |t| + t.integer :user_id + t.integer :company_id + t.string :title + t.string :link_to_file + t.string :status, default: 'open' + t.json :parsed_data, default: {} + + t.timestamps + end + + # Adding foreign key constraints + add_foreign_key :jds, :users, column: :user_id, primary_key: :id + add_foreign_key :jds, :companies, column: :company_id, primary_key: :id + + end +end diff --git a/RoR_App/aicruit-admin/db/migrate/20250117062052_create_resumes.rb b/RoR_App/aicruit-admin/db/migrate/20250117062052_create_resumes.rb new file mode 100644 index 0000000..058c322 --- /dev/null +++ b/RoR_App/aicruit-admin/db/migrate/20250117062052_create_resumes.rb @@ -0,0 +1,24 @@ +class CreateResumes < ActiveRecord::Migration[8.0] + def change + create_table :resumes do |t| + t.integer :jd_id + t.string :candidate_name + t.string :link_to_file + t.boolean :is_interviewed, default: false + t.string :primary_skills + t.string :secondary_skills + t.string :responsibilities + t.integer :years_of_experience + t.string :projects + t.json :parsed_data, default: {} + t.integer :uploaded_by + + t.timestamps + end + + # Adding foreign key constraints + add_foreign_key :resumes, :jds, column: :jd_id, primary_key: :id + add_foreign_key :resumes, :users, column: :uploaded_by, primary_key: :id + + end +end diff --git a/RoR_App/aicruit-admin/db/migrate/20250120054233_create_resume_analyses.rb b/RoR_App/aicruit-admin/db/migrate/20250120054233_create_resume_analyses.rb new file mode 100644 index 0000000..11002ec --- /dev/null +++ b/RoR_App/aicruit-admin/db/migrate/20250120054233_create_resume_analyses.rb @@ -0,0 +1,18 @@ +class CreateResumeAnalyses < ActiveRecord::Migration[8.0] + def change + create_table :resume_analyses do |t| + t.string :ratings + t.integer :jd_id + t.integer :resume_id + t.string :matching_skills + t.string :missing_skills + t.string :additional_skills + + t.timestamps + end + + # Add foreign key constraints + add_foreign_key :resume_analyses, :jds, column: :jd_id, primary_key: :id + add_foreign_key :resume_analyses, :resumes, column: :resume_id, primary_key: :id + end +end diff --git a/RoR_App/aicruit-admin/db/queue_schema.rb b/RoR_App/aicruit-admin/db/queue_schema.rb new file mode 100644 index 0000000..85194b6 --- /dev/null +++ b/RoR_App/aicruit-admin/db/queue_schema.rb @@ -0,0 +1,129 @@ +ActiveRecord::Schema[7.1].define(version: 1) do + create_table "solid_queue_blocked_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "queue_name", null: false + t.integer "priority", default: 0, null: false + t.string "concurrency_key", null: false + t.datetime "expires_at", null: false + t.datetime "created_at", null: false + t.index [ "concurrency_key", "priority", "job_id" ], name: "index_solid_queue_blocked_executions_for_release" + t.index [ "expires_at", "concurrency_key" ], name: "index_solid_queue_blocked_executions_for_maintenance" + t.index [ "job_id" ], name: "index_solid_queue_blocked_executions_on_job_id", unique: true + end + + create_table "solid_queue_claimed_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.bigint "process_id" + t.datetime "created_at", null: false + t.index [ "job_id" ], name: "index_solid_queue_claimed_executions_on_job_id", unique: true + t.index [ "process_id", "job_id" ], name: "index_solid_queue_claimed_executions_on_process_id_and_job_id" + end + + create_table "solid_queue_failed_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.text "error" + t.datetime "created_at", null: false + t.index [ "job_id" ], name: "index_solid_queue_failed_executions_on_job_id", unique: true + end + + create_table "solid_queue_jobs", force: :cascade do |t| + t.string "queue_name", null: false + t.string "class_name", null: false + t.text "arguments" + t.integer "priority", default: 0, null: false + t.string "active_job_id" + t.datetime "scheduled_at" + t.datetime "finished_at" + t.string "concurrency_key" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index [ "active_job_id" ], name: "index_solid_queue_jobs_on_active_job_id" + t.index [ "class_name" ], name: "index_solid_queue_jobs_on_class_name" + t.index [ "finished_at" ], name: "index_solid_queue_jobs_on_finished_at" + t.index [ "queue_name", "finished_at" ], name: "index_solid_queue_jobs_for_filtering" + t.index [ "scheduled_at", "finished_at" ], name: "index_solid_queue_jobs_for_alerting" + end + + create_table "solid_queue_pauses", force: :cascade do |t| + t.string "queue_name", null: false + t.datetime "created_at", null: false + t.index [ "queue_name" ], name: "index_solid_queue_pauses_on_queue_name", unique: true + end + + create_table "solid_queue_processes", force: :cascade do |t| + t.string "kind", null: false + t.datetime "last_heartbeat_at", null: false + t.bigint "supervisor_id" + t.integer "pid", null: false + t.string "hostname" + t.text "metadata" + t.datetime "created_at", null: false + t.string "name", null: false + t.index [ "last_heartbeat_at" ], name: "index_solid_queue_processes_on_last_heartbeat_at" + t.index [ "name", "supervisor_id" ], name: "index_solid_queue_processes_on_name_and_supervisor_id", unique: true + t.index [ "supervisor_id" ], name: "index_solid_queue_processes_on_supervisor_id" + end + + create_table "solid_queue_ready_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "queue_name", null: false + t.integer "priority", default: 0, null: false + t.datetime "created_at", null: false + t.index [ "job_id" ], name: "index_solid_queue_ready_executions_on_job_id", unique: true + t.index [ "priority", "job_id" ], name: "index_solid_queue_poll_all" + t.index [ "queue_name", "priority", "job_id" ], name: "index_solid_queue_poll_by_queue" + end + + create_table "solid_queue_recurring_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "task_key", null: false + t.datetime "run_at", null: false + t.datetime "created_at", null: false + t.index [ "job_id" ], name: "index_solid_queue_recurring_executions_on_job_id", unique: true + t.index [ "task_key", "run_at" ], name: "index_solid_queue_recurring_executions_on_task_key_and_run_at", unique: true + end + + create_table "solid_queue_recurring_tasks", force: :cascade do |t| + t.string "key", null: false + t.string "schedule", null: false + t.string "command", limit: 2048 + t.string "class_name" + t.text "arguments" + t.string "queue_name" + t.integer "priority", default: 0 + t.boolean "static", default: true, null: false + t.text "description" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index [ "key" ], name: "index_solid_queue_recurring_tasks_on_key", unique: true + t.index [ "static" ], name: "index_solid_queue_recurring_tasks_on_static" + end + + create_table "solid_queue_scheduled_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "queue_name", null: false + t.integer "priority", default: 0, null: false + t.datetime "scheduled_at", null: false + t.datetime "created_at", null: false + t.index [ "job_id" ], name: "index_solid_queue_scheduled_executions_on_job_id", unique: true + t.index [ "scheduled_at", "priority", "job_id" ], name: "index_solid_queue_dispatch_all" + end + + create_table "solid_queue_semaphores", force: :cascade do |t| + t.string "key", null: false + t.integer "value", default: 1, null: false + t.datetime "expires_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index [ "expires_at" ], name: "index_solid_queue_semaphores_on_expires_at" + t.index [ "key", "value" ], name: "index_solid_queue_semaphores_on_key_and_value" + t.index [ "key" ], name: "index_solid_queue_semaphores_on_key", unique: true + end + + add_foreign_key "solid_queue_blocked_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_claimed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_failed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_ready_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_recurring_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_scheduled_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade +end diff --git a/RoR_App/aicruit-admin/db/schema.rb b/RoR_App/aicruit-admin/db/schema.rb new file mode 100644 index 0000000..f7c8bd1 --- /dev/null +++ b/RoR_App/aicruit-admin/db/schema.rb @@ -0,0 +1,94 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema[8.0].define(version: 2025_01_20_054233) do + # These are extensions that must be enabled in order to support this database + enable_extension "pg_catalog.plpgsql" + + create_table "companies", force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "jds", force: :cascade do |t| + t.integer "user_id" + t.integer "company_id" + t.string "title" + t.string "link_to_file" + t.string "status", default: "open" + t.json "parsed_data", default: {} + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "resume_analyses", force: :cascade do |t| + t.string "ratings" + t.integer "jd_id" + t.integer "resume_id" + t.string "matching_skills" + t.string "missing_skills" + t.string "additional_skills" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "resumes", force: :cascade do |t| + t.integer "jd_id" + t.string "candidate_name" + t.string "link_to_file" + t.boolean "is_interviewed", default: false + t.string "primary_skills" + t.string "secondary_skills" + t.string "responsibilities" + t.integer "years_of_experience" + t.string "projects" + t.json "parsed_data", default: {} + t.integer "uploaded_by" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "roles", force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "users", force: :cascade do |t| + t.string "email", default: "", null: false + t.string "encrypted_password", default: "", null: false + t.string "reset_password_token" + t.datetime "reset_password_sent_at" + t.datetime "remember_created_at" + t.bigint "company_id", null: false + t.bigint "role_id", null: false + t.string "first_name" + t.string "last_name" + t.string "contact_number" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["company_id"], name: "index_users_on_company_id" + t.index ["email"], name: "index_users_on_email", unique: true + t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true + t.index ["role_id"], name: "index_users_on_role_id" + end + + add_foreign_key "jds", "companies" + add_foreign_key "jds", "users" + add_foreign_key "resume_analyses", "jds" + add_foreign_key "resume_analyses", "resumes" + add_foreign_key "resumes", "jds" + add_foreign_key "resumes", "users", column: "uploaded_by" + add_foreign_key "users", "companies" + add_foreign_key "users", "roles" +end diff --git a/RoR_App/aicruit-admin/db/seeds.rb b/RoR_App/aicruit-admin/db/seeds.rb new file mode 100644 index 0000000..4fbd6ed --- /dev/null +++ b/RoR_App/aicruit-admin/db/seeds.rb @@ -0,0 +1,9 @@ +# This file should ensure the existence of records required to run the application in every environment (production, +# development, test). The code here should be idempotent so that it can be executed at any point in every environment. +# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). +# +# Example: +# +# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name| +# MovieGenre.find_or_create_by!(name: genre_name) +# end diff --git a/RoR_App/aicruit-admin/lib/tasks/.keep b/RoR_App/aicruit-admin/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/log/.keep b/RoR_App/aicruit-admin/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/public/400.html b/RoR_App/aicruit-admin/public/400.html new file mode 100644 index 0000000..282dbc8 --- /dev/null +++ b/RoR_App/aicruit-admin/public/400.html @@ -0,0 +1,114 @@ + + + + + + + The server cannot process the request due to a client error (400 Bad Request) + + + + + + + + + + + + + +
+
+ +
+
+

The server cannot process the request due to a client error. Please check the request and try again. If you’re the application owner check the logs for more information.

+
+
+ + + + diff --git a/RoR_App/aicruit-admin/public/404.html b/RoR_App/aicruit-admin/public/404.html new file mode 100644 index 0000000..c0670bc --- /dev/null +++ b/RoR_App/aicruit-admin/public/404.html @@ -0,0 +1,114 @@ + + + + + + + The page you were looking for doesn’t exist (404 Not found) + + + + + + + + + + + + + +
+
+ +
+
+

The page you were looking for doesn’t exist. You may have mistyped the address or the page may have moved. If you’re the application owner check the logs for more information.

+
+
+ + + + diff --git a/RoR_App/aicruit-admin/public/406-unsupported-browser.html b/RoR_App/aicruit-admin/public/406-unsupported-browser.html new file mode 100644 index 0000000..9532a9c --- /dev/null +++ b/RoR_App/aicruit-admin/public/406-unsupported-browser.html @@ -0,0 +1,114 @@ + + + + + + + Your browser is not supported (406 Not Acceptable) + + + + + + + + + + + + + +
+
+ +
+
+

Your browser is not supported.
Please upgrade your browser to continue.

+
+
+ + + + diff --git a/RoR_App/aicruit-admin/public/422.html b/RoR_App/aicruit-admin/public/422.html new file mode 100644 index 0000000..8bcf060 --- /dev/null +++ b/RoR_App/aicruit-admin/public/422.html @@ -0,0 +1,114 @@ + + + + + + + The change you wanted was rejected (422 Unprocessable Entity) + + + + + + + + + + + + + +
+
+ +
+
+

The change you wanted was rejected. Maybe you tried to change something you didn’t have access to. If you’re the application owner check the logs for more information.

+
+
+ + + + diff --git a/RoR_App/aicruit-admin/public/500.html b/RoR_App/aicruit-admin/public/500.html new file mode 100644 index 0000000..d77718c --- /dev/null +++ b/RoR_App/aicruit-admin/public/500.html @@ -0,0 +1,114 @@ + + + + + + + We’re sorry, but something went wrong (500 Internal Server Error) + + + + + + + + + + + + + +
+
+ +
+
+

We’re sorry, but something went wrong.
If you’re the application owner check the logs for more information.

+
+
+ + + + diff --git a/RoR_App/aicruit-admin/public/icon.png b/RoR_App/aicruit-admin/public/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c4c9dbfbbd2f7c1421ffd5727188146213abbcef GIT binary patch literal 4166 zcmd6qU;WFw?|v@m)Sk^&NvB8tcujdV-r1b=i(NJxn&7{KTb zX$3(M+3TP2o^#KAo{#tIjl&t~(8D-k004kqPglzn0HFG(Q~(I*AKsD#M*g7!XK0T7 zN6P7j>HcT8rZgKl$v!xr806dyN19Bd4C0x_R*I-a?#zsTvb_89cyhuC&T**i|Rc zq5b8M;+{8KvoJ~uj9`u~d_f6`V&3+&ZX9x5pc8s)d175;@pjm(?dapmBcm0&vl9+W zx1ZD2o^nuyUHWj|^A8r>lUorO`wFF;>9XL-Jy!P}UXC{(z!FO%SH~8k`#|9;Q|eue zqWL0^Bp(fg_+Pkm!fDKRSY;+^@BF?AJE zCUWpXPst~hi_~u)SzYBDZroR+Z4xeHIlm_3Yc_9nZ(o_gg!jDgVa=E}Y8uDgem9`b zf=mfJ_@(BXSkW53B)F2s!&?_R4ptb1fYXlF++@vPhd=marQgEGRZS@B4g1Mu?euknL= z67P~tZ?*>-Hmi7GwlisNHHJDku-dSm7g@!=a}9cSL6Pa^w^2?&?$Oi8ibrr>w)xqx zOH_EMU@m05)9kuNR>>4@H%|){U$^yvVQ(YgOlh;5oU_-vivG-p4=LrN-k7D?*?u1u zsWly%tfAzKd6Fb=`eU2un_uaTXmcT#tlOL+aRS=kZZf}A7qT8lvcTx~7j` z*b>=z)mwg7%B2_!D0!1IZ?Nq{^Y$uI4Qx*6T!E2Col&2{k?ImCO=dD~A&9f9diXy^$x{6CwkBimn|1E09 zAMSezYtiL?O6hS37KpvDM?22&d{l)7h-!F)C-d3j8Z`c@($?mfd{R82)H>Qe`h{~G z!I}(2j(|49{LR?w4Jspl_i!(4T{31|dqCOpI52r5NhxYV+cDAu(xp*4iqZ2e-$YP= zoFOPmm|u*7C?S{Fp43y+V;>~@FFR76bCl@pTtyB93vNWy5yf;HKr8^0d7&GVIslYm zo3Tgt@M!`8B6I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HcmV?d00001 diff --git a/RoR_App/aicruit-admin/public/icon.svg b/RoR_App/aicruit-admin/public/icon.svg new file mode 100644 index 0000000..04b34bf --- /dev/null +++ b/RoR_App/aicruit-admin/public/icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/RoR_App/aicruit-admin/public/robots.txt b/RoR_App/aicruit-admin/public/robots.txt new file mode 100644 index 0000000..c19f78a --- /dev/null +++ b/RoR_App/aicruit-admin/public/robots.txt @@ -0,0 +1 @@ +# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/RoR_App/aicruit-admin/script/.keep b/RoR_App/aicruit-admin/script/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/spec/models/resume_analysis_spec.rb b/RoR_App/aicruit-admin/spec/models/resume_analysis_spec.rb new file mode 100644 index 0000000..41333d3 --- /dev/null +++ b/RoR_App/aicruit-admin/spec/models/resume_analysis_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe ResumeAnalysis, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/RoR_App/aicruit-admin/spec/rails_helper.rb b/RoR_App/aicruit-admin/spec/rails_helper.rb new file mode 100644 index 0000000..083dc11 --- /dev/null +++ b/RoR_App/aicruit-admin/spec/rails_helper.rb @@ -0,0 +1,70 @@ +# This file is copied to spec/ when you run 'rails generate rspec:install' +require 'spec_helper' +ENV['RAILS_ENV'] ||= 'test' +require_relative '../config/environment' +# Prevent database truncation if the environment is production +abort("The Rails environment is running in production mode!") if Rails.env.production? +# Uncomment the line below in case you have `--require rails_helper` in the `.rspec` file +# that will avoid rails generators crashing because migrations haven't been run yet +# return unless Rails.env.test? +require 'rspec/rails' +# Add additional requires below this line. Rails is not loaded until this point! + +# Requires supporting ruby files with custom matchers and macros, etc, in +# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are +# run as spec files by default. This means that files in spec/support that end +# in _spec.rb will both be required and run as specs, causing the specs to be +# run twice. It is recommended that you do not name files matching this glob to +# end with _spec.rb. You can configure this pattern with the --pattern +# option on the command line or in ~/.rspec, .rspec or `.rspec-local`. +# +# The following line is provided for convenience purposes. It has the downside +# of increasing the boot-up time by auto-requiring all files in the support +# directory. Alternatively, in the individual `*_spec.rb` files, manually +# require only the support files necessary. +# +# Rails.root.glob('spec/support/**/*.rb').sort_by(&:to_s).each { |f| require f } + +# Checks for pending migrations and applies them before tests are run. +# If you are not using ActiveRecord, you can remove these lines. +begin + ActiveRecord::Migration.maintain_test_schema! +rescue ActiveRecord::PendingMigrationError => e + abort e.to_s.strip +end +RSpec.configure do |config| + # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures + config.fixture_paths = [ + Rails.root.join('spec/fixtures') + ] + + # If you're not using ActiveRecord, or you'd prefer not to run each of your + # examples within a transaction, remove the following line or assign false + # instead of true. + config.use_transactional_fixtures = true + + # You can uncomment this line to turn off ActiveRecord support entirely. + # config.use_active_record = false + + # RSpec Rails uses metadata to mix in different behaviours to your tests, + # for example enabling you to call `get` and `post` in request specs. e.g.: + # + # RSpec.describe UsersController, type: :request do + # # ... + # end + # + # The different available types are documented in the features, such as in + # https://rspec.info/features/7-0/rspec-rails + # + # You can also this infer these behaviours automatically by location, e.g. + # /spec/models would pull in the same behaviour as `type: :model` but this + # behaviour is considered legacy and will be removed in a future version. + # + # To enable this behaviour uncomment the line below. + # config.infer_spec_type_from_file_location! + + # Filter lines from Rails gems in backtraces. + config.filter_rails_from_backtrace! + # arbitrary gems may also be filtered via: + # config.filter_gems_from_backtrace("gem name") +end diff --git a/RoR_App/aicruit-admin/spec/spec_helper.rb b/RoR_App/aicruit-admin/spec/spec_helper.rb new file mode 100644 index 0000000..327b58e --- /dev/null +++ b/RoR_App/aicruit-admin/spec/spec_helper.rb @@ -0,0 +1,94 @@ +# This file was generated by the `rails generate rspec:install` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + + # This option will default to `:apply_to_host_groups` in RSpec 4 (and will + # have no way to turn it off -- the option exists only for backwards + # compatibility in RSpec 3). It causes shared context metadata to be + # inherited by the metadata hash of host groups and examples, rather than + # triggering implicit auto-inclusion in groups with matching metadata. + config.shared_context_metadata_behavior = :apply_to_host_groups + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # This allows you to limit a spec run to individual examples or groups + # you care about by tagging them with `:focus` metadata. When nothing + # is tagged with `:focus`, all examples get run. RSpec also provides + # aliases for `it`, `describe`, and `context` that include `:focus` + # metadata: `fit`, `fdescribe` and `fcontext`, respectively. + config.filter_run_when_matching :focus + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # https://rspec.info/features/3-12/rspec-core/configuration/zero-monkey-patching-mode/ + config.disable_monkey_patching! + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = "doc" + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end diff --git a/RoR_App/aicruit-admin/storage/.keep b/RoR_App/aicruit-admin/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/test/application_system_test_case.rb b/RoR_App/aicruit-admin/test/application_system_test_case.rb new file mode 100644 index 0000000..cee29fd --- /dev/null +++ b/RoR_App/aicruit-admin/test/application_system_test_case.rb @@ -0,0 +1,5 @@ +require "test_helper" + +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase + driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ] +end diff --git a/RoR_App/aicruit-admin/test/controllers/.keep b/RoR_App/aicruit-admin/test/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/test/fixtures/files/.keep b/RoR_App/aicruit-admin/test/fixtures/files/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/test/fixtures/jds.yml b/RoR_App/aicruit-admin/test/fixtures/jds.yml new file mode 100644 index 0000000..f1aee6e --- /dev/null +++ b/RoR_App/aicruit-admin/test/fixtures/jds.yml @@ -0,0 +1,17 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + user_id: MyString + company_id: MyString + title: MyString + link_to_file: MyString + status: 1 + parsed_data: + +two: + user_id: MyString + company_id: MyString + title: MyString + link_to_file: MyString + status: 1 + parsed_data: diff --git a/RoR_App/aicruit-admin/test/fixtures/resumes.yml b/RoR_App/aicruit-admin/test/fixtures/resumes.yml new file mode 100644 index 0000000..f13711a --- /dev/null +++ b/RoR_App/aicruit-admin/test/fixtures/resumes.yml @@ -0,0 +1,27 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + jd_id: MyString + candidate_name: MyString + link_to_file: MyString + is_interviewed: false + primary_skills: MyString + secondary_skills: MyString + responsibilities: MyString + years_of_experience: 1 + projects: MyString + parsed_data: + uploaded_by: 1 + +two: + jd_id: MyString + candidate_name: MyString + link_to_file: MyString + is_interviewed: false + primary_skills: MyString + secondary_skills: MyString + responsibilities: MyString + years_of_experience: 1 + projects: MyString + parsed_data: + uploaded_by: 1 diff --git a/RoR_App/aicruit-admin/test/fixtures/users.yml b/RoR_App/aicruit-admin/test/fixtures/users.yml new file mode 100644 index 0000000..d7a3329 --- /dev/null +++ b/RoR_App/aicruit-admin/test/fixtures/users.yml @@ -0,0 +1,11 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the "{}" from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/RoR_App/aicruit-admin/test/helpers/.keep b/RoR_App/aicruit-admin/test/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/test/integration/.keep b/RoR_App/aicruit-admin/test/integration/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/test/mailers/.keep b/RoR_App/aicruit-admin/test/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/test/models/.keep b/RoR_App/aicruit-admin/test/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/test/models/jd_test.rb b/RoR_App/aicruit-admin/test/models/jd_test.rb new file mode 100644 index 0000000..73fdff7 --- /dev/null +++ b/RoR_App/aicruit-admin/test/models/jd_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class JdTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/RoR_App/aicruit-admin/test/models/resume_test.rb b/RoR_App/aicruit-admin/test/models/resume_test.rb new file mode 100644 index 0000000..5b75fef --- /dev/null +++ b/RoR_App/aicruit-admin/test/models/resume_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class ResumeTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/RoR_App/aicruit-admin/test/models/user_test.rb b/RoR_App/aicruit-admin/test/models/user_test.rb new file mode 100644 index 0000000..5c07f49 --- /dev/null +++ b/RoR_App/aicruit-admin/test/models/user_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class UserTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/RoR_App/aicruit-admin/test/system/.keep b/RoR_App/aicruit-admin/test/system/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/test/test_helper.rb b/RoR_App/aicruit-admin/test/test_helper.rb new file mode 100644 index 0000000..0c22470 --- /dev/null +++ b/RoR_App/aicruit-admin/test/test_helper.rb @@ -0,0 +1,15 @@ +ENV["RAILS_ENV"] ||= "test" +require_relative "../config/environment" +require "rails/test_help" + +module ActiveSupport + class TestCase + # Run tests in parallel with specified workers + parallelize(workers: :number_of_processors) + + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all + + # Add more helper methods to be used by all tests here... + end +end diff --git a/RoR_App/aicruit-admin/tmp/.keep b/RoR_App/aicruit-admin/tmp/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/tmp/pids/.keep b/RoR_App/aicruit-admin/tmp/pids/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/tmp/storage/.keep b/RoR_App/aicruit-admin/tmp/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/vendor/.keep b/RoR_App/aicruit-admin/vendor/.keep new file mode 100644 index 0000000..e69de29 diff --git a/RoR_App/aicruit-admin/vendor/javascript/.keep b/RoR_App/aicruit-admin/vendor/javascript/.keep new file mode 100644 index 0000000..e69de29