├── log └── .keep ├── storage └── .keep ├── tmp ├── .keep ├── pids │ └── .keep └── storage │ └── .keep ├── lib ├── assets │ └── .keep ├── tasks │ └── .keep └── templates │ └── erb │ └── scaffold │ └── _form.html.erb ├── public ├── favicon.ico ├── apple-touch-icon.png ├── apple-touch-icon-precomposed.png ├── robots.txt ├── 422.html ├── 500.html └── 404.html ├── test ├── helpers │ └── .keep ├── mailers │ └── .keep ├── models │ ├── .keep │ ├── event_test.rb │ ├── user_test.rb │ ├── callback_test.rb │ ├── language_test.rb │ ├── message_test.rb │ ├── chat_room_test.rb │ ├── chat_request_test.rb │ └── user_language_test.rb ├── system │ └── .keep ├── controllers │ ├── .keep │ ├── events_controller_test.rb │ ├── users_controller_test.rb │ ├── messages_controller_test.rb │ ├── chat_rooms_controller_test.rb │ └── chat_requests_controller_test.rb ├── integration │ └── .keep ├── fixtures │ └── files │ │ └── .keep ├── application_system_test_case.rb ├── channels │ ├── chatroom_channel_test.rb │ └── application_cable │ │ └── connection_test.rb └── test_helper.rb ├── .ruby-version ├── app ├── assets │ ├── builds │ │ └── .keep │ ├── images │ │ ├── .keep │ │ ├── black.png │ │ ├── cover.png │ │ ├── github.png │ │ ├── ad-1 (1).jpg │ │ ├── ad-1 (2).jpg │ │ ├── ad-1 (3).jpg │ │ ├── favicon.ico │ │ ├── landing.jpg │ │ ├── landing2.jpg │ │ ├── terminal.png │ │ ├── userphoto.jpg │ │ ├── dev-work-icon.png │ │ └── userphoto_square.jpg │ ├── config │ │ └── manifest.js │ └── stylesheets │ │ ├── components │ │ ├── _alert.scss │ │ ├── _signup.scss │ │ ├── _index.scss │ │ ├── _footer.scss │ │ ├── _navbar.scss │ │ ├── _address_autocomplete.scss │ │ ├── _form_legend_clear.scss │ │ ├── _avatar.scss │ │ ├── _chat_request.scss │ │ ├── _chatroom.scss │ │ ├── _events.scss │ │ └── _sidebar.scss │ │ ├── config │ │ ├── _colors.scss │ │ ├── _fonts.scss │ │ └── _bootstrap_variables.scss │ │ ├── application.scss │ │ └── pages │ │ ├── _sign_in_info.scss │ │ ├── _event_show.scss │ │ ├── _profile.scss │ │ ├── _devise.scss │ │ ├── _home.scss │ │ └── _index.scss ├── models │ ├── concerns │ │ └── .keep │ ├── language.rb │ ├── application_record.rb │ ├── user_language.rb │ ├── message.rb │ ├── chat_room.rb │ ├── chat_request.rb │ ├── event.rb │ └── user.rb ├── controllers │ ├── concerns │ │ └── .keep │ ├── pages_controller.rb │ ├── callbacks_controller.rb │ ├── chat_rooms_controller.rb │ ├── messages_controller.rb │ ├── application_controller.rb │ ├── events_controller.rb │ ├── registrations_controller.rb │ ├── chat_requests_controller.rb │ └── users_controller.rb ├── views │ ├── shared │ │ ├── _navbar.html.erb │ │ ├── _flashes.html.erb │ │ ├── _sidebar.html.erb │ │ └── _footer.html.erb │ ├── users │ │ ├── show.html.erb │ │ ├── _form.html.erb │ │ ├── edit.html.erb │ │ ├── _info_window.html.erb │ │ ├── profile.html.erb │ │ ├── index.html.erb │ │ └── _user_card.html.erb │ ├── layouts │ │ ├── mailer.text.erb │ │ ├── mailer.html.erb │ │ └── application.html.erb │ ├── events │ │ ├── new.html.erb │ │ ├── show.html.erb │ │ ├── _form.html.erb │ │ └── index.html.erb │ ├── devise │ │ ├── mailer │ │ │ ├── password_change.html.erb │ │ │ ├── confirmation_instructions.html.erb │ │ │ ├── unlock_instructions.html.erb │ │ │ ├── email_changed.html.erb │ │ │ └── reset_password_instructions.html.erb │ │ ├── shared │ │ │ ├── _error_messages.html.erb │ │ │ └── _links.html.erb │ │ ├── unlocks │ │ │ └── new.html.erb │ │ ├── confirmations │ │ │ └── new.html.erb │ │ ├── passwords │ │ │ ├── new.html.erb │ │ │ └── edit.html.erb │ │ ├── sessions │ │ │ └── new.html.erb │ │ └── registrations │ │ │ ├── new.html.erb │ │ │ └── edit.html.erb │ ├── messages │ │ └── _message.html.erb │ ├── chat_requests │ │ ├── _chat_request.html.erb │ │ └── index.html.erb │ ├── pages │ │ └── home.html.erb │ └── chat_rooms │ │ ├── index.html.erb │ │ └── show.html.erb ├── helpers │ ├── application_helper.rb │ └── meta_tags_helper.rb ├── channels │ ├── application_cable │ │ ├── channel.rb │ │ └── connection.rb │ └── chatroom_channel.rb ├── mailers │ └── application_mailer.rb ├── javascript │ ├── controllers │ │ ├── hello_controller.js │ │ ├── application.js │ │ ├── sidebar_controller.js │ │ ├── index.js │ │ ├── address_autocomplete_controller.js │ │ ├── chatroom_subscription_controller.js │ │ └── map_controller.js │ ├── plugins │ │ └── flatpickr.js │ └── application.js └── jobs │ └── application_job.rb ├── Procfile.dev ├── bin ├── rake ├── rails ├── dev ├── setup └── bundle ├── config ├── initializers │ ├── default_meta.rb │ ├── redis.rb │ ├── filter_parameter_logging.rb │ ├── permissions_policy.rb │ ├── assets.rb │ ├── inflections.rb │ ├── content_security_policy.rb │ ├── geocoder.rb │ └── simple_form.rb ├── environment.rb ├── boot.rb ├── cable.yml ├── meta.yml ├── credentials.yml.enc ├── application.rb ├── locales │ ├── simple_form.en.yml │ ├── en.yml │ └── devise.en.yml ├── routes.rb ├── storage.yml ├── puma.rb ├── environments │ ├── test.rb │ ├── development.rb │ └── production.rb └── database.yml ├── .gitattributes ├── db ├── migrate │ ├── 20220905133921_remove_foreign_key.rb │ ├── 20220915074133_add_image_to_events.rb │ ├── 20220905143928_add_nickname_to_user.rb │ ├── 20220906112419_add_name_to_chatroom.rb │ ├── 20220906115331_add_location_to_users.rb │ ├── 20220913104557_add_linked_in_to_user.rb │ ├── 20220912103414_remove_column_from_events.rb │ ├── 20220908095017_add_name_to_users.rb │ ├── 20220912102948_add_reference_to_events.rb │ ├── 20220906124457_remove_column_from_chat_requests.rb │ ├── 20220906104711_revome_accepted_from_chat_requests.rb │ ├── 20220906103709_add_status_to_chat_request.rb │ ├── 20220908114607_add_omniauth_to_users.rb │ ├── 20220912084058_add_columns_to_users.rb │ ├── 20220906103140_add_coordinates_to_users.rb │ ├── 20220905124253_create_languages.rb │ ├── 20220912102920_create_events.rb │ ├── 20220905130041_create_chat_rooms.rb │ ├── 20220905132100_add_reference_to_chat_request.rb │ ├── 20220906124621_add_asker_and_receiver_to_chat_requests.rb │ ├── 20220905125736_create_chat_requests.rb │ ├── 20220905124554_create_user_languages.rb │ ├── 20220905130219_create_messages.rb │ ├── 20220912114524_add_new_columns_to_events.rb │ ├── 20220904200848_devise_create_users.rb │ └── 20220907115845_create_active_storage_tables.active_storage.rb └── schema.rb ├── config.ru ├── Rakefile ├── webpack.config.js ├── package.json ├── README.md ├── .rubocop.yml ├── .gitignore └── Gemfile /log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /storage/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/system/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/pids/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/storage/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 3.1.2 2 | -------------------------------------------------------------------------------- /app/assets/builds/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/shared/_navbar.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/users/show.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /app/views/events/new.html.erb: -------------------------------------------------------------------------------- 1 | <%= render "form" %> 2 | -------------------------------------------------------------------------------- /Procfile.dev: -------------------------------------------------------------------------------- 1 | web: bin/rails server -p 3000 2 | js: yarn build --watch 3 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/models/language.rb: -------------------------------------------------------------------------------- 1 | class Language < ApplicationRecord 2 | has_many :user_languages 3 | end 4 | -------------------------------------------------------------------------------- /app/assets/images/black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EleoXDA/Socialize_RB/HEAD/app/assets/images/black.png -------------------------------------------------------------------------------- /app/assets/images/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EleoXDA/Socialize_RB/HEAD/app/assets/images/cover.png -------------------------------------------------------------------------------- /app/assets/images/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EleoXDA/Socialize_RB/HEAD/app/assets/images/github.png -------------------------------------------------------------------------------- /app/assets/images/ad-1 (1).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EleoXDA/Socialize_RB/HEAD/app/assets/images/ad-1 (1).jpg -------------------------------------------------------------------------------- /app/assets/images/ad-1 (2).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EleoXDA/Socialize_RB/HEAD/app/assets/images/ad-1 (2).jpg -------------------------------------------------------------------------------- /app/assets/images/ad-1 (3).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EleoXDA/Socialize_RB/HEAD/app/assets/images/ad-1 (3).jpg -------------------------------------------------------------------------------- /app/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EleoXDA/Socialize_RB/HEAD/app/assets/images/favicon.ico -------------------------------------------------------------------------------- /app/assets/images/landing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EleoXDA/Socialize_RB/HEAD/app/assets/images/landing.jpg -------------------------------------------------------------------------------- /app/assets/images/landing2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EleoXDA/Socialize_RB/HEAD/app/assets/images/landing2.jpg -------------------------------------------------------------------------------- /app/assets/images/terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EleoXDA/Socialize_RB/HEAD/app/assets/images/terminal.png -------------------------------------------------------------------------------- /app/assets/images/userphoto.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EleoXDA/Socialize_RB/HEAD/app/assets/images/userphoto.jpg -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | primary_abstract_class 3 | end 4 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative "../config/boot" 3 | require "rake" 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../stylesheets .css 3 | //= link_tree ../builds 4 | -------------------------------------------------------------------------------- /app/assets/images/dev-work-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EleoXDA/Socialize_RB/HEAD/app/assets/images/dev-work-icon.png -------------------------------------------------------------------------------- /app/models/user_language.rb: -------------------------------------------------------------------------------- 1 | class UserLanguage < ApplicationRecord 2 | belongs_to :language 3 | belongs_to :user 4 | end 5 | -------------------------------------------------------------------------------- /app/assets/images/userphoto_square.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EleoXDA/Socialize_RB/HEAD/app/assets/images/userphoto_square.jpg -------------------------------------------------------------------------------- /app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /config/initializers/default_meta.rb: -------------------------------------------------------------------------------- 1 | # Initialize default meta tags. 2 | DEFAULT_META = YAML.load_file(Rails.root.join("config/meta.yml")) 3 | -------------------------------------------------------------------------------- /app/assets/stylesheets/components/_alert.scss: -------------------------------------------------------------------------------- 1 | .alert { 2 | position: fixed; 3 | bottom: 16px; 4 | right: 16px; 5 | z-index: 1000; 6 | } 7 | -------------------------------------------------------------------------------- /app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: "from@example.com" 3 | layout "mailer" 4 | end 5 | -------------------------------------------------------------------------------- /app/models/message.rb: -------------------------------------------------------------------------------- 1 | class Message < ApplicationRecord 2 | belongs_to :user 3 | belongs_to :chat_room 4 | validates :content, presence: true 5 | end 6 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path("../config/application", __dir__) 3 | require_relative "../config/boot" 4 | require "rails/commands" 5 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /test/models/event_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class EventTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files. 2 | 3 | db/schema.rb linguist-generated 4 | 5 | vendor/* linguist-vendored 6 | -------------------------------------------------------------------------------- /app/views/devise/mailer/password_change.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.email %>!

2 | 3 |

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

4 | -------------------------------------------------------------------------------- /test/models/callback_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class CallbackTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/language_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class LanguageTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/message_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class MessageTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /app/assets/stylesheets/components/_signup.scss: -------------------------------------------------------------------------------- 1 | .signup { 2 | h2 { 3 | text-align: center 4 | } 5 | } 6 | 7 | .form-control { 8 | border-radius: 15px; 9 | } 10 | -------------------------------------------------------------------------------- /app/models/chat_room.rb: -------------------------------------------------------------------------------- 1 | class ChatRoom < ApplicationRecord 2 | # belongs_to :chat_request 3 | has_many :messages, dependent: :destroy 4 | belongs_to :chat_request 5 | end 6 | -------------------------------------------------------------------------------- /test/models/chat_room_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ChatRoomTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /app/controllers/pages_controller.rb: -------------------------------------------------------------------------------- 1 | class PagesController < ApplicationController 2 | skip_before_action :authenticate_user!, only: [ :home ] 3 | 4 | def home 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20220905133921_remove_foreign_key.rb: -------------------------------------------------------------------------------- 1 | class RemoveForeignKey < ActiveRecord::Migration[7.0] 2 | def change 3 | remove_column :chat_requests, :user_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20220915074133_add_image_to_events.rb: -------------------------------------------------------------------------------- 1 | class AddImageToEvents < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :events, :image, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /test/models/chat_request_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ChatRequestTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/user_language_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class UserLanguageTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /db/migrate/20220905143928_add_nickname_to_user.rb: -------------------------------------------------------------------------------- 1 | class AddNicknameToUser < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :users, :nickname, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20220906112419_add_name_to_chatroom.rb: -------------------------------------------------------------------------------- 1 | class AddNameToChatroom < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :chat_rooms, :name, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20220906115331_add_location_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddLocationToUsers < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :users, :location, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20220913104557_add_linked_in_to_user.rb: -------------------------------------------------------------------------------- 1 | class AddLinkedInToUser < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :users, :linkedin_url, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20220912103414_remove_column_from_events.rb: -------------------------------------------------------------------------------- 1 | class RemoveColumnFromEvents < ActiveRecord::Migration[7.0] 2 | def change 3 | remove_column :events, :event_creator_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /bin/dev: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if ! foreman version &> /dev/null 4 | then 5 | echo "Installing foreman..." 6 | gem install foreman 7 | fi 8 | 9 | foreman start -f Procfile.dev "$@" 10 | -------------------------------------------------------------------------------- /db/migrate/20220908095017_add_name_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddNameToUsers < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :users, :name, :string, null: false, default: "" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20220912102948_add_reference_to_events.rb: -------------------------------------------------------------------------------- 1 | class AddReferenceToEvents < ActiveRecord::Migration[7.0] 2 | def change 3 | add_reference :events, :users, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /test/controllers/events_controller_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class EventsControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/controllers/users_controller_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class UsersControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20220906124457_remove_column_from_chat_requests.rb: -------------------------------------------------------------------------------- 1 | class RemoveColumnFromChatRequests < ActiveRecord::Migration[7.0] 2 | def change 3 | remove_column :chat_requests, :pinned 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400] 5 | end 6 | -------------------------------------------------------------------------------- /test/controllers/messages_controller_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class MessagesControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /config/initializers/redis.rb: -------------------------------------------------------------------------------- 1 | # config/initializers/redis.rb 2 | $redis = Redis.new( 3 | host: ENV['REDIS_HOST'] || 'localhost', 4 | port: ENV['REDIS_PORT'] || 6379, 5 | password: ENV['REDIS_PASSWORD'] 6 | ) 7 | -------------------------------------------------------------------------------- /test/controllers/chat_rooms_controller_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ChatRoomsControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/controllers/chat_requests_controller_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ChatRequestsControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20220906104711_revome_accepted_from_chat_requests.rb: -------------------------------------------------------------------------------- 1 | class RevomeAcceptedFromChatRequests < ActiveRecord::Migration[7.0] 2 | def change 3 | remove_column :chat_requests, :accepted, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/javascript/controllers/hello_controller.js: -------------------------------------------------------------------------------- 1 | import { Controller } from "@hotwired/stimulus" 2 | 3 | export default class extends Controller { 4 | connect() { 5 | this.element.textContent = "Hello World!" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /db/migrate/20220906103709_add_status_to_chat_request.rb: -------------------------------------------------------------------------------- 1 | class AddStatusToChatRequest < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :chat_requests, :status, :integer, default: 0, null: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20220908114607_add_omniauth_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddOmniauthToUsers < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :users, :provider, :string 4 | add_column :users, :uid, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20220912084058_add_columns_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddColumnsToUsers < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :users, :image, :string 4 | add_column :users, :html_url, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /db/migrate/20220906103140_add_coordinates_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddCoordinatesToUsers < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :users, :latitude, :float 4 | add_column :users, :longitude, :float 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /test/channels/chatroom_channel_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ChatroomChannelTest < ActionCable::Channel::TestCase 4 | # test "subscribes" do 5 | # subscribe 6 | # assert subscription.confirmed? 7 | # end 8 | end 9 | -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: redis://:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}/1 10 | channel_prefix: Socialize_production 11 | -------------------------------------------------------------------------------- /db/migrate/20220905124253_create_languages.rb: -------------------------------------------------------------------------------- 1 | class CreateLanguages < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :languages do |t| 4 | t.string :name 5 | 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/models/chat_request.rb: -------------------------------------------------------------------------------- 1 | class ChatRequest < ApplicationRecord 2 | belongs_to :asker, class_name: "User" 3 | belongs_to :receiver, class_name: "User" 4 | has_one :chat_room 5 | enum status: { pending: 0, confirmed: 1, rejected: -1 } 6 | end 7 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative "config/application" 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /app/assets/stylesheets/config/_colors.scss: -------------------------------------------------------------------------------- 1 | // Define variables for your color scheme 2 | 3 | // For example: 4 | $red: #FD1015; 5 | $blue: #0D6EFD; 6 | $yellow: #FFC65A; 7 | $orange: #E67E22; 8 | $green: #1EDD88; 9 | $gray: #0E0000; 10 | $light-gray: #F4F4F4; 11 | -------------------------------------------------------------------------------- /app/javascript/plugins/flatpickr.js: -------------------------------------------------------------------------------- 1 | // app/javascript/plugins/flatpickr.js 2 | import flatpickr from "flatpickr"; 3 | 4 | const initFlatpickr = () => { 5 | flatpickr(".datepicker", { 6 | enableTime: true 7 | }); 8 | } 9 | 10 | export { initFlatpickr }; 11 | -------------------------------------------------------------------------------- /app/views/devise/mailer/confirmation_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Welcome <%= @email %>!

2 | 3 |

You can confirm your account email through the link below:

4 | 5 |

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

6 | -------------------------------------------------------------------------------- /db/migrate/20220912102920_create_events.rb: -------------------------------------------------------------------------------- 1 | class CreateEvents < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :events do |t| 4 | t.string :title 5 | t.integer :event_creator_id 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/views/users/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= f.input :address, 2 | input_html: {data: {address_autocomplete_target: "address"}, class: "d-none", autocomplete: "off"}, 3 | wrapper_html: {data: {controller: "address-autocomplete", address_autocomplete_api_key_value: ENV["MAPBOX_API_KEY"]}} 4 | %> 5 | -------------------------------------------------------------------------------- /db/migrate/20220905130041_create_chat_rooms.rb: -------------------------------------------------------------------------------- 1 | class CreateChatRooms < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :chat_rooms do |t| 4 | t.references :chat_request, null: false, foreign_key: true 5 | 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/javascript/application.js: -------------------------------------------------------------------------------- 1 | // Entry point for the build script in your package.json 2 | import "@hotwired/turbo-rails" 3 | import "./controllers" 4 | import "bootstrap" 5 | // app/javascript/packs/application.js 6 | import { initFlatpickr } from "./plugins/flatpickr"; 7 | 8 | initFlatpickr(); 9 | -------------------------------------------------------------------------------- /app/javascript/controllers/application.js: -------------------------------------------------------------------------------- 1 | import { Application } from "@hotwired/stimulus" 2 | 3 | const application = Application.start() 4 | 5 | // Configure Stimulus development experience 6 | application.debug = false 7 | window.Stimulus = application 8 | 9 | export { application } 10 | -------------------------------------------------------------------------------- /db/migrate/20220905132100_add_reference_to_chat_request.rb: -------------------------------------------------------------------------------- 1 | class AddReferenceToChatRequest < ActiveRecord::Migration[7.0] 2 | def change 3 | add_reference :chat_requests, :asker, foreign_key: { to_table: :users } 4 | add_reference :chat_requests, :receiver, foreign_key: { to_table: :users } 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /db/migrate/20220906124621_add_asker_and_receiver_to_chat_requests.rb: -------------------------------------------------------------------------------- 1 | class AddAskerAndReceiverToChatRequests < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :chat_requests, :asker_is_pinned, :boolean, default: false 4 | add_column :chat_requests, :receiver_is_pinned, :boolean, default: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/channels/chatroom_channel.rb: -------------------------------------------------------------------------------- 1 | class ChatroomChannel < ApplicationCable::Channel 2 | def subscribed 3 | # stream_from "some_channel" 4 | chatroom = ChatRoom.find(params[:id]) 5 | stream_for chatroom 6 | end 7 | 8 | def unsubscribed 9 | # Any cleanup needed when channel is unsubscribed 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/assets/stylesheets/components/_index.scss: -------------------------------------------------------------------------------- 1 | // Import your components CSS files here. 2 | @import "alert"; 3 | @import "avatar"; 4 | @import "chatroom"; 5 | @import "form_legend_clear"; 6 | @import "navbar"; 7 | @import "signup"; 8 | @import "address_autocomplete"; 9 | @import "sidebar"; 10 | @import "chat_request"; 11 | @import "events"; 12 | -------------------------------------------------------------------------------- /app/controllers/callbacks_controller.rb: -------------------------------------------------------------------------------- 1 | # This has been added manually (not in terminal) - could be 2 | # a source of error later on 3 | 4 | class CallbacksController < Devise::OmniauthCallbacksController 5 | def github 6 | @user = User.from_omniauth(request.env["omniauth.auth"]) 7 | sign_in_and_redirect @user 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/views/devise/mailer/unlock_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.email %>!

2 | 3 |

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

4 | 5 |

Click the link below to unlock your account:

6 | 7 |

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

8 | -------------------------------------------------------------------------------- /db/migrate/20220905125736_create_chat_requests.rb: -------------------------------------------------------------------------------- 1 | class CreateChatRequests < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :chat_requests do |t| 4 | t.boolean :accepted 5 | t.boolean :pinned 6 | t.references :user, null: false, foreign_key: true 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /test/channels/application_cable/connection_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase 4 | # test "connects with cookies" do 5 | # cookies.signed[:user_id] = 42 6 | # 7 | # connect 8 | # 9 | # assert_equal connection.user_id, "42" 10 | # end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20220905124554_create_user_languages.rb: -------------------------------------------------------------------------------- 1 | class CreateUserLanguages < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :user_languages do |t| 4 | t.references :language, null: false, foreign_key: true 5 | t.references :user, null: false, foreign_key: true 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/controllers/chat_rooms_controller.rb: -------------------------------------------------------------------------------- 1 | class ChatRoomsController < ApplicationController 2 | def index 3 | @chatrooms = ChatRoom.all 4 | end 5 | 6 | 7 | def show 8 | if ChatRoom.exists?(params[:id]) 9 | @chatroom = ChatRoom.find(params[:id]) 10 | end 11 | @chatrooms = ChatRoom.all 12 | @message = Message.new 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /config/meta.yml: -------------------------------------------------------------------------------- 1 | meta_product_name: "Socialize!" 2 | meta_title: "Socialize! - The only Developers-Meetup in Web" 3 | meta_description: "With Socialize! you can find developers around and arrange a meet-up to talk about your work" 4 | meta_image: "cover.png" # should exist in `app/assets/images/` 5 | # twitter_account: "@product_twitter_account" # required for Twitter Cards 6 | -------------------------------------------------------------------------------- /db/migrate/20220905130219_create_messages.rb: -------------------------------------------------------------------------------- 1 | class CreateMessages < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :messages do |t| 4 | t.string :content 5 | t.references :user, null: false, foreign_key: true 6 | t.references :chat_room, null: false, foreign_key: true 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/views/devise/mailer/email_changed.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @email %>!

2 | 3 | <% if @resource.try(:unconfirmed_email?) %> 4 |

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

5 | <% else %> 6 |

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

7 | <% end %> 8 | -------------------------------------------------------------------------------- /app/assets/stylesheets/components/_footer.scss: -------------------------------------------------------------------------------- 1 | .footer-custom footer { 2 | color: white; 3 | background-color: rgb(62, 79, 131); 4 | } 5 | 6 | .footer-icon { 7 | color: white; 8 | padding: 0px 5px; 9 | font-size: 20px; 10 | } 11 | 12 | .footer-email { 13 | text-decoration:none; 14 | color:white; 15 | } 16 | .footer-email:hover { 17 | text-decoration:underline; 18 | color: white 19 | } 20 | -------------------------------------------------------------------------------- /db/migrate/20220912114524_add_new_columns_to_events.rb: -------------------------------------------------------------------------------- 1 | class AddNewColumnsToEvents < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :events, :theme, :string 4 | add_column :events, :price, :integer 5 | add_column :events, :description, :text 6 | add_column :events, :date, :date 7 | add_column :events, :time, :time 8 | add_column :events, :location, :string 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= "test" 2 | require_relative "../config/environment" 3 | require "rails/test_help" 4 | 5 | class ActiveSupport::TestCase 6 | # Run tests in parallel with specified workers 7 | parallelize(workers: :number_of_processors) 8 | 9 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 10 | fixtures :all 11 | 12 | # Add more helper methods to be used by all tests here... 13 | end 14 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure parameters to be filtered from the log file. Use this to limit dissemination of 4 | # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported 5 | # notations and behaviors. 6 | Rails.application.config.filter_parameters += [ 7 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 8 | ] 9 | -------------------------------------------------------------------------------- /config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # Define an application-wide HTTP permissions policy. For further 2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy 3 | # 4 | # Rails.application.config.permissions_policy do |f| 5 | # f.camera :none 6 | # f.gyroscope :none 7 | # f.microphone :none 8 | # f.usb :none 9 | # f.fullscreen :self 10 | # f.payment :self, "https://secure.example.com" 11 | # end 12 | -------------------------------------------------------------------------------- /app/views/devise/mailer/reset_password_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.email %>!

2 | 3 |

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

4 | 5 |

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

6 | 7 |

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

8 |

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

9 | -------------------------------------------------------------------------------- /config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | OCo8DQKf/SmiRldD2V8yf4wQFVScyejCdalXmlevU96SzBwyvhwDtBE/DNI8WBB9xjs6+kpNpv+81/nf8VE/qxHjIpVk4rU3ToZy/Bk/KFYXuhcgfJ58TNzga9a9vkB4GdQNXiSLCmndNzrqGePMavIxTso07JRJPJBM8NNXa2P6Ey/JJh3hu6AZPClszPCQ7sFx+/eAKOhT+RyHmZTZYzLCk+ui5Dh3iBNRmjCv4klUuoK1ZJLxbj9amnFZ6Bv6xiqMln+oPLUD+Lu+TNkS7+LqnfrNZz/i7OxSyJY7qf7OHya1qW0Za4EgkxIcMQlUapX1Fh2Xf/7MAQz6hoYlYUW/hSC+ziIdR4L0JpcmEIhv/4HW7XxW/kZnNz2p72LaRG0dHXT/+vUv7de7k1TD0M3xN/xzSReHZqR4--jvdwhskMZqNvIsKC--CbnwVz0snQZ4IA08D/LEzg== -------------------------------------------------------------------------------- /app/assets/stylesheets/components/_navbar.scss: -------------------------------------------------------------------------------- 1 | .navbar-lewagon { 2 | justify-content: space-between; 3 | background: white; 4 | } 5 | 6 | .navbar-lewagon .navbar-collapse { 7 | flex-grow: 0; 8 | } 9 | 10 | .navbar-lewagon .navbar-brand img { 11 | width: 40px; 12 | } 13 | 14 | .avatar{ 15 | border: 0px 16 | } 17 | 18 | .navbar{ 19 | background-color: rgba(255, 255, 255, 0.6); 20 | } 21 | 22 | .footer{ 23 | background-color: rgba(255, 255, 255, 0.6) !important; 24 | } 25 | -------------------------------------------------------------------------------- /app/models/event.rb: -------------------------------------------------------------------------------- 1 | require "open-uri" 2 | 3 | class Event < ApplicationRecord 4 | # after_create :set_default_event_avatar 5 | has_one_attached :photo 6 | 7 | # def set_default_event_avatar 8 | # return if photo.attached? 9 | 10 | # path = "https://res.cloudinary.com/dp6zhyocx/image/upload/v1662046666/pqwya0pvqts4ubv0eqi6.jpg" 11 | # file = URI.open(path) 12 | # photo.attach(io: file, filename: "userphoto.png", content_type: "image/png") 13 | # save 14 | # end 15 | end 16 | -------------------------------------------------------------------------------- /app/views/devise/shared/_error_messages.html.erb: -------------------------------------------------------------------------------- 1 | <% if resource.errors.any? %> 2 |
3 |

4 | <%= I18n.t("errors.messages.not_saved", 5 | count: resource.errors.count, 6 | resource: resource.class.model_name.human.downcase) 7 | %> 8 |

9 | 14 |
15 | <% end %> 16 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require("path") 2 | const webpack = require("webpack") 3 | 4 | module.exports = { 5 | mode: "production", 6 | devtool: "source-map", 7 | entry: { 8 | application: "./app/javascript/application.js" 9 | }, 10 | output: { 11 | filename: "[name].js", 12 | sourceMapFilename: "[file].map", 13 | path: path.resolve(__dirname, "app/assets/builds"), 14 | }, 15 | plugins: [ 16 | new webpack.optimize.LimitChunkCountPlugin({ 17 | maxChunks: 1 18 | }) 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /app/views/shared/_flashes.html.erb: -------------------------------------------------------------------------------- 1 | <% if notice %> 2 | 7 | <% end %> 8 | <% if alert %> 9 | 14 | <% end %> 15 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app", 3 | "private": "true", 4 | "dependencies": { 5 | "@hotwired/stimulus": "^3.1.0", 6 | "@hotwired/turbo-rails": "^7.1.3", 7 | "@mapbox/mapbox-gl-geocoder": "^5.0.1", 8 | "@popperjs/core": "^2.11.6", 9 | "@rails/actioncable": "^7.0.3-1", 10 | "bootstrap": "^5.2.0", 11 | "flatpickr": "^4.6.13", 12 | "sweetalert": "^2.1.2", 13 | "webpack": "^5.74.0", 14 | "webpack-cli": "^4.10.0" 15 | }, 16 | "scripts": { 17 | "build": "webpack --config webpack.config.js" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/assets/stylesheets/components/_address_autocomplete.scss: -------------------------------------------------------------------------------- 1 | .mapboxgl-ctrl-geocoder { 2 | max-width: none; 3 | width: 100%; 4 | border: 0px solid lightgrey; 5 | box-shadow: none; 6 | background-color: rgba(255, 255, 255, 0.8); ; 7 | } 8 | 9 | .mapboxgl-popup-content{ 10 | border-radius: 15px !important; 11 | text-align: center; 12 | font-family: 'Ubuntu', sans-serif; 13 | } 14 | 15 | .mapboxgl-popup-close-button { 16 | font-size: 16px; 17 | padding-right: 5px; 18 | } 19 | 20 | .mapboxgl-popup { 21 | min-width: fit-content; 22 | } 23 | -------------------------------------------------------------------------------- /app/assets/stylesheets/components/_form_legend_clear.scss: -------------------------------------------------------------------------------- 1 | // In bootstrap 5 legend floats left and requires the following element 2 | // to be cleared. In a radio button or checkbox group the element after 3 | // the legend will be the automatically generated hidden input; the fix 4 | // in https://github.com/twbs/bootstrap/pull/30345 applies to the hidden 5 | // input and has no visual effect. Here we try to fix matters by 6 | // applying the clear to the div wrapping the first following radio button 7 | // or checkbox. 8 | legend ~ div.form-check:first-of-type { 9 | clear: left; 10 | } 11 | -------------------------------------------------------------------------------- /lib/templates/erb/scaffold/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%# frozen_string_literal: true %> 2 | <%%= simple_form_for(@<%= singular_table_name %>) do |f| %> 3 | <%%= f.error_notification %> 4 | <%%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> 5 | 6 |
7 | <%- attributes.each do |attribute| -%> 8 | <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %> 9 | <%- end -%> 10 |
11 | 12 |
13 | <%%= f.button :submit %> 14 |
15 | <%% end %> 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ![1993380](https://user-images.githubusercontent.com/27622683/191258317-47fa2863-f6cf-45e2-b4da-ecf45ce5c7a3.png) 3 | # Socialize! 4 | 5 | ~~Visit our website and sign up NOW! www.SOCIALIZE.tech~~ 6 | 7 | ## !! WARNING !! Due to disappearance of Heroku Free plan, the website is down. 8 | 9 | ## A place to find programmers for chat and meet! 10 | ![image](https://user-images.githubusercontent.com/27622683/191258481-ebe0e584-08e3-4a80-9e92-7ab09636b0c3.png) 11 | ## A Developers-Meetup 12 | ![image](https://user-images.githubusercontent.com/27622683/191258921-4b6372f2-8e27-4f83-84c4-aff7278a37fe.png) 13 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = "1.0" 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | 9 | Rails.application.config.assets.paths << Rails.root.join("node_modules") 10 | # Precompile additional assets. 11 | # application.js, application.css, and all non-JS/CSS in the app/assets 12 | # folder are already added. 13 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 14 | -------------------------------------------------------------------------------- /app/views/devise/unlocks/new.html.erb: -------------------------------------------------------------------------------- 1 |

Resend unlock instructions

2 | 3 | <%= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> 4 | <%= f.error_notification %> 5 | <%= f.full_error :unlock_token %> 6 | 7 |
8 | <%= f.input :email, 9 | required: true, 10 | autofocus: true, 11 | input_html: { autocomplete: "email" } %> 12 |
13 | 14 |
15 | <%= f.button :submit, "Resend unlock instructions" %> 16 |
17 | <% end %> 18 | 19 | <%= render "devise/shared/links" %> 20 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.scss: -------------------------------------------------------------------------------- 1 | // Graphical variables 2 | @import "config/fonts"; 3 | @import "config/colors"; 4 | @import "config/bootstrap_variables"; 5 | 6 | // External libraries 7 | @import "bootstrap/scss/bootstrap"; 8 | @import "font-awesome"; 9 | @import "@mapbox/mapbox-gl-geocoder/dist/mapbox-gl-geocoder"; 10 | @import "flatpickr/dist/flatpickr"; 11 | 12 | // Your CSS partials 13 | @import "components/index"; 14 | @import "pages/index"; 15 | @import "components/footer"; 16 | @import "pages/devise"; 17 | @import "pages/sign_in_info"; 18 | @import "pages/profile"; 19 | @import "pages/event_show"; 20 | 21 | body::-webkit-scrollbar { 22 | display: none; /* Safari and Chrome */ 23 | } 24 | -------------------------------------------------------------------------------- /app/javascript/controllers/sidebar_controller.js: -------------------------------------------------------------------------------- 1 | import { Controller } from "@hotwired/stimulus" 2 | 3 | export default class extends Controller { 4 | static targets = ["menu", "search", "sidebar", "image"] 5 | 6 | connect() { 7 | } 8 | change() { 9 | this.sidebarTarget.classList.toggle("open"); 10 | 11 | if(this.sidebarTarget.classList.contains("open")){ 12 | this.menuTarget.classList.replace("bx-menu", "bx-menu-alt-right"); 13 | setTimeout(()=>{ this.imageTarget.classList.toggle("d-none") }, 500); 14 | }else { 15 | this.menuTarget.classList.replace("bx-menu-alt-right","bx-menu"); 16 | this.imageTarget.classList.toggle("d-none"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/controllers/messages_controller.rb: -------------------------------------------------------------------------------- 1 | class MessagesController < ApplicationController 2 | 3 | def create 4 | @message = Message.new(message_params) 5 | @chatroom = ChatRoom.find(params[:chat_room_id]) 6 | @message.chat_room = @chatroom 7 | @message.user = current_user 8 | 9 | if @message.save 10 | ChatroomChannel.broadcast_to( 11 | @chatroom, 12 | render_to_string(partial: "message", locals: {message: @message}) 13 | ) 14 | head :ok 15 | else 16 | render "chat_rooms/show", status: :unprocessable_entity 17 | end 18 | end 19 | 20 | private 21 | 22 | def message_params 23 | params.require(:message).permit(:content) 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /app/assets/stylesheets/config/_fonts.scss: -------------------------------------------------------------------------------- 1 | // Import Google fonts 2 | @import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@300;400;500;600;700&family=Ubuntu:wght@300;400;500;700&display=swap'); 3 | 4 | // Define fonts for body and headers 5 | $body-font: 'Ubuntu', sans-serif; 6 | $headers-font: 'Roboto Slab', serif; 7 | 8 | // To use a font file (.woff) uncomment following lines 9 | // @font-face { 10 | // font-family: "Font Name"; 11 | // src: font-url('FontFile.eot'); 12 | // src: font-url('FontFile.eot?#iefix') format('embedded-opentype'), 13 | // font-url('FontFile.woff') format('woff'), 14 | // font-url('FontFile.ttf') format('truetype') 15 | // } 16 | // $my-font: "Font Name"; 17 | -------------------------------------------------------------------------------- /app/helpers/meta_tags_helper.rb: -------------------------------------------------------------------------------- 1 | module MetaTagsHelper 2 | def meta_title 3 | content_for?(:meta_title) ? content_for(:meta_title) : DEFAULT_META["Socialize! - The only Developers-Meetup in Web"] 4 | end 5 | 6 | def meta_description 7 | content_for?(:meta_description) ? content_for(:meta_description) : DEFAULT_META["With Socialize! you can find developers around and arrange a meet-up to talk about your work"] 8 | end 9 | 10 | def meta_image 11 | meta_image = (content_for?(:meta_image) ? content_for(:meta_image) : DEFAULT_META["meta_image"]) 12 | # little twist to make it work equally with an asset or a url 13 | meta_image.starts_with?("http") ? meta_image : image_url(meta_image) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/assets/stylesheets/components/_avatar.scss: -------------------------------------------------------------------------------- 1 | .avatar { 2 | width: 40px; 3 | border-radius: 50%; 4 | } 5 | .avatar-large { 6 | width: 56px; 7 | border-radius: 50%; 8 | } 9 | .avatar-bordered { 10 | width: 40px; 11 | border-radius: 50%; 12 | box-shadow: 0 1px 2px rgba(0,0,0,0.2); 13 | border: white 1px solid; 14 | } 15 | .avatar-square { 16 | width: 40px; 17 | border-radius: 0px; 18 | box-shadow: 0 1px 2px rgba(0,0,0,0.2); 19 | border: white 1px solid; 20 | } 21 | 22 | .avatar-custom { 23 | width: 40%; 24 | border-radius: 50%; 25 | } 26 | 27 | .avatar-custom2 { 28 | margin: 8px; 29 | width: 90%; 30 | height: 80%; 31 | border-radius: 50%; 32 | } 33 | 34 | .avatar-sidebar { 35 | border-radius: 50%; 36 | } 37 | -------------------------------------------------------------------------------- /app/assets/stylesheets/pages/_sign_in_info.scss: -------------------------------------------------------------------------------- 1 | .signup-form-container { 2 | margin: 10vh; 3 | padding: 0 20vw; 4 | } 5 | 6 | #language-input { 7 | margin-bottom: 20px; 8 | } 9 | 10 | .sign-in-submit { 11 | color: white; 12 | } 13 | 14 | #language-label { 15 | margin-bottom: 7px; 16 | } 17 | 18 | .sign-in-page { 19 | display: flex; 20 | flex-direction: column; 21 | position: relative; 22 | } 23 | 24 | .sign-in-page img { 25 | width: 100px; 26 | border-radius: 50%; 27 | position: absolute; 28 | top: -30px; 29 | left: -20px; 30 | } 31 | 32 | .sign-up-contents { 33 | background-color: white; 34 | border-radius: 15px; 35 | border: 1px solid lightgrey; 36 | margin: 10vh 10vw; 37 | padding: 3vh 5vw; 38 | } 39 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, "\\1en" 8 | # inflect.singular /^(ox)en/i, "\\1" 9 | # inflect.irregular "person", "people" 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym "RESTful" 16 | # end 17 | -------------------------------------------------------------------------------- /app/views/messages/_message.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 | <% if message.user.image.nil? %> 6 | <%= image_tag "userphoto_square.jpg" %> 7 | <% else %> 8 | <%= image_tag message.user.image %> 9 | <% end %> 10 |
11 |

<%= message.user.nickname %>

12 | 13 | <%= message.created_at.strftime(" %l:%M %p") %> 14 | 15 |
16 | 17 |
18 |
19 | 20 | 21 |

<%= message.content %>

22 |
23 |
24 | -------------------------------------------------------------------------------- /app/views/devise/confirmations/new.html.erb: -------------------------------------------------------------------------------- 1 |

Resend confirmation instructions

2 | 3 | <%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> 4 | <%= f.error_notification %> 5 | <%= f.full_error :confirmation_token %> 6 | 7 |
8 | <%= f.input :email, 9 | required: true, 10 | autofocus: true, 11 | value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email), 12 | input_html: { autocomplete: "email" } %> 13 |
14 | 15 |
16 | <%= f.button :submit, "Resend confirmation instructions" %> 17 |
18 | <% end %> 19 | 20 | <%= render "devise/shared/links" %> 21 | -------------------------------------------------------------------------------- /app/views/events/show.html.erb: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 |

<%= @event.title %>

6 |
<%= @event.description %>
7 |

<%= @event.price %>

8 |

It will be held in <%= @event.location %> on <%= @event.date %> at <%= @event.time %>

9 | <% if @event.photo.attached? %> 10 | <%= cl_image_tag @event.photo.key, class: "event-image" %> 11 | <% else %> 12 | <%= image_tag "userphoto_square.jpg", class: "event-image" %> 13 | <% end %> 14 |
15 | <%= link_to "Tickets", "#",class: "event-button" %>

16 | <%= link_to "Back to all events", events_path, class: "event-button" %> 17 |
18 |
19 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | before_action :authenticate_user! 3 | before_action :configure_permitted_parameters, if: :devise_controller? 4 | 5 | def after_sign_in_path_for(resource) 6 | if current_user.location.nil? 7 | edit_user_path(current_user) 8 | else 9 | users_path 10 | end 11 | end 12 | 13 | def configure_permitted_parameters 14 | # For additional fields in app/views/devise/registrations/new.html.erb 15 | devise_parameter_sanitizer.permit(:sign_up, keys: [:nickname, :photo]) 16 | 17 | # For additional in app/views/devise/registrations/edit.html.erb 18 | devise_parameter_sanitizer.permit(:account_update, keys: [:nickname, :photo]) 19 | end 20 | 21 | def default_url_options 22 | { host: ENV["www.socialize.tech"] || "localhost:3000" } 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /app/assets/stylesheets/config/_bootstrap_variables.scss: -------------------------------------------------------------------------------- 1 | // This is where you override default Bootstrap variables 2 | // 1. All Bootstrap variables are here => https://github.com/twbs/bootstrap/blob/master/scss/_variables.scss 3 | // 2. These variables are defined with default value (see https://robots.thoughtbot.com/sass-default) 4 | // 3. You can override them below! 5 | 6 | // General style 7 | $font-family-sans-serif: $body-font; 8 | $headings-font-family: $headers-font; 9 | $body-bg: $light-gray; 10 | $font-size-base: 1rem; 11 | 12 | // Colors 13 | $body-color: $gray; 14 | $primary: $blue; 15 | $success: $green; 16 | $info: #000000; 17 | $danger: $red; 18 | $warning: $orange; 19 | $black: #000000; 20 | $pink: #D1AAAA; 21 | 22 | // Buttons & inputs' radius 23 | $border-radius: 2px; 24 | $border-radius-lg: 2px; 25 | $border-radius-sm: 2px; 26 | 27 | // Override other variables below! 28 | -------------------------------------------------------------------------------- /app/controllers/events_controller.rb: -------------------------------------------------------------------------------- 1 | class EventsController < ApplicationController 2 | def index 3 | @events = Event.all 4 | end 5 | 6 | def show 7 | @event = Event.find(params[:id]) 8 | end 9 | 10 | def new 11 | @event = Event.new 12 | end 13 | 14 | def create 15 | @event = Event.new(event_params) 16 | respond_to do |format| 17 | if @event.save 18 | format.html { redirect_to event_url(@event), notice: "Event was successfully created." } 19 | format.json { render :show, status: :created, location: @event } 20 | else 21 | format.html { render :new, status: :unprocessable_entity } 22 | format.json { render json: @event.errors, status: :unprocessable_entity } 23 | end 24 | end 25 | end 26 | 27 | private 28 | 29 | def event_params 30 | params.require(:event).permit(:title, :theme, :price, :photo, :description, :date, :time, :location) 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /app/javascript/controllers/index.js: -------------------------------------------------------------------------------- 1 | // This file is auto-generated by ./bin/rails stimulus:manifest:update 2 | // Run that command whenever you add a new controller or create them with 3 | // ./bin/rails generate stimulus controllerName 4 | 5 | import { application } from "./application" 6 | 7 | import AddressAutocompleteController from "./address_autocomplete_controller" 8 | application.register("address-autocomplete", AddressAutocompleteController) 9 | 10 | import ChatroomSubscriptionController from "./chatroom_subscription_controller" 11 | application.register("chatroom-subscription", ChatroomSubscriptionController) 12 | 13 | import HelloController from "./hello_controller" 14 | application.register("hello", HelloController) 15 | 16 | import MapController from "./map_controller" 17 | application.register("map", MapController) 18 | 19 | import SidebarController from "./sidebar_controller" 20 | application.register("sidebar", SidebarController) 21 | -------------------------------------------------------------------------------- /app/controllers/registrations_controller.rb: -------------------------------------------------------------------------------- 1 | class RegistrationsController < Devise::RegistrationsController 2 | 3 | private 4 | 5 | # def signup_params 6 | # params.require(:user).permit( :name, 7 | # :email, 8 | # :password, 9 | # :password_confirmation) 10 | # end 11 | 12 | # def account_update_params 13 | # params.require(:user).permit( :name, 14 | # :email, 15 | # :password, 16 | # :password_confirmation) 17 | # end 18 | 19 | def sign_up_params 20 | params.require(:user).permit(:name, :email, :password, :password_confirmation) 21 | end 22 | 23 | def account_update_params 24 | params.require(:user).permit(:name, :email, :password, :password_confirmation, :current_password) 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | AllCops: 2 | NewCops: enable 3 | Exclude: 4 | - 'bin/**/*' 5 | - 'db/**/*' 6 | - 'config/**/*' 7 | - 'node_modules/**/*' 8 | - 'script/**/*' 9 | - 'support/**/*' 10 | - 'tmp/**/*' 11 | - 'test/**/*' 12 | 13 | Style/ConditionalAssignment: 14 | Enabled: false 15 | Style/StringLiterals: 16 | Enabled: false 17 | Style/RedundantReturn: 18 | Enabled: false 19 | Style/Documentation: 20 | Enabled: false 21 | Style/WordArray: 22 | Enabled: false 23 | Metrics/AbcSize: 24 | Enabled: false 25 | Style/MutableConstant: 26 | Enabled: false 27 | Style/SignalException: 28 | Enabled: false 29 | Metrics/CyclomaticComplexity: 30 | Enabled: false 31 | Style/MissingRespondToMissing: 32 | Enabled: false 33 | Lint/MissingSuper: 34 | Enabled: false 35 | Style/FrozenStringLiteralComment: 36 | Enabled: false 37 | Layout/LineLength: 38 | Max: 120 39 | Style/EmptyMethod: 40 | Enabled: false 41 | Bundler/OrderedGems: 42 | Enabled: false 43 | -------------------------------------------------------------------------------- /app/assets/stylesheets/pages/_event_show.scss: -------------------------------------------------------------------------------- 1 | .event-show-content { 2 | background-color: white; 3 | border-radius: 15px; 4 | border: 1px solid lightgrey; 5 | margin: 10vh 15vw; 6 | padding: 3vh 5vw; 7 | padding-top: 5vh; 8 | } 9 | 10 | .event-buttons { 11 | display: flex; 12 | color: white; 13 | align-items: center; 14 | } 15 | 16 | #event-show-create { 17 | margin-top: 2vh; 18 | margin-bottom: 2vh; 19 | color: rgb(255, 255, 255); 20 | 21 | &:hover { 22 | opacity: 0.7; 23 | color: black; 24 | transition: 0.3s; 25 | } 26 | } 27 | 28 | #event-show-back { 29 | background-color: #787D90; 30 | color: white; 31 | box-shadow: inset 0 0 0 4px #ffffff0b; 32 | text-align: center; 33 | // Fix to counter the draw-button class 34 | margin-top: 9px; 35 | &:hover { 36 | background-color: white; 37 | opacity: 0.9; 38 | color: black; 39 | transition: 0.3s; 40 | } 41 | } 42 | 43 | .form-select { 44 | border-radius: 15px; 45 | } 46 | -------------------------------------------------------------------------------- /app/views/devise/passwords/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

Forgot your password?

5 | 6 | <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> 7 | <%= f.error_notification %> 8 | 9 |
10 | <%= f.input :email, 11 | required: true, 12 | autofocus: true, 13 | input_html: { autocomplete: "email" } %> 14 |
15 | 16 |
17 |
18 | <%= f.button :submit, "Send me reset password instructions", class:"btn btn-success active rounded-5 mb-3" %> 19 | <% end %> 20 | 21 | <%= render "devise/shared/links" %> 22 |
23 |
24 |
25 |
26 |
27 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative "boot" 2 | 3 | require "rails/all" 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | module Socialize 10 | class Application < Rails::Application 11 | config.generators do |generate| 12 | generate.assets false 13 | generate.helper false 14 | generate.test_framework :test_unit, fixture: false 15 | end 16 | # Initialize configuration defaults for originally generated Rails version. 17 | config.load_defaults 7.0 18 | 19 | # Configuration for the application, engines, and railties goes here. 20 | # 21 | # These settings can be overridden in specific environments using the files 22 | # in config/environments, which are processed later. 23 | # 24 | # config.time_zone = "Central Time (US & Canada)" 25 | # config.eager_load_paths << Rails.root.join("extras") 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /app/javascript/controllers/address_autocomplete_controller.js: -------------------------------------------------------------------------------- 1 | import { Controller } from "@hotwired/stimulus" 2 | import MapboxGeocoder from "@mapbox/mapbox-gl-geocoder" 3 | 4 | // Connects to data-controller="address-autocomplete" 5 | export default class extends Controller { 6 | static values = { apiKey: String } 7 | 8 | static targets = ["location"] 9 | 10 | connect() { 11 | this.geocoder = new MapboxGeocoder({ 12 | accessToken: this.apiKeyValue, 13 | types: "country,region,place,postcode,locality,neighborhood,address" 14 | }) 15 | this.geocoder.addTo(this.element) 16 | this.geocoder.on("result", event => this.#setInputValue(event)) 17 | this.geocoder.on("clear", () => this.#clearInputValue()) 18 | } 19 | #setInputValue(event) { 20 | this.addressTarget.value = event.result["place_name"] 21 | } 22 | 23 | #clearInputValue() { 24 | this.addressTarget.value = "" 25 | } 26 | disconnect() { 27 | this.geocoder.onRemove() 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /config/locales/simple_form.en.yml: -------------------------------------------------------------------------------- 1 | en: 2 | simple_form: 3 | "yes": 'Yes' 4 | "no": 'No' 5 | required: 6 | text: 'required' 7 | mark: '*' 8 | # You can uncomment the line below if you need to overwrite the whole required html. 9 | # When using html, text and mark won't be used. 10 | # html: '*' 11 | error_notification: 12 | default_message: "Please review the problems below:" 13 | # Examples 14 | # labels: 15 | # defaults: 16 | # password: 'Password' 17 | # user: 18 | # new: 19 | # email: 'E-mail to sign in.' 20 | # edit: 21 | # email: 'E-mail.' 22 | # hints: 23 | # defaults: 24 | # username: 'User name to sign in.' 25 | # password: 'No special characters, please.' 26 | # include_blanks: 27 | # defaults: 28 | # age: 'Rather not say' 29 | # prompts: 30 | # defaults: 31 | # age: 'Select your age' 32 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t "hello" 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t("hello") %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # "true": "foo" 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at https://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | hello: "Hello world" 34 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | # Devise 3 | devise_for :users, :controllers => {:registrations => "registrations", omniauth_callbacks: "callbacks"} 4 | # devise_scope :user do 5 | # get 'login', to: 'devise/sessions#new' 6 | # end 7 | # devise_scope :user do 8 | # get 'signup', to: 'devise/registrations#new' 9 | # end 10 | 11 | # Root route 12 | root to: "pages#home" 13 | 14 | # All other routes 15 | get "/profile", to: "users#profile", as: :profile 16 | resources :users, only: [:index, :show, :edit, :update], path: "all_programmers" do 17 | end 18 | patch '/chat_pins/:id', to: 'chat_requests#pin_user', as: :pin_user 19 | post '/chat_requests', to: 'chat_requests#create', as: :new_chat_request 20 | resources :chat_requests, only: [:index, :edit, :update] 21 | resources :chat_rooms, only: [:index, :show] do 22 | resources :messages, only: :create 23 | end 24 | 25 | resources :events, only: [:index, :show, :new, :create] 26 | end 27 | -------------------------------------------------------------------------------- /app/views/users/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

About you

5 |

Please provide further details to be visible to developers near you!

6 |
7 | <%= simple_form_for(@user) do |f| %> 8 | <%= f.simple_fields_for :languages do |w| %> 9 | <%= w.label "Main language", id: "language-label" %> 10 | <%= w.select :id, Language.all.map{ |l| [l.name, l.id] }, 11 | {prompt: "Select main language"}, 12 | required: :required, 13 | class: "form-control", 14 | id: "language-input" %> 15 | <% end %> 16 | <%= f.input :location, input_html: { autocomplete: 'off' } %> 17 | <%= f.input :linkedin_url, input_html: { autocomplete: 'off' } %> 18 | <%= f.button :submit, "Get started", class: "sign-in-submit button draw-border mr-2" %> 19 | <% end %> 20 |
21 |
22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore all logfiles and tempfiles. 11 | /log/* 12 | /tmp/* 13 | !/log/.keep 14 | !/tmp/.keep 15 | 16 | # Ignore pidfiles, but keep the directory. 17 | /tmp/pids/* 18 | !/tmp/pids/ 19 | !/tmp/pids/.keep 20 | 21 | # Ignore uploaded files in development. 22 | /storage/* 23 | !/storage/.keep 24 | /tmp/storage/* 25 | !/tmp/storage/ 26 | !/tmp/storage/.keep 27 | 28 | /public/assets 29 | 30 | # Ignore master key for decrypting credentials and more. 31 | /config/master.key 32 | 33 | /app/assets/builds/* 34 | !/app/assets/builds/.keep 35 | 36 | /node_modules 37 | # Ignore .env file containing credentials. 38 | .env* 39 | # Ignore Mac and Linux file system files 40 | *.swp 41 | .DS_Store 42 | .env* 43 | /config/initializers/devise.rb 44 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "fileutils" 3 | 4 | # path to your application root. 5 | APP_ROOT = File.expand_path("..", __dir__) 6 | 7 | def system!(*args) 8 | system(*args) || abort("\n== Command #{args} failed ==") 9 | end 10 | 11 | FileUtils.chdir APP_ROOT do 12 | # This script is a way to set up or update your development environment automatically. 13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome. 14 | # Add necessary setup steps to this file. 15 | 16 | puts "== Installing dependencies ==" 17 | system! "gem install bundler --conservative" 18 | system("bundle check") || system!("bundle install") 19 | 20 | # puts "\n== Copying sample files ==" 21 | # unless File.exist?("config/database.yml") 22 | # FileUtils.cp "config/database.yml.sample", "config/database.yml" 23 | # end 24 | 25 | puts "\n== Preparing database ==" 26 | system! "bin/rails db:prepare" 27 | 28 | puts "\n== Removing old logs and tempfiles ==" 29 | system! "bin/rails log:clear tmp:clear" 30 | 31 | puts "\n== Restarting application server ==" 32 | system! "bin/rails restart" 33 | end 34 | -------------------------------------------------------------------------------- /config/initializers/content_security_policy.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Define an application-wide content security policy. 4 | # See the Securing Rails Applications Guide for more information: 5 | # https://guides.rubyonrails.org/security.html#content-security-policy-header 6 | 7 | # Rails.application.configure do 8 | # config.content_security_policy do |policy| 9 | # policy.default_src :self, :https 10 | # policy.font_src :self, :https, :data 11 | # policy.img_src :self, :https, :data 12 | # policy.object_src :none 13 | # policy.script_src :self, :https 14 | # policy.style_src :self, :https 15 | # # Specify URI for violation reports 16 | # # policy.report_uri "/csp-violation-report-endpoint" 17 | # end 18 | # 19 | # # Generate session nonces for permitted importmap and inline scripts 20 | # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } 21 | # config.content_security_policy_nonce_directives = %w(script-src) 22 | # 23 | # # Report violations without enforcing the policy. 24 | # # config.content_security_policy_report_only = true 25 | # end 26 | -------------------------------------------------------------------------------- /app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User < ApplicationRecord 2 | # Include default devise modules. Others available are: 3 | # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable 4 | devise :database_authenticatable, :registerable, 5 | :recoverable, :rememberable, :validatable, :omniauthable 6 | has_many :user_languages, dependent: :destroy 7 | has_many :languages, through: :user_languages 8 | has_many :chat_requests 9 | has_one_attached :photo 10 | has_many :events 11 | 12 | 13 | # validates :nickname, presence: true 14 | 15 | geocoded_by :location 16 | after_validation :geocode, if: :location 17 | 18 | # validates :location, presence: true 19 | 20 | def self.from_omniauth(auth) 21 | where(provider: auth.provider, uid: auth.uid).first_or_create do |user| 22 | user.provider = auth.provider 23 | user.nickname = auth.info.nickname 24 | user.image = auth.info.image 25 | user.html_url = auth.extra.raw_info.html_url 26 | user.name = auth.info.name 27 | user.uid = auth.uid 28 | user.email = auth.info.email 29 | user.password = Devise.friendly_token[0,20] 30 | end 31 | end 32 | 33 | 34 | end 35 | -------------------------------------------------------------------------------- /app/views/events/_form.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 | <%= simple_form_for(@event) do |f| %> 4 | <%= f.input :title, placeholder: "Event title", label: false, input_html: { autocomplete: 'off' } %> 5 | <%= f.input :location, placeholder: "Where will the event be held?", label: false, input_html: { autocomplete: 'off' } %> 6 | <%= f.input :theme, placeholder: "What is the theme?", label: false, input_html: { autocomplete: 'off' } %> 7 | <%= f.input :price, placeholder: "Price", label: false, input_html: { min: 0, autocomplete: 'off' } %> 8 | <%= f.input :description, placeholder: "Describe the event", label: false, input_html: { autocomplete: 'off' } %> 9 | <%= f.input :date, as: :string, required: false, input_html: {class: "datepicker", autocomplete: 'off'} %> 10 | <%= f.input :photo, as: :file %> 11 |
12 | <%= f.submit "Create", class: "button draw-border mr-2", id: "event-show-create" %> 13 | <% end %> 14 | <%= link_to "Back to events", events_path , class: "button draw-border mr-2", id: "event-show-back" %> 15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /app/assets/stylesheets/pages/_profile.scss: -------------------------------------------------------------------------------- 1 | .profile-container { 2 | position: relative; 3 | } 4 | 5 | .profile-contents { 6 | // position: absolute; 7 | background-color: white; 8 | border-radius: 15px; 9 | border: 1px solid lightgrey; 10 | // top: 10vh; 11 | // bottom: 60vh; 12 | // left: 20vw; 13 | // right: 20vw; 14 | margin: 10vh 15vw; 15 | padding: 3vh 5vw; 16 | } 17 | 18 | .github_and_linkedin { 19 | display: flex; 20 | justify-content: center; 21 | padding-right: 5vw; 22 | } 23 | 24 | .user-image-container { 25 | width: 100px; 26 | height: 100px; 27 | } 28 | 29 | #user-image { 30 | margin: 8px; 31 | width: 80%; 32 | height: 80%; 33 | border-radius: 50%; 34 | } 35 | .container-name-icons{ 36 | margin-top: -94px; 37 | padding-left: 137px; 38 | } 39 | 40 | .profile-github-button { 41 | color: white; 42 | 43 | &:hover { 44 | // background-color: white; 45 | opacity: 0.9; 46 | color: black; 47 | transition: 0.3s; 48 | } 49 | } 50 | 51 | .profile-linkedin-button { 52 | color: white; 53 | 54 | &:hover { 55 | // background-color: white; 56 | opacity: 0.9; 57 | color: black; 58 | transition: 0.3s; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/views/chat_requests/_chat_request.html.erb: -------------------------------------------------------------------------------- 1 |
3 | 4 | <% if current_user == chat_request.asker %> 5 | <% if chat_request.pending? == true %> 6 | <%= link_to "#", class: "button draw-border mr-2", disabled: true do %> 7 | 8 | <% end%> 9 | <% end%> 10 | <%#= chat_request.receiver.nickname%> <%#= chat_request.status %> 11 | <% end%> 12 | <% if current_user == chat_request.receiver %> 13 | <%#= chat_request.asker.nickname %> 14 | <% if chat_request.pending? == false %> 15 | <%= chat_request.status %> 16 | <% else %> 17 | <%= link_to chat_request_path(chat_request, status: 1), data: {'turbo-method': :patch}, class: "button draw-border mr-2" do %> 18 | 19 | <% end %> 20 | 21 | <%= link_to chat_request_path(chat_request, status: -1), data: {'turbo-method': :patch}, class: "button draw-border mr-2" do %> 22 | 23 | <% end %> 24 | <% end %> 25 | <% end %> 26 |
27 | -------------------------------------------------------------------------------- /app/javascript/controllers/chatroom_subscription_controller.js: -------------------------------------------------------------------------------- 1 | import { Controller } from "@hotwired/stimulus" 2 | 3 | // Connects to data-controller="chatroom-subscription" 4 | // import { Controller } from "@hotwired/stimulus" 5 | import { createConsumer } from "@rails/actioncable"; 6 | 7 | export default class extends Controller { 8 | static values = { chatroomId: Number } 9 | static targets = ["messages"] 10 | 11 | connect() { 12 | console.log(`Subscribe to the chatroom with the id ${this.chatroomIdValue}.`) 13 | this.channel = createConsumer().subscriptions.create( 14 | { channel: "ChatroomChannel", id: this.chatroomIdValue }, 15 | {received: data => this.#insertMessageAndScrollDown(data)} 16 | ) 17 | // console.log(`Subscribed to the chatroom with the id ${this.chatroomIdValue}.`) 18 | } 19 | 20 | #insertMessageAndScrollDown(data) { 21 | this.messagesTarget.insertAdjacentHTML("beforeend", data) 22 | this.messagesTarget.scrollTo(0, this.messagesTarget.scrollHeight) 23 | } 24 | 25 | resetForm(event) { 26 | event.target.reset() 27 | } 28 | 29 | disconnect() { 30 | console.log("Unsubscribed from the chatroom") 31 | this.channel.unsubscribe() 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/views/pages/home.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 | <%#

SocializeHHI

%> 4 |
5 |
6 |
7 |

Socialize

8 |
9 |
10 |
11 |

BUILT

12 |
13 |

BY

14 |

FOR

15 |
16 |

DEVELOPERS

17 |
18 |
19 |

Wanna socialize with other developers? Fear not! With socialize, you can!

20 | <%= link_to "Learn more", "/all_programmers", class: "btn-landing" %> 21 |
22 |
23 | 24 |
25 |
26 | -------------------------------------------------------------------------------- /config/initializers/geocoder.rb: -------------------------------------------------------------------------------- 1 | Geocoder.configure( 2 | # Geocoding options 3 | # timeout: 3, # geocoding service timeout (secs) 4 | # lookup: :nominatim, # name of geocoding service (symbol) 5 | # ip_lookup: :ipinfo_io, # name of IP address geocoding service (symbol) 6 | # language: :en, # ISO-639 language code 7 | # use_https: false, # use HTTPS for lookup requests? (if supported) 8 | # http_proxy: nil, # HTTP proxy server (user:pass@host:port) 9 | # https_proxy: nil, # HTTPS proxy server (user:pass@host:port) 10 | # api_key: nil, # API key for geocoding service 11 | # cache: nil, # cache object (must respond to #[], #[]=, and #del) 12 | 13 | # Exceptions that should not be rescued by default 14 | # (if you want to implement custom error handling); 15 | # supports SocketError and Timeout::Error 16 | # always_raise: [], 17 | 18 | # Calculation options 19 | units: :km # :km for kilometers or :mi for miles 20 | # distances: :linear # :spherical or :linear 21 | 22 | # Cache configuration 23 | # cache_options: { 24 | # expiration: 2.days, 25 | # prefix: 'geocoder:' 26 | # } 27 | ) 28 | -------------------------------------------------------------------------------- /app/javascript/controllers/map_controller.js: -------------------------------------------------------------------------------- 1 | import { Controller } from "@hotwired/stimulus" 2 | import MapboxGeocoder from "@mapbox/mapbox-gl-geocoder" 3 | 4 | export default class extends Controller { 5 | static values = { 6 | apiKey: String, 7 | markers: Array 8 | } 9 | 10 | connect() { 11 | mapboxgl.accessToken = this.apiKeyValue 12 | this.map = new mapboxgl.Map({ 13 | container: this.element, 14 | style: "mapbox://styles/mapbox/streets-v11" 15 | }) 16 | this.#addMarkersToMap() 17 | this.#fitMapToMarkers() 18 | this.map.addControl(new MapboxGeocoder({ accessToken: mapboxgl.accessToken, 19 | mapboxgl: mapboxgl })) 20 | } 21 | 22 | #addMarkersToMap() { 23 | this.markersValue.forEach((marker) => { 24 | const popup = new mapboxgl.Popup().setHTML(marker.info_window) 25 | new mapboxgl.Marker() 26 | .setLngLat([ marker.lng, marker.lat ]) 27 | .setPopup(popup) 28 | .addTo(this.map) 29 | }) 30 | } 31 | 32 | #fitMapToMarkers() { 33 | const bounds = new mapboxgl.LngLatBounds() 34 | this.markersValue.forEach(marker => bounds.extend([ marker.lng, marker.lat ])) 35 | this.map.fitBounds(bounds, { padding: 10, maxZoom: 12, duration: 0 }) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/assets/stylesheets/pages/_devise.scss: -------------------------------------------------------------------------------- 1 | .sign-in-container { 2 | display: flex; 3 | flex-direction: column; 4 | justify-items: center; 5 | align-items: center; 6 | } 7 | 8 | .sign-in-page { 9 | 10 | } 11 | 12 | .blank-row { 13 | height: 15vh; 14 | } 15 | 16 | .sign-in-header { 17 | margin: 10px 0; 18 | } 19 | 20 | .sign-in-box { 21 | display: flex; 22 | padding: 60px 40px 20px 40px; 23 | width: 25vw; 24 | flex-direction: column; 25 | justify-content: center; 26 | align-items: center; 27 | background-color: #555b6eb9; 28 | border-radius: 15px; 29 | box-shadow: rgba(0, 0, 0, 0.7); 30 | } 31 | 32 | .sign-in-button { 33 | // width: 100%; 34 | margin-top: 2vh; 35 | margin-bottom: 2vh; 36 | color: rgb(255, 255, 255); 37 | // width: 100%; 38 | 39 | &:hover { 40 | 41 | opacity: 0.7; 42 | color: black; 43 | transition: 0.3s; 44 | } 45 | } 46 | 47 | 48 | .devise-buttons { 49 | display: flex; 50 | align-items: center; 51 | justify-content: center; 52 | } 53 | 54 | #github-create-button { 55 | background-color: #787D90; 56 | color: white; 57 | box-shadow: inset 0 0 0 4px #ffffff0b; 58 | text-align: center; 59 | 60 | &:hover { 61 | background-color: white; 62 | opacity: 0.9; 63 | color: black; 64 | transition: 0.3s; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/views/devise/passwords/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

Change your password

5 | 6 | <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> 7 | <%= f.error_notification %> 8 | 9 | <%= f.input :reset_password_token, as: :hidden %> 10 | <%= f.full_error :reset_password_token %> 11 | 12 |
13 | <%= f.input :password, 14 | label: "New password", 15 | required: true, 16 | autofocus: true, 17 | hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length), 18 | input_html: { autocomplete: "new-password" } %> 19 | <%= f.input :password_confirmation, 20 | label: "Confirm your new password", 21 | required: true, 22 | input_html: { autocomplete: "new-password" } %> 23 |
24 | 25 |
26 | <%= f.button :submit, "Change my password" %> 27 |
28 | <% end %> 29 | 30 | <%= render "devise/shared/links" %> 31 |
32 |
33 |
34 | -------------------------------------------------------------------------------- /app/views/users/_info_window.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | <% if user.photo.key %> 7 | <%= cl_image_tag user.photo.key, class: "avatar-custom", style:"height:80px !important; width:80px !important" %> 8 | <% elsif user.image.nil? %> 9 | <%= image_tag "userphoto_square.jpg", class: "avatar-custom", style: "height:80px; width:67.8px" %> 10 | <% else %> 11 | <%= image_tag "#{user.image}", class: "avatar-custom", style:"height:80px !important; width:80px !important" %> 12 | <% end %> 13 |
14 |
15 | 16 |
17 |
<%= user.nickname %>
18 |
<%= user.location %>
19 |
20 | <%= link_to "GitHub", user.html_url, class:"btn rounded-5 btn-sm", style:"background-color:#8d7197; color:white" %> 21 |
22 |
23 |
24 |
25 |
26 |
27 | -------------------------------------------------------------------------------- /config/storage.yml: -------------------------------------------------------------------------------- 1 | test: 2 | service: Disk 3 | root: <%= Rails.root.join("tmp/storage") %> 4 | 5 | local: 6 | service: Disk 7 | root: <%= Rails.root.join("storage") %> 8 | 9 | # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) 10 | # amazon: 11 | # service: S3 12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> 13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> 14 | # region: us-east-1 15 | # bucket: your_own_bucket-<%= Rails.env %> 16 | 17 | # Remember not to checkin your GCS keyfile to a repository 18 | # google: 19 | # service: GCS 20 | # project: your_project 21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> 22 | # bucket: your_own_bucket-<%= Rails.env %> 23 | 24 | # Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) 25 | # microsoft: 26 | # service: AzureStorage 27 | # storage_account_name: your_account_name 28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> 29 | # container: your_container_name-<%= Rails.env %> 30 | 31 | # mirror: 32 | # service: Mirror 33 | # primary: local 34 | # mirrors: [ amazon, google, microsoft ] 35 | cloudinary: 36 | service: Cloudinary 37 | folder: <%= Rails.env %> 38 | -------------------------------------------------------------------------------- /app/views/chat_rooms/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |
    6 |

    Your Chats

    7 |
    8 | 9 |
    10 | <% @chatrooms.each do |chat| %> 11 | <%= link_to chat_room_path(chat), class: ' border-secondary border-opacity-10 rounded-4 text-decoration-none text-black p-2 my-2' do %> 12 |

    <%= current_user == chat.chat_request.receiver ? chat.chat_request.asker.nickname : chat.chat_request.receiver.nickname %>

    13 |
    14 | 15 |

    16 | <% if current_user %> 17 | <% chat.messages.each do |message| %> 18 |

    You:

    <%= message.content.split.join(" ") %> 19 | <% end %> 20 | <% else %> 21 | <% chat.messages.each do |message| %> 22 |

    <%= chat.chat_request.receiver.nickname %>:

    <%= message.content.split.join(" ") %> 23 | <% end %> 24 | <% end %> 25 |

    26 |
    27 | <% end %> 28 | <% end %> 29 |
    30 |
31 |
32 | 33 |
34 | -------------------------------------------------------------------------------- /app/views/events/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 |

Events near you !

4 |
5 | 6 |
7 |
8 |
9 |
10 | <% @events.each do |event| %> 11 |
12 |
13 |
14 |

<%= event.title %>

15 | 16 | 17 |
18 |
19 |
20 | <%= link_to "Details", event_path(event), class: "event-button" %> 21 | <%= link_to "Tickets", "#",class: "event-button" %> 22 |
23 |
24 |
25 |
26 | <% end %> 27 |
28 |
29 |
30 |
31 |
32 |
33 |

<%= link_to "Add your event", new_event_path, class:"add-event-button"%>

34 | 35 |
36 | -------------------------------------------------------------------------------- /app/views/devise/shared/_links.html.erb: -------------------------------------------------------------------------------- 1 | <%- if devise_mapping.omniauthable? %> 2 | <%- resource_class.omniauth_providers.each do |provider| %> 3 | <%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post, class:"button draw-border mr-2 sign-in-button"%>
4 | <% end %> 5 | <% end %> 6 | 7 | <%- if controller_name != 'sessions' %> 8 | <%#= link_to "Log in", new_session_path(resource_name), class:"btn btn-primary active rounded-5 mb-3" %>
9 | <% end %> 10 | 11 | <%- if devise_mapping.registerable? && controller_name != 'registrations' %> 12 | <%#= link_to "Sign up", new_registration_path(resource_name), class:"btn btn-primary active rounded-5 mb-3" %>
13 | <% end %> 14 | 15 | <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> 16 | <%#= link_to "Forgot your password?", new_password_path(resource_name), class:"btn btn-primary active rounded-5 mb-3" %>
17 | <% end %> 18 | 19 | <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> 20 | <%#= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name), class:"btn btn-primary active rounded-5 mb-3" %>
21 | <% end %> 22 | 23 | <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> 24 | <%#= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name), class:"btn btn-primary active rounded-5 mb-3" %>
25 | <% end %> 26 | -------------------------------------------------------------------------------- /db/migrate/20220904200848_devise_create_users.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class DeviseCreateUsers < ActiveRecord::Migration[7.0] 4 | def change 5 | create_table :users do |t| 6 | ## Database authenticatable 7 | t.string :email, null: false, default: "" 8 | t.string :encrypted_password, null: false, default: "" 9 | 10 | ## Recoverable 11 | t.string :reset_password_token 12 | t.datetime :reset_password_sent_at 13 | 14 | ## Rememberable 15 | t.datetime :remember_created_at 16 | 17 | ## Trackable 18 | # t.integer :sign_in_count, default: 0, null: false 19 | # t.datetime :current_sign_in_at 20 | # t.datetime :last_sign_in_at 21 | # t.string :current_sign_in_ip 22 | # t.string :last_sign_in_ip 23 | 24 | ## Confirmable 25 | # t.string :confirmation_token 26 | # t.datetime :confirmed_at 27 | # t.datetime :confirmation_sent_at 28 | # t.string :unconfirmed_email # Only if using reconfirmable 29 | 30 | ## Lockable 31 | # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts 32 | # t.string :unlock_token # Only if unlock strategy is :email or :both 33 | # t.datetime :locked_at 34 | 35 | 36 | t.timestamps null: false 37 | end 38 | 39 | add_index :users, :email, unique: true 40 | add_index :users, :reset_password_token, unique: true 41 | # add_index :users, :confirmation_token, unique: true 42 | # add_index :users, :unlock_token, unique: true 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /app/views/devise/sessions/new.html.erb: -------------------------------------------------------------------------------- 1 | 37 | -------------------------------------------------------------------------------- /config/puma.rb: -------------------------------------------------------------------------------- 1 | # Puma can serve each request in a thread from an internal thread pool. 2 | # The `threads` method setting takes two numbers: a minimum and maximum. 3 | # Any libraries that use thread pools should be configured to match 4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum 5 | # and maximum; this matches the default thread size of Active Record. 6 | # 7 | max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } 8 | min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } 9 | threads min_threads_count, max_threads_count 10 | 11 | # Specifies the `worker_timeout` threshold that Puma will use to wait before 12 | # terminating a worker in development environments. 13 | # 14 | worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" 15 | 16 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000. 17 | # 18 | port ENV.fetch("PORT") { 3000 } 19 | 20 | # Specifies the `environment` that Puma will run in. 21 | # 22 | environment ENV.fetch("RAILS_ENV") { "development" } 23 | 24 | # Specifies the `pidfile` that Puma will use. 25 | pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } 26 | 27 | # Specifies the number of `workers` to boot in clustered mode. 28 | # Workers are forked web server processes. If using threads and workers together 29 | # the concurrency of the application would be max `threads` * `workers`. 30 | # Workers do not work on JRuby or Windows (both of which do not support 31 | # processes). 32 | # 33 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 } 34 | 35 | # Use the `preload_app!` method when specifying a `workers` number. 36 | # This directive tells Puma to first boot the application and load code 37 | # before forking the application. This takes advantage of Copy On Write 38 | # process behavior so workers use less memory. 39 | # 40 | # preload_app! 41 | 42 | # Allow puma to be restarted by `bin/rails restart` command. 43 | plugin :tmp_restart 44 | -------------------------------------------------------------------------------- /app/views/devise/registrations/new.html.erb: -------------------------------------------------------------------------------- 1 | 43 | -------------------------------------------------------------------------------- /app/views/users/profile.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | <%= image_tag @user.image, id: "user-image" %> 5 |
6 |
7 |
8 |

<%= @user.nickname %>

9 |
10 | <% github_exists = !@user.html_url.nil? && @user.html_url != "" %> 11 | <% linkedin_exists = !@user.linkedin_url.nil? && @user.linkedin_url != "" %> 12 | <% if github_exists || linkedin_exists %> 13 | <% if github_exists %> 14 | <%= link_to @user.html_url, class: "profile-github-button button draw-border mr-2" do %> 15 | 16 | <% end %> 17 | <% end %> 18 | <% if linkedin_exists %> 19 | <%= link_to @user.linkedin_url, class: "profile-linkedin-button button draw-border mr-2" do %> 20 | 21 | <% end %> 22 | <% end %> 23 | <% end %> 24 |
25 |
26 | <%= simple_form_for(@user) do |f| %> 27 | <%= f.simple_fields_for :languages do |w| %> 28 | <%= w.label "Main language", id: "language-label" %> 29 | <%= w.select :id, Language.all.map{ |l| [l.name, l.id] }, 30 | {prompt: "Select main language"}, 31 | required: :required, 32 | class: "form-control", 33 | id: "language-input" %> 34 | <% end %> 35 | <%= f.input :location, input_html: { autocomplete: 'off' } %> 36 | <%= f.input :linkedin_url, input_html: { autocomplete: 'off' } %> 37 | <%= f.button :submit, "Update", class: "sign-in-submit button draw-border mr-2" %> 38 | <% end %> 39 |
40 |
41 |
42 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The change you wanted was rejected.

62 |

Maybe you tried to change something you didn't have access to.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /app/views/devise/registrations/edit.html.erb: -------------------------------------------------------------------------------- 1 | 49 | -------------------------------------------------------------------------------- /app/controllers/chat_requests_controller.rb: -------------------------------------------------------------------------------- 1 | class ChatRequestsController < ApplicationController 2 | def index 3 | @all_chat_requests = ChatRequest.where(asker: current_user).or(ChatRequest.where(receiver: current_user)) 4 | @my_requests = @all_chat_requests.select { |r| r.asker == current_user && r.pending? } 5 | @chat_requests_hash = { confirmed: [], rejected: [], pending: @all_chat_requests.select { |r| r.pending? } } 6 | @chat_requests = [] 7 | 8 | @all_chat_requests.each do |request| 9 | if request.confirmed? 10 | @chat_requests_hash[:confirmed] << request 11 | elsif request.rejected? 12 | @chat_requests_hash[:rejected] << request 13 | end 14 | end 15 | end 16 | 17 | def create 18 | # create view with the button "request to chat" link_to here. 19 | # @asker = current_user 20 | @chat_request = ChatRequest.new 21 | @chat_request.asker = current_user 22 | # @chat_request.receiver = # if the user is the receiver and click on the button request 23 | @chat_request.receiver = User.find(params[:receiver]) 24 | if @chat_request.save 25 | redirect_to action: "index" 26 | end 27 | end 28 | 29 | def update 30 | @chat_request = ChatRequest.find(params[:id]) 31 | if @chat_request.update(status: params[:status].to_i) 32 | # status: confirmed 33 | if @chat_request.confirmed? # update status 34 | # raise 35 | @chat_room = ChatRoom.create(chat_request: @chat_request) 36 | end 37 | redirect_to users_path, status: :see_other 38 | else 39 | redirect_to action: "index", status: :unprocessable_entity 40 | end 41 | end 42 | 43 | def pin_user 44 | # Obtain the specific chat request 45 | @chat_request = ChatRequest.find(params[:id]) 46 | # Check whether user is asker or receiver and toggle pin status accordingly 47 | if current_user == @chat_request.asker 48 | @chat_request.update(receiver_is_pinned: toggle_pin(@chat_request.receiver_is_pinned)) 49 | else 50 | @chat_request.update(asker_is_pinned: toggle_pin(@chat_request.asker_is_pinned)) 51 | end 52 | # Save and redirect 53 | if @chat_request.save! 54 | redirect_to chat_requests_path 55 | else 56 | render :index, status: :unprocessable_entity 57 | end 58 | end 59 | 60 | private 61 | 62 | def toggle_pin(is_pinned) 63 | return is_pinned == true ? false : true 64 | end 65 | end 66 | -------------------------------------------------------------------------------- /db/migrate/20220907115845_create_active_storage_tables.active_storage.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from active_storage (originally 20170806125915) 2 | class CreateActiveStorageTables < ActiveRecord::Migration[5.2] 3 | def change 4 | # Use Active Record's configured type for primary and foreign keys 5 | primary_key_type, foreign_key_type = primary_and_foreign_key_types 6 | 7 | create_table :active_storage_blobs, id: primary_key_type do |t| 8 | t.string :key, null: false 9 | t.string :filename, null: false 10 | t.string :content_type 11 | t.text :metadata 12 | t.string :service_name, null: false 13 | t.bigint :byte_size, null: false 14 | t.string :checksum 15 | 16 | if connection.supports_datetime_with_precision? 17 | t.datetime :created_at, precision: 6, null: false 18 | else 19 | t.datetime :created_at, null: false 20 | end 21 | 22 | t.index [ :key ], unique: true 23 | end 24 | 25 | create_table :active_storage_attachments, id: primary_key_type do |t| 26 | t.string :name, null: false 27 | t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type 28 | t.references :blob, null: false, type: foreign_key_type 29 | 30 | if connection.supports_datetime_with_precision? 31 | t.datetime :created_at, precision: 6, null: false 32 | else 33 | t.datetime :created_at, null: false 34 | end 35 | 36 | t.index [ :record_type, :record_id, :name, :blob_id ], name: :index_active_storage_attachments_uniqueness, unique: true 37 | t.foreign_key :active_storage_blobs, column: :blob_id 38 | end 39 | 40 | create_table :active_storage_variant_records, id: primary_key_type do |t| 41 | t.belongs_to :blob, null: false, index: false, type: foreign_key_type 42 | t.string :variation_digest, null: false 43 | 44 | t.index [ :blob_id, :variation_digest ], name: :index_active_storage_variant_records_uniqueness, unique: true 45 | t.foreign_key :active_storage_blobs, column: :blob_id 46 | end 47 | end 48 | 49 | private 50 | def primary_and_foreign_key_types 51 | config = Rails.configuration.generators 52 | setting = config.options[config.orm][:primary_key_type] 53 | primary_key_type = setting || :primary_key 54 | foreign_key_type = setting || :bigint 55 | [primary_key_type, foreign_key_type] 56 | end 57 | end 58 | -------------------------------------------------------------------------------- /app/controllers/users_controller.rb: -------------------------------------------------------------------------------- 1 | class UsersController < ApplicationController 2 | def index 3 | @users = User.all 4 | if params[:location].present? && params[:query].present? 5 | @users = @users.where(location: params[:location]).where("nickname ILIKE ?", "%#{params[:query]}%") 6 | elsif params[:location].present? 7 | @users = @users.where(location: params[:location]) 8 | elsif params[:query].present? 9 | @users = User.where("nickname ILIKE ?", "%#{params[:query]}%") 10 | end 11 | @users = @users.joins(:languages).where(languages: {name: params[:language] }) if params[:language] 12 | 13 | locations = User.distinct.pluck(:location) 14 | @location_filters = [] 15 | locations.each do |location| 16 | if !location.nil? 17 | @location_filters << location 18 | end 19 | end 20 | 21 | @chat_requests = ChatRequest.where(asker: current_user).or(ChatRequest.where(receiver: current_user)) 22 | @pending_chat_requests = @chat_requests.filter{ |chat| chat.pending? } 23 | @confirmed_chat_requests = @chat_requests.filter{ |chat| chat.confirmed?} 24 | @pinned_chat_requests = @confirmed_chat_requests.filter{ |chat| 25 | if current_user == chat.asker 26 | chat.receiver_is_pinned == true 27 | else 28 | chat.asker_is_pinned == true 29 | end 30 | } 31 | @chat_request = ChatRequest.new 32 | @markers = @users.geocoded.map do |user| 33 | { 34 | lat: user.latitude, 35 | lng: user.longitude, 36 | info_window: render_to_string(partial: "info_window", locals: { user: user }) 37 | } 38 | end 39 | end 40 | 41 | def show 42 | end 43 | 44 | def profile 45 | @user = current_user 46 | @user_languages = current_user.languages.map do |language| 47 | language.name 48 | end 49 | @user_languages = @user_languages.to_sentence 50 | end 51 | 52 | def edit 53 | @user = current_user 54 | @languages = @user.languages.build 55 | end 56 | 57 | def update 58 | @user = current_user 59 | language_id = params[:user][:languages][:id] 60 | @languages = @user.user_languages.build(language_id: language_id) 61 | 62 | if @user.update(sign_up_params) 63 | redirect_to users_path, status: :see_other 64 | else 65 | render :edit, status: :unprocessable_entity 66 | end 67 | end 68 | 69 | private 70 | 71 | def sign_up_params 72 | params.require(:user).permit(:location, :linkedin_url) 73 | end 74 | 75 | def user_params 76 | params.require(:user).permit(:photo, :location) 77 | end 78 | end 79 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | # The test environment is used exclusively to run your application's 4 | # test suite. You never need to work with it otherwise. Remember that 5 | # your test database is "scratch space" for the test suite and is wiped 6 | # and recreated between test runs. Don't rely on the data there! 7 | 8 | Rails.application.configure do 9 | # Settings specified here will take precedence over those in config/application.rb. 10 | 11 | # Turn false under Spring and add config.action_view.cache_template_loading = true. 12 | config.cache_classes = true 13 | 14 | # Eager loading loads your whole application. When running a single test locally, 15 | # this probably isn't necessary. It's a good idea to do in a continuous integration 16 | # system, or in some way before deploying your code. 17 | config.eager_load = ENV["CI"].present? 18 | 19 | # Configure public file server for tests with Cache-Control for performance. 20 | config.public_file_server.enabled = true 21 | config.public_file_server.headers = { 22 | "Cache-Control" => "public, max-age=#{1.hour.to_i}" 23 | } 24 | 25 | # Show full error reports and disable caching. 26 | config.consider_all_requests_local = true 27 | config.action_controller.perform_caching = false 28 | config.cache_store = :null_store 29 | 30 | # Raise exceptions instead of rendering exception templates. 31 | config.action_dispatch.show_exceptions = false 32 | 33 | # Disable request forgery protection in test environment. 34 | config.action_controller.allow_forgery_protection = false 35 | 36 | # Store uploaded files on the local file system in a temporary directory. 37 | config.active_storage.service = :test 38 | 39 | config.action_mailer.perform_caching = false 40 | 41 | # Tell Action Mailer not to deliver emails to the real world. 42 | # The :test delivery method accumulates sent emails in the 43 | # ActionMailer::Base.deliveries array. 44 | config.action_mailer.delivery_method = :test 45 | 46 | # Print deprecation notices to the stderr. 47 | config.active_support.deprecation = :stderr 48 | 49 | # Raise exceptions for disallowed deprecations. 50 | config.active_support.disallowed_deprecation = :raise 51 | 52 | # Tell Active Support which deprecation messages to disallow. 53 | config.active_support.disallowed_deprecation_warnings = [] 54 | 55 | # Raises error for missing translations. 56 | # config.i18n.raise_on_missing_translations = true 57 | 58 | # Annotate rendered view with file names. 59 | # config.action_view.annotate_rendered_view_with_filenames = true 60 | end 61 | -------------------------------------------------------------------------------- /app/assets/stylesheets/components/_chat_request.scss: -------------------------------------------------------------------------------- 1 | 2 | .liststyle{ 3 | list-style: none; 4 | display: grid; 5 | grid-template-columns: repeat(3, 1fr); 6 | grid-auto-rows: auto; 7 | grid-gap: 1rem; 8 | flex-direction: column; 9 | width: 100%; 10 | align-items: flex-start; 11 | font-family: 'Ubuntu', sans-serif; 12 | } 13 | #fontcolor{ 14 | color: white; 15 | transition: all 265ms ease-out; 16 | } 17 | #fontcolor:hover{ 18 | color: rgb(62,79,131); 19 | transform: scale(1.1); 20 | } 21 | .fontcolor{ 22 | color: rgb(20, 19, 19); 23 | transform: scale(1.1); 24 | font-family: 'Roboto Slab', serif; 25 | 26 | } 27 | .fontcolor:hover{ 28 | color: rgb(62,79,131); 29 | transform: scale(1.1); 30 | } 31 | .card-request-pending{ 32 | background-color: #555B6E; 33 | border-radius: 15px; 34 | display:flex; 35 | flex-direction: column; 36 | align-items: center; 37 | box-shadow: rgba(0, 0, 0, 0.7); 38 | color:white; 39 | padding-bottom: 20px; 40 | margin-top: 15px; 41 | height: 10rem; 42 | } 43 | 44 | .card-request-confirmed{ 45 | background-color: #555B6E; 46 | border-radius: 15px; 47 | display:flex; 48 | flex-direction: column; 49 | align-items: center; 50 | box-shadow: rgba(0, 0, 0, 0.7); 51 | color:white; 52 | padding-bottom: 20px; 53 | margin-top: 15px; 54 | height: 10rem; 55 | } 56 | .icon-github-confirmed{ 57 | position: relative; 58 | bottom: -31px; 59 | left: 0px; 60 | } 61 | 62 | .card-request-rejected{ 63 | background-color: #555B6E; 64 | border-radius: 15px; 65 | display:flex; 66 | flex-direction: column; 67 | align-items: center; 68 | box-shadow: rgba(0, 0, 0, 0.7); 69 | color:white; 70 | padding-bottom: 20px; 71 | margin-top: 15px; 72 | height: 10rem; 73 | } 74 | .icon-github-rejected-receiver{ 75 | position: relative; 76 | bottom: -15px; 77 | left: 0px; 78 | } 79 | .icon-github-rejected-asker{ 80 | position: relative; 81 | bottom: -30px; 82 | left: 0px; 83 | } 84 | 85 | .img-request { 86 | width: 50px; 87 | height: 50px; 88 | border-radius: 50%; 89 | display: block; 90 | object-fit: cover; 91 | margin-top:10px; 92 | vertical-align: middle; 93 | position:relative; 94 | align-self:flex-start; 95 | } 96 | p{ 97 | padding-top: 10px; 98 | } 99 | #user-request{ 100 | align-self: flex-start; 101 | padding-left: 10px; 102 | padding-bottom: 20px; 103 | position: absolute; 104 | } 105 | .icon-github-receiver{ 106 | position: relative; 107 | bottom: 84px; 108 | left: 5px; 109 | } 110 | .icon-github-asker{ 111 | position: relative; 112 | bottom: 84px; 113 | left: 0px; 114 | } 115 | .container-request{ 116 | padding-bottom: 25px; 117 | } 118 | -------------------------------------------------------------------------------- /app/assets/stylesheets/pages/_home.scss: -------------------------------------------------------------------------------- 1 | // @import url('https://fonts.googleapis.com/css?family=Poppins:200,300,400,500,600,700,800,900&display=swap'); 2 | 3 | body{ 4 | background-image: linear-gradient(to right, #98A5D0, #F2F2F2); 5 | background-repeat: no-repeat; 6 | background-position: center; 7 | background-size: cover; 8 | background-attachment: fixed; 9 | } 10 | 11 | h1, h2 { 12 | font-family: 'Roboto Slab', serif !important; 13 | } 14 | 15 | h3, h4, h5, h6, p { 16 | font-family: 'Ubuntu', sans-serif !important; 17 | } 18 | 19 | *{ 20 | margin: 0; 21 | padding: 0; 22 | box-sizing: border-box; 23 | font-family: 'Ubuntu', sans-serif; 24 | } 25 | header{ 26 | position: absolute; 27 | top: 0; 28 | left: 0; 29 | width: 100%; 30 | padding: 40px 100px; 31 | z-index: 1000; 32 | display: flex; 33 | justify-content: space-between; 34 | align-items: center; 35 | } 36 | header .logo{ 37 | color: #fff; 38 | cursor: pointer; 39 | } 40 | 41 | .showcase 42 | { 43 | position: absolute; 44 | right: 0; 45 | width: 100%; 46 | min-height: 100vh; 47 | padding: 100px; 48 | display: flex; 49 | justify-content: space-between; 50 | align-items: center; 51 | // background: #111; 52 | transition: 0.5s; 53 | z-index: 2; 54 | } 55 | 56 | .overlay 57 | { 58 | position: absolute; 59 | top: 0; 60 | left: 0; 61 | width: 100%; 62 | height: 100%; 63 | // background: #03a9f4; 64 | mix-blend-mode: overlay; 65 | } 66 | .text 67 | { 68 | position: relative; 69 | z-index: 10; 70 | } 71 | 72 | .text h2 73 | { 74 | font-size: 5em; 75 | font-weight: 800; 76 | color: #fff; 77 | line-height: 1em; 78 | text-transform: uppercase; 79 | } 80 | .text h3 81 | { 82 | font-size: 4em; 83 | font-weight: 700; 84 | color: #fff; 85 | line-height: 1em; 86 | text-transform: uppercase; 87 | } 88 | .text p 89 | { 90 | font-size: 1.1em; 91 | color: #fff; 92 | margin: 20px 0; 93 | font-weight: 400; 94 | max-width: 700px; 95 | } 96 | 97 | 98 | @media (max-width: 991px) 99 | { 100 | .showcase, 101 | .showcase header 102 | { 103 | padding: 40px; 104 | } 105 | .text h2 106 | { 107 | font-size: 3em; 108 | } 109 | .text h3 110 | { 111 | font-size: 2em; 112 | } 113 | } 114 | 115 | .btn-landing{ 116 | background-color: #8d7197; 117 | color: #FAF9F9 !important; 118 | padding: 8px 14px; 119 | text-decoration: none; 120 | border-radius: 15px; 121 | height: 60px; 122 | font-size:20px; 123 | } 124 | 125 | .btn-landing:hover{ 126 | background-color: #FAF9F9 !important; 127 | color: #8d7197 !important; 128 | } 129 | 130 | .socialize { 131 | text-decoration:underline; 132 | } 133 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | config.action_mailer.default_url_options = { host: "http://localhost:3000" } 5 | # Settings specified here will take precedence over those in config/application.rb. 6 | 7 | # In the development environment your application's code is reloaded any time 8 | # it changes. This slows down response time but is perfect for development 9 | # since you don't have to restart the web server when you make code changes. 10 | config.cache_classes = false 11 | 12 | # Do not eager load code on boot. 13 | config.eager_load = false 14 | 15 | # Show full error reports. 16 | config.consider_all_requests_local = true 17 | 18 | # Enable server timing 19 | config.server_timing = true 20 | 21 | # Enable/disable caching. By default caching is disabled. 22 | # Run rails dev:cache to toggle caching. 23 | if Rails.root.join("tmp/caching-dev.txt").exist? 24 | config.action_controller.perform_caching = true 25 | config.action_controller.enable_fragment_cache_logging = true 26 | 27 | config.cache_store = :memory_store 28 | config.public_file_server.headers = { 29 | "Cache-Control" => "public, max-age=#{2.days.to_i}" 30 | } 31 | else 32 | config.action_controller.perform_caching = false 33 | 34 | config.cache_store = :null_store 35 | end 36 | 37 | # Store uploaded files on the local file system (see config/storage.yml for options). 38 | config.active_storage.service = :cloudinary 39 | 40 | # Don't care if the mailer can't send. 41 | config.action_mailer.raise_delivery_errors = false 42 | 43 | config.action_mailer.perform_caching = false 44 | 45 | # Print deprecation notices to the Rails logger. 46 | config.active_support.deprecation = :log 47 | 48 | # Raise exceptions for disallowed deprecations. 49 | config.active_support.disallowed_deprecation = :raise 50 | 51 | # Tell Active Support which deprecation messages to disallow. 52 | config.active_support.disallowed_deprecation_warnings = [] 53 | 54 | # Raise an error on page load if there are pending migrations. 55 | config.active_record.migration_error = :page_load 56 | 57 | # Highlight code that triggered database queries in logs. 58 | config.active_record.verbose_query_logs = true 59 | 60 | # Suppress logger output for asset requests. 61 | config.assets.quiet = true 62 | 63 | # Raises error for missing translations. 64 | # config.i18n.raise_on_missing_translations = true 65 | 66 | # Annotate rendered view with file names. 67 | # config.action_view.annotate_rendered_view_with_filenames = true 68 | 69 | # Uncomment if you wish to allow Action Cable access from any origin. 70 | # config.action_cable.disable_request_forgery_protection = true 71 | end 72 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 | 4 | ruby "3.1.2" 5 | 6 | gem "cloudinary" 7 | # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" 8 | gem "rails", "~> 7.0.3", ">= 7.0.3.1" 9 | 10 | # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] 11 | gem "sprockets-rails" 12 | 13 | # Use postgresql as the database for Active Record 14 | gem "pg", "~> 1.4.6" 15 | 16 | # Use the Puma web server [https://github.com/puma/puma] 17 | gem "puma", "~> 5.0" 18 | 19 | # Bundle and transpile JavaScript [https://github.com/rails/jsbundling-rails] 20 | gem "jsbundling-rails" 21 | 22 | # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] 23 | gem "turbo-rails" 24 | 25 | # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] 26 | gem "stimulus-rails" 27 | 28 | # Build JSON APIs with ease [https://github.com/rails/jbuilder] 29 | gem "jbuilder" 30 | 31 | # Use Redis adapter to run Action Cable in production 32 | gem "redis", "~> 4.0" 33 | 34 | # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] 35 | # gem "kredis" 36 | 37 | # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] 38 | # gem "bcrypt", "~> 3.1.7" 39 | 40 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem 41 | gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] 42 | 43 | # Reduces boot times through caching; required in config/boot.rb 44 | gem "bootsnap", require: false 45 | 46 | # Use Sass to process CSS 47 | gem "sassc-rails" 48 | 49 | # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] 50 | # gem "image_processing", "~> 1.2" 51 | gem "geocoder" 52 | gem "devise" 53 | gem "autoprefixer-rails" 54 | gem "font-awesome-sass", "~> 6.1" 55 | gem "simple_form", github: "heartcombo/simple_form" 56 | group :development, :test do 57 | # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem 58 | gem "debug", platforms: %i[ mri mingw x64_mingw ] 59 | gem "dotenv-rails" 60 | 61 | end 62 | 63 | group :development do 64 | # Use console on exceptions pages [https://github.com/rails/web-console] 65 | gem "web-console" 66 | 67 | # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] 68 | # gem "rack-mini-profiler" 69 | 70 | # Speed up commands on slow machines / big apps [https://github.com/rails/spring] 71 | # gem "spring" 72 | end 73 | 74 | group :test do 75 | # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] 76 | gem "capybara" 77 | gem "selenium-webdriver" 78 | gem "webdrivers" 79 | end 80 | 81 | gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'master' 82 | 83 | # Omniauth gem for GitHub 84 | gem 'omniauth-github' 85 | gem "omniauth-rails_csrf_protection" 86 | -------------------------------------------------------------------------------- /app/assets/stylesheets/components/_chatroom.scss: -------------------------------------------------------------------------------- 1 | .chat-list { 2 | background: #FAF9F9; 3 | margin-top: 9px; 4 | height: calc(100vh - 75px) !important; 5 | flex-direction: column; 6 | margin-right: 10px; 7 | overflow-y: scroll; 8 | width: 25%; 9 | --scrollbarBG: #CFD8DC; 10 | --thumbBG: #dde5e9; 11 | scrollbar-width: thin; 12 | scrollbar-color: var(--thumbBG) var(--scrollbarBG); 13 | } 14 | .chat-list::-webkit-scrollbar { 15 | display: none; 16 | } 17 | .chat-list::-webkit-scrollbar-track { 18 | background: var(--scrollbarBG); 19 | } 20 | .chat-list::-webkit-scrollbar-thumb { 21 | background-color: var(--thumbBG) ; 22 | border-radius: 15px; 23 | border: 3px solid var(--scrollbarBG); 24 | } 25 | ol, ul { 26 | padding-left: 0.5rem !important; 27 | } 28 | 29 | 30 | .chat-list h1 { 31 | margin-top: 10px; 32 | } 33 | .chatroom { 34 | background: #FAF9F9; 35 | margin-top: 9px; 36 | height: calc(100vh - 75px); 37 | display: flex; 38 | flex-direction: column; 39 | justify-content: space-between; 40 | flex-grow: 1; 41 | 42 | h1 { 43 | border-bottom: 1px solid rgba(100,100,100,0.6); 44 | margin-bottom: 0; 45 | padding: 1rem; 46 | } 47 | 48 | .messages { 49 | height: 100%; 50 | overflow-y: scroll; 51 | overflow-x: hidden; 52 | padding: 1rem; 53 | 54 | } 55 | .messages { 56 | --scrollbarBG: #CFD8DC; 57 | --thumbBG: #dde5e9; 58 | } 59 | .messages::-webkit-scrollbar { 60 | display: none; 61 | } 62 | .messages { 63 | scrollbar-width: thin; 64 | scrollbar-color: var(--thumbBG) var(--scrollbarBG); 65 | } 66 | .messages::-webkit-scrollbar-track { 67 | background: var(--scrollbarBG); 68 | } 69 | .messages::-webkit-scrollbar-thumb { 70 | background-color: var(--thumbBG) ; 71 | border-radius: 15px; 72 | border: 3px solid var(--scrollbarBG); 73 | } 74 | 75 | #new_message { 76 | border-top: 1px solid $gray-200; 77 | padding: 1rem; 78 | 79 | .form-group { 80 | margin-bottom: 0; 81 | } 82 | } 83 | } 84 | .sender { 85 | background-color:#1c489037; 86 | padding: 10px; 87 | border-radius: 15px; 88 | margin-right: 0; 89 | margin-left: 80%; 90 | } 91 | 92 | .receiver { 93 | border-radius: 15px; 94 | background-color: rgba(230, 231, 146, 0.683); 95 | padding: 10px; 96 | 97 | } 98 | 99 | .message-item { 100 | word-wrap: break-word; 101 | max-width: 300px; 102 | padding: 5px; 103 | border-radius: 15px; 104 | margin-bottom: 10px; 105 | background-color: #555555; 106 | padding: 10px; 107 | 108 | } 109 | 110 | 111 | 112 | #message{ 113 | display:flex; 114 | } 115 | 116 | 117 | .image-chat img{ 118 | border-radius: 50%; 119 | height: 50px; 120 | width: 50px; 121 | display: flex; 122 | } 123 | 124 | .center-message { 125 | display: flex; 126 | height: 100%; 127 | justify-content: center; 128 | align-items: center; 129 | } 130 | -------------------------------------------------------------------------------- /app/views/shared/_sidebar.html.erb: -------------------------------------------------------------------------------- 1 | 85 | -------------------------------------------------------------------------------- /app/assets/stylesheets/components/_events.scss: -------------------------------------------------------------------------------- 1 | .index-event-card{ 2 | position: absolute; 3 | top: 48px; 4 | right: 20px; 5 | padding: 5px; 6 | width: 250px; 7 | height: 56.5rem; 8 | border-radius: 15px; 9 | border: #555B6E; 10 | border-width: 3px; 11 | border-style: dashed; 12 | color:#555B6E; 13 | } 14 | 15 | .adlink { 16 | color: #8d7197 !important; 17 | text-decoration: none !important; 18 | text-shadow: 2px #555B6E; 19 | } 20 | 21 | .adlink:hover { 22 | color:#555B6E !important; 23 | } 24 | 25 | .swiper-pagination-bullet-active{ 26 | background-color:#8d7197; 27 | } 28 | 29 | .event-cards { 30 | background-color: #555B6E; 31 | height: 18rem; 32 | border-radius: 15px; 33 | display:flex; 34 | flex-direction: column; 35 | align-items: center; 36 | box-shadow: rgba(0, 0, 0, 0.7); 37 | color:white; 38 | width: 500px; 39 | } 40 | .event-button { 41 | background: none; 42 | border: none; 43 | cursor: pointer; 44 | line-height: 1.5; 45 | // font: 700 1.2rem 'Roboto Slab', sans-serif; 46 | padding: 0.5em 1.5em; 47 | letter-spacing: 0.05rem; 48 | margin: 0.5em; 49 | // width: 13rem; 50 | background-color: #8d7197; 51 | border-radius: 15px; 52 | font-size: 18px; 53 | text-decoration: none; 54 | color: white; 55 | margin-top: 30px; 56 | } 57 | 58 | .event-button:hover { 59 | text-decoration: none; 60 | outline: 2px dotted #ffffff; 61 | background-color: white; 62 | color:#8d7197 63 | } 64 | 65 | 66 | .add-event-button{ 67 | background: none; 68 | border: none; 69 | cursor: pointer; 70 | line-height: 1.5; 71 | // font: 700 1.2rem 'Roboto Slab', sans-serif; 72 | padding: 0.5em 1.5em; 73 | letter-spacing: 0.05rem; 74 | margin: 0.5em; 75 | // width: 13rem; 76 | background-color: #8d7197; 77 | border-radius: 15px; 78 | font-size: 18px; 79 | text-decoration: none; 80 | color: white; 81 | 82 | margin: 0 auto; 83 | &:hover{ 84 | background-color: white; 85 | color:#8d7197 86 | } 87 | 88 | } 89 | 90 | 91 | .location-link a { 92 | color: white; 93 | text-decoration: underline; 94 | width: fit-content !important; 95 | margin: 10px; 96 | 97 | } 98 | 99 | .location-link a:hover{ 100 | text-decoration: none; 101 | } 102 | 103 | .details { 104 | margin-bottom: 10px; 105 | height: 190px; 106 | } 107 | 108 | .events-card-details-buttons { 109 | margin-top: auto; 110 | } 111 | 112 | 113 | .event-details { 114 | background-color: #555B6E; 115 | height: 45rem; 116 | border-radius: 15px; 117 | padding: 20px; 118 | align-items: center; 119 | box-shadow: rgba(0, 0, 0, 0.7); 120 | color:white; 121 | margin: 0 auto; 122 | width: 600px; 123 | margin-top: 30px; 124 | margin-bottom: 100px; 125 | } 126 | 127 | .event-container { 128 | margin-top: 100px; 129 | 130 | } 131 | 132 | .event-image { 133 | height: 300px; 134 | width: 300px; 135 | border: 2px solid blanchedalmond; 136 | border-radius: 5px; 137 | margin-bottom: 30px; 138 | object-fit: cover; 139 | } 140 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # PostgreSQL. Versions 9.3 and up are supported. 2 | # 3 | # Install the pg driver: 4 | # gem install pg 5 | # On macOS with Homebrew: 6 | # gem install pg -- --with-pg-config=/usr/local/bin/pg_config 7 | # On macOS with MacPorts: 8 | # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config 9 | # On Windows: 10 | # gem install pg 11 | # Choose the win32 build. 12 | # Install PostgreSQL and put its /bin directory on your path. 13 | # 14 | # Configure Using Gemfile 15 | # gem "pg" 16 | # 17 | default: &default 18 | adapter: postgresql 19 | encoding: unicode 20 | # For details on connection pooling, see Rails configuration guide 21 | # https://guides.rubyonrails.org/configuring.html#database-pooling 22 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 23 | 24 | development: 25 | <<: *default 26 | database: Socialize_development 27 | 28 | # The specified database role being used to connect to postgres. 29 | # To create additional roles in postgres see `$ createuser --help`. 30 | # When left blank, postgres will use the default role. This is 31 | # the same name as the operating system user running Rails. 32 | #username: Socialize 33 | 34 | # The password associated with the postgres role (username). 35 | #password: 36 | 37 | # Connect on a TCP socket. Omitted by default since the client uses a 38 | # domain socket that doesn't need configuration. Windows does not have 39 | # domain sockets, so uncomment these lines. 40 | #host: localhost 41 | 42 | # The TCP port the server listens on. Defaults to 5432. 43 | # If your server runs on a different port number, change accordingly. 44 | #port: 5432 45 | 46 | # Schema search path. The server defaults to $user,public 47 | #schema_search_path: myapp,sharedapp,public 48 | 49 | # Minimum log levels, in increasing order: 50 | # debug5, debug4, debug3, debug2, debug1, 51 | # log, notice, warning, error, fatal, and panic 52 | # Defaults to warning. 53 | #min_messages: notice 54 | 55 | # Warning: The database defined as "test" will be erased and 56 | # re-generated from your development database when you run "rake". 57 | # Do not set this db to the same as development or production. 58 | test: 59 | <<: *default 60 | database: Socialize_test 61 | 62 | # As with config/credentials.yml, you never want to store sensitive information, 63 | # like your database password, in your source code. If your source code is 64 | # ever seen by anyone, they now have access to your database. 65 | # 66 | # Instead, provide the password or a full connection URL as an environment 67 | # variable when you boot the app. For example: 68 | # 69 | # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" 70 | # 71 | # If the connection URL is provided in the special DATABASE_URL environment 72 | # variable, Rails will automatically merge its configuration values on top of 73 | # the values provided in this file. Alternatively, you can specify a connection 74 | # URL environment variable explicitly: 75 | # 76 | # production: 77 | # url: <%= ENV["MY_APP_DATABASE_URL"] %> 78 | # 79 | # Read https://guides.rubyonrails.org/configuring.html#configuring-a-database 80 | # for a full overview on how database connection configuration can be specified. 81 | # 82 | production: 83 | <<: *default 84 | database: Socialize_production 85 | username: Socialize 86 | password: <%= ENV["SOCIALIZE_DATABASE_PASSWORD"] %> 87 | -------------------------------------------------------------------------------- /app/views/users/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
7 |
8 |
9 |
10 |

Do you have troubles with your code and have found no answer?

11 | <%= image_tag "ad-1 (1).jpg", class:'my-2', style:'width:200px' %> 12 |

You tried to search in stackoverflow and still have no results?

13 | <%= image_tag "ad-1 (2).jpg", class:'my-2', style:'width:200px' %> 14 |

Are you looking for an urgent answer and are willing to pay for it?

15 | <%= image_tag "ad-1 (3).jpg", class:'my-2', style:'width:200px' %> 16 |

Check out DevWork

17 | <%= image_tag "dev-work-icon.png", class:'mt-2', style:'width:130px' %> 18 | 19 |
20 |
21 |
22 | 32 |
33 | 43 |
44 | <%= link_to "Reset", users_path, class:"btn btn-secondary rounded-4", style:"width:60px; height:50px; padding:10px" %> 45 |
46 | 47 |
48 | <%#

Developers near you

%> 49 |
50 |
51 |
52 |
53 | <% @users.each do |user| %> 54 | <% next if current_user == user %> 55 | <%= render "user_card", 56 | user: user, 57 | new_chat_request: @chat_request, 58 | chat_requests: @chat_requests, 59 | pending_chat_requests: @pending_chat_requests, 60 | confirmed_chat_requests: @confirmed_chat_requests, 61 | pinned_chat_requests: @pinned_chat_requests 62 | %> 63 | <% end %> 64 |
65 |
66 |
67 |
68 |
69 | -------------------------------------------------------------------------------- /app/views/chat_rooms/show.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |
    6 |

    Chats

    7 |
    8 | 9 |
    10 | <% @chatrooms.each do |chat| %> 11 | <% if current_user == chat.chat_request.asker || current_user == chat.chat_request.receiver %> 12 | 13 | <%= link_to chat_room_path(chat), class: ' border-secondary border-opacity-10 rounded-4 text-decoration-none text-black p-2 my-2' do %> 14 |

    <%= current_user == chat.chat_request.receiver ? chat.chat_request.asker.nickname : chat.chat_request.receiver.nickname %>

    15 |
    16 | <%# %> 17 | <%#

    %> 18 | <%# <% if current_user %> 19 | <%# <% chat.messages.each do |message| %> 20 | <%#

    You: <%= message.content.split.join(" ") %> 21 | <%# <% end %> 22 | <%# <% else %> 23 | <%# <% chat.messages.each do |message| %> 24 | <%#

    <%= chat.chat_request.receiver.nickname %><%#= message.content.split.join(" ") %> 25 | <%# <% end %> 26 | 27 | <%# <% end %> 28 | <%#

    %> 29 | <%#
    %> 30 | <% end %> 31 | <% end %> 32 | <% end %> 33 |
    34 |
35 |
36 |
37 | <% if defined?(@chatroom) %> 38 |
41 | 42 |

<%= current_user == @chatroom.chat_request.receiver ? @chatroom.chat_request.asker.nickname : @chatroom.chat_request.receiver.nickname %>

43 | 44 | 45 |
46 | <% @chatroom.messages.each do |message| %> 47 | <%= render "messages/message", message: message %> 48 | <% end %> 49 |
50 | 51 | <%= simple_form_for [@chatroom, @message], 52 | html: { data: { action: "turbo:submit-end->chatroom-subscription#resetForm" }, class: "d-flex" } do |f| 53 | %> 54 | <%= f.input :content, input_html: { autocomplete: 'off' }, 55 | label: false, 56 | placeholder: "Message #{@chatroom.chat_request.receiver.nickname}", 57 | wrapper_html: {class: "flex-grow-1"} 58 | %> 59 | <%= f.submit "Send", class: "btn btn-info rounded-5 ms-3 mb-3", style:"color:#FAF9F9;" %> 60 | <% end %> 61 | 62 |
63 | <% elsif @chatrooms.any? %> 64 |
65 |
66 |
67 |

Start a chat now!

68 |
69 |
70 |
71 | <% else %> 72 |
73 |
74 |
75 |

Add a friend to see messages here!

76 |
77 |
78 |
79 | <% end %> 80 |
81 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # 5 | # This file was generated by Bundler. 6 | # 7 | # The application 'bundle' is installed as part of a gem, and 8 | # this file is here to facilitate running it. 9 | # 10 | 11 | require "rubygems" 12 | 13 | m = Module.new do 14 | module_function 15 | 16 | def invoked_as_script? 17 | File.expand_path($0) == File.expand_path(__FILE__) 18 | end 19 | 20 | def env_var_version 21 | ENV["BUNDLER_VERSION"] 22 | end 23 | 24 | def cli_arg_version 25 | return unless invoked_as_script? # don't want to hijack other binstubs 26 | return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` 27 | bundler_version = nil 28 | update_index = nil 29 | ARGV.each_with_index do |a, i| 30 | if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN 31 | bundler_version = a 32 | end 33 | next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ 34 | bundler_version = $1 35 | update_index = i 36 | end 37 | bundler_version 38 | end 39 | 40 | def gemfile 41 | gemfile = ENV["BUNDLE_GEMFILE"] 42 | return gemfile if gemfile && !gemfile.empty? 43 | 44 | File.expand_path("../Gemfile", __dir__) 45 | end 46 | 47 | def lockfile 48 | lockfile = 49 | case File.basename(gemfile) 50 | when "gems.rb" then gemfile.sub(/\.rb$/, gemfile) 51 | else "#{gemfile}.lock" 52 | end 53 | File.expand_path(lockfile) 54 | end 55 | 56 | def lockfile_version 57 | return unless File.file?(lockfile) 58 | lockfile_contents = File.read(lockfile) 59 | return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ 60 | Regexp.last_match(1) 61 | end 62 | 63 | def bundler_requirement 64 | @bundler_requirement ||= 65 | env_var_version || cli_arg_version || 66 | bundler_requirement_for(lockfile_version) 67 | end 68 | 69 | def bundler_requirement_for(version) 70 | return "#{Gem::Requirement.default}.a" unless version 71 | 72 | bundler_gem_version = Gem::Version.new(version) 73 | 74 | requirement = bundler_gem_version.approximate_recommendation 75 | 76 | return requirement unless Gem.rubygems_version < Gem::Version.new("2.7.0") 77 | 78 | requirement += ".a" if bundler_gem_version.prerelease? 79 | 80 | requirement 81 | end 82 | 83 | def load_bundler! 84 | ENV["BUNDLE_GEMFILE"] ||= gemfile 85 | 86 | activate_bundler 87 | end 88 | 89 | def activate_bundler 90 | gem_error = activation_error_handling do 91 | gem "bundler", bundler_requirement 92 | end 93 | return if gem_error.nil? 94 | require_error = activation_error_handling do 95 | require "bundler/version" 96 | end 97 | return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) 98 | 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}'`" 99 | exit 42 100 | end 101 | 102 | def activation_error_handling 103 | yield 104 | nil 105 | rescue StandardError, LoadError => e 106 | e 107 | end 108 | end 109 | 110 | m.load_bundler! 111 | 112 | if m.invoked_as_script? 113 | load Gem.bin_path("bundler", "bundle") 114 | end 115 | -------------------------------------------------------------------------------- /app/views/users/_user_card.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 6 | <% if user.photo.key %> 7 | <%= cl_image_tag user.photo.key %> 8 | <% elsif user.image.nil? %> 9 | <%= image_tag "userphoto_square.jpg" %> 10 | <% else %> 11 | <%= image_tag "#{user.image}" %> 12 | <% end %> 13 | 14 |
15 |
16 |
17 |
18 | <%# Find chat requests between current_user and the user in a given card %> 19 | <% chat_requests_exists = chat_requests&.find{ |chat| chat.asker == user || chat.receiver == user } %> 20 | <% chat_request_pending = pending_chat_requests&.find{ |chat| chat.asker == user || chat.receiver == user } %> 21 | <% chat_request_confirmed = confirmed_chat_requests&.find{ |chat| chat.asker == user || chat.receiver == user } %> 22 | <% chat_request_pinned = pinned_chat_requests&.find{ |chat| chat.asker == user || chat.receiver == user } %> 23 | <% if chat_requests_exists.nil? %> 24 | 29 | <% elsif chat_request_pending %> 30 | 35 | <% elsif chat_request_pinned %> 36 | 39 | <% elsif chat_request_confirmed %> 40 | 45 | <% end %> 46 |
47 |
48 |
49 | 63 |
64 |
65 |
66 |
67 |

<%= user.nickname %>

68 |
<%= user.location %>
69 | <% languages = [] %> 70 | <% user.languages.each do |language| %> 71 | <% languages << language.name %> 72 | <% end %> 73 |
Main language: <%= languages.to_sentence %>
74 |
75 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Socialize! The only Developers-Meetup in Web 6 | <% favicon_link_tag %> 7 | 8 | 9 | 10 | <%= meta_title %> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | <%= csrf_meta_tags %> 22 | <%= csp_meta_tag %> 23 | <%# Swiper Bundle %> 24 | 25 | <%# Popper JS %> 26 | 27 | <%# MAP BOX %> 28 | 29 | 30 | <%# FontAwesome %> 31 | 32 | <%# Box Icons %> 33 | 34 | <%# Google Fonts %> 35 | 36 | 37 | 38 | 39 | <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> 40 | <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %> 41 | 60 | 61 | 62 |
63 | <% unless current_page?(root_path) %> 64 | <%= render "shared/sidebar" %> 65 | <% end %> 66 | <%= render "shared/flashes" %> 67 |
68 | <%= yield %> 69 |
70 | <% unless current_page?(root_path) %> 71 | <%= render "shared/footer" %> 72 | <% end %> 73 |
74 | 75 | 76 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /app/views/shared/_footer.html.erb: -------------------------------------------------------------------------------- 1 | 100 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | config.action_mailer.default_url_options = { host: "http://TODO_PUT_YOUR_DOMAIN_HERE" } 5 | # Settings specified here will take precedence over those in config/application.rb. 6 | 7 | # Code is not reloaded between requests. 8 | config.cache_classes = true 9 | 10 | # Eager load code on boot. This eager loads most of Rails and 11 | # your application in memory, allowing both threaded web servers 12 | # and those relying on copy on write to perform better. 13 | # Rake tasks automatically ignore this option for performance. 14 | config.eager_load = true 15 | 16 | # Full error reports are disabled and caching is turned on. 17 | config.consider_all_requests_local = false 18 | config.action_controller.perform_caching = true 19 | 20 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] 21 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). 22 | # config.require_master_key = true 23 | 24 | # Disable serving static files from the `/public` folder by default since 25 | # Apache or NGINX already handles this. 26 | config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? 27 | 28 | # Compress CSS using a preprocessor. 29 | # config.assets.css_compressor = :sass 30 | 31 | # Do not fallback to assets pipeline if a precompiled asset is missed. 32 | config.assets.compile = false 33 | 34 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 35 | # config.asset_host = "http://assets.example.com" 36 | 37 | # Specifies the header that your server uses for sending files. 38 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache 39 | # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX 40 | 41 | # Store uploaded files on the local file system (see config/storage.yml for options). 42 | config.active_storage.service = :cloudinary 43 | 44 | # Mount Action Cable outside main process or domain. 45 | # config.action_cable.mount_path = nil 46 | # config.action_cable.url = "wss://example.com/cable" 47 | # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] 48 | 49 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 50 | config.force_ssl = true 51 | 52 | # Include generic and useful information about system operation, but avoid logging too much 53 | # information to avoid inadvertent exposure of personally identifiable information (PII). 54 | config.log_level = :info 55 | 56 | # Prepend all log lines with the following tags. 57 | config.log_tags = [ :request_id ] 58 | 59 | # Use a different cache store in production. 60 | # config.cache_store = :mem_cache_store 61 | 62 | # Use a real queuing backend for Active Job (and separate queues per environment). 63 | # config.active_job.queue_adapter = :resque 64 | # config.active_job.queue_name_prefix = "Socialize_production" 65 | 66 | config.action_mailer.perform_caching = false 67 | 68 | # Ignore bad email addresses and do not raise email delivery errors. 69 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 70 | # config.action_mailer.raise_delivery_errors = false 71 | 72 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 73 | # the I18n.default_locale when a translation cannot be found). 74 | config.i18n.fallbacks = true 75 | 76 | # Don't log any deprecations. 77 | config.active_support.report_deprecations = false 78 | 79 | # Use default logging formatter so that PID and timestamp are not suppressed. 80 | config.log_formatter = ::Logger::Formatter.new 81 | 82 | # Use a different logger for distributed setups. 83 | # require "syslog/logger" 84 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") 85 | 86 | if ENV["RAILS_LOG_TO_STDOUT"].present? 87 | logger = ActiveSupport::Logger.new(STDOUT) 88 | logger.formatter = config.log_formatter 89 | config.logger = ActiveSupport::TaggedLogging.new(logger) 90 | end 91 | 92 | # Do not dump schema after migrations. 93 | config.active_record.dump_schema_after_migration = false 94 | end 95 | -------------------------------------------------------------------------------- /config/locales/devise.en.yml: -------------------------------------------------------------------------------- 1 | # Additional translations at https://github.com/heartcombo/devise/wiki/I18n 2 | 3 | en: 4 | devise: 5 | confirmations: 6 | confirmed: "Your email address has been successfully confirmed." 7 | send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes." 8 | 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." 9 | failure: 10 | already_authenticated: "You are already signed in." 11 | inactive: "Your account is not activated yet." 12 | invalid: "Invalid %{authentication_keys} or password." 13 | locked: "Your account is locked." 14 | last_attempt: "You have one more attempt before your account is locked." 15 | not_found_in_database: "Invalid %{authentication_keys} or password." 16 | timeout: "Your session expired. Please sign in again to continue." 17 | unauthenticated: "You need to sign in or sign up before continuing." 18 | unconfirmed: "You have to confirm your email address before continuing." 19 | mailer: 20 | confirmation_instructions: 21 | subject: "Confirmation instructions" 22 | reset_password_instructions: 23 | subject: "Reset password instructions" 24 | unlock_instructions: 25 | subject: "Unlock instructions" 26 | email_changed: 27 | subject: "Email Changed" 28 | password_change: 29 | subject: "Password Changed" 30 | omniauth_callbacks: 31 | failure: "Could not authenticate you from %{kind} because \"%{reason}\"." 32 | success: "Successfully authenticated from %{kind} account." 33 | passwords: 34 | 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." 35 | send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes." 36 | 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." 37 | updated: "Your password has been changed successfully. You are now signed in." 38 | updated_not_active: "Your password has been changed successfully." 39 | registrations: 40 | destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon." 41 | signed_up: "Welcome! You have signed up successfully." 42 | signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." 43 | signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." 44 | 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." 45 | 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." 46 | updated: "Your account has been updated successfully." 47 | updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again." 48 | sessions: 49 | signed_in: "Signed in successfully." 50 | signed_out: "Signed out successfully." 51 | already_signed_out: "Signed out successfully." 52 | unlocks: 53 | send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes." 54 | send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes." 55 | unlocked: "Your account has been unlocked successfully. Please sign in to continue." 56 | errors: 57 | messages: 58 | already_confirmed: "was already confirmed, please try signing in" 59 | confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" 60 | expired: "has expired, please request a new one" 61 | not_found: "not found" 62 | not_locked: "was not locked" 63 | not_saved: 64 | one: "1 error prohibited this %{resource} from being saved:" 65 | other: "%{count} errors prohibited this %{resource} from being saved:" 66 | -------------------------------------------------------------------------------- /app/assets/stylesheets/components/_sidebar.scss: -------------------------------------------------------------------------------- 1 | /* Google Font Link */ 2 | // @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap'); 3 | *{ 4 | margin: 0; 5 | padding: 0; 6 | box-sizing: border-box; 7 | font-family: 'Ubuntu', sans-serif; 8 | } 9 | .sidebar{ 10 | position: fixed; 11 | left: 0; 12 | top: 0; 13 | height: 100%; 14 | width: 86px; 15 | background-color: #555B6E; 16 | padding: 6px 14px; 17 | z-index: 99; 18 | transition: all 0.5s ease; 19 | } 20 | .sidebar.open{ 21 | width: 250px; 22 | } 23 | .sidebar .logo-details{ 24 | height: 60px; 25 | display: flex; 26 | align-items: center; 27 | position: relative; 28 | } 29 | .sidebar .logo-details .icon{ 30 | opacity: 0; 31 | transition: all 0.5s ease; 32 | } 33 | .sidebar .logo-details .logo_name{ 34 | color: #FAF9F9; 35 | font-size: 20px; 36 | font-weight: 600; 37 | opacity: 0; 38 | transition: all 0.5s ease; 39 | } 40 | .sidebar.open .logo-details .icon, 41 | .sidebar.open .logo-details .logo_name{ 42 | opacity: 1; 43 | } 44 | .sidebar .logo-details #btn{ 45 | position: absolute; 46 | top: 50%; 47 | right: 0; 48 | transform: translateY(-50%); 49 | font-size: 22px; 50 | transition: all 0.4s ease; 51 | font-size: 23px; 52 | text-align: center; 53 | cursor: pointer; 54 | transition: all 0.5s ease; 55 | color:#FAF9F9 56 | } 57 | .sidebar.open .logo-details #btn{ 58 | text-align: right; 59 | } 60 | .sidebar i{ 61 | color: rgb(0, 0, 0); 62 | height: 60px; 63 | min-width: 50px; 64 | font-size: 28px; 65 | text-align: center; 66 | line-height: 60px; 67 | } 68 | .sidebar .nav-list{ 69 | margin-top: 20px; 70 | height: 100%; 71 | } 72 | .sidebar li{ 73 | position: relative; 74 | margin: 8px 0; 75 | list-style: none; 76 | } 77 | .sidebar li .tooltip{ 78 | position: absolute; 79 | top: -20px; 80 | left: calc(100% + 15px); 81 | z-index: 3; 82 | background: #FAF9F9; 83 | box-shadow: 0 5px 10px rgba(207, 136, 136, 0.3); 84 | padding: 6px 12px; 85 | border-radius: 15px; 86 | font-size: 15px; 87 | font-weight: 400; 88 | opacity: 0; 89 | white-space: nowrap; 90 | pointer-events: none; 91 | transition: 0s; 92 | } 93 | .sidebar li:hover .tooltip{ 94 | opacity: 1; 95 | pointer-events: auto; 96 | transition: all 0.4s ease; 97 | top: 50%; 98 | transform: translateY(-50%); 99 | } 100 | .sidebar.open li .tooltip{ 101 | display: none; 102 | } 103 | .sidebar input{ 104 | font-size: 15px; 105 | color: #8d7197; 106 | font-weight: 400; 107 | outline: none; 108 | height: 50px; 109 | width: 100%; 110 | width: 50px; 111 | border: none; 112 | border-radius: 15px; 113 | transition: all 0.5s ease; 114 | background: #FAF9F9; 115 | } 116 | .sidebar.open input{ 117 | padding: 0 20px 0 50px; 118 | width: 100%; 119 | } 120 | .sidebar .bx-search{ 121 | position: absolute; 122 | top: 50%; 123 | left: 0; 124 | transform: translateY(-50%); 125 | font-size: 22px; 126 | background: #FAF9F9; 127 | color: rgb(0, 0, 0); 128 | } 129 | .sidebar.open .bx-search:hover{ 130 | background: #FAF9F9; 131 | color: rgb(0, 0, 0); 132 | } 133 | .sidebar .bx-search:hover{ 134 | background: rgb(0, 0, 0); 135 | color: #FAF9F9; 136 | } 137 | .sidebar li a{ 138 | display: flex; 139 | height: 100%; 140 | width: 100%; 141 | border-radius: 15px; 142 | align-items: center; 143 | text-decoration: none; 144 | transition: all 0.4s ease; 145 | background: #FAF9F9; 146 | } 147 | .sidebar li a:hover{ 148 | background: rgb(0, 0, 0); 149 | } 150 | .sidebar li a .links_name{ 151 | color: rgb(0, 0, 0); 152 | font-size: 15px; 153 | font-weight: 400; 154 | white-space: nowrap; 155 | opacity: 0; 156 | pointer-events: none; 157 | transition: 0.4s; 158 | } 159 | .sidebar.open li a .links_name{ 160 | opacity: 1; 161 | pointer-events: auto; 162 | } 163 | .sidebar li a:hover .links_name, 164 | .sidebar li a:hover i{ 165 | transition: all 0.5s ease; 166 | color: #FAF9F9; 167 | } 168 | .sidebar li i{ 169 | height: 50px; 170 | line-height: 50px; 171 | font-size: 18px; 172 | border-radius: 15px; 173 | } 174 | .sidebar li.profile{ 175 | position: fixed; 176 | height: 60px; 177 | width: 78px; 178 | left: 0; 179 | bottom: -8px; 180 | padding: 10px 14px; 181 | background: #D1AAAA; 182 | transition: all 0.5s ease; 183 | overflow: hidden; 184 | } 185 | .sidebar.open li.profile{ 186 | width: 250px; 187 | } 188 | .sidebar li .profile-details{ 189 | display: flex; 190 | align-items: center; 191 | flex-wrap: nowrap; 192 | } 193 | .sidebar li img{ 194 | height: 45px; 195 | width: 45px; 196 | object-fit: cover; 197 | border-radius: 15px; 198 | margin-right: 10px; 199 | } 200 | .sidebar li.profile .name, 201 | .sidebar li.profile .job{ 202 | font-size: 15px; 203 | font-weight: 400; 204 | color: #fff; 205 | white-space: nowrap; 206 | } 207 | .sidebar li.profile .job{ 208 | font-size: 12px; 209 | } 210 | .sidebar .profile #log_out{ 211 | position: absolute; 212 | top: 50%; 213 | right: 0; 214 | transform: translateY(-50%); 215 | background: #D1AAAA; 216 | width: 100%; 217 | height: 60px; 218 | line-height: 60px; 219 | border-radius: 15px; 220 | transition: all 0.5s ease; 221 | } 222 | .sidebar.open .profile #log_out{ 223 | width: 50px; 224 | background: none; 225 | } 226 | .home-section{ 227 | position: relative; 228 | background: #000000; 229 | min-height: 100vh; 230 | top: 0; 231 | left: 78px; 232 | width: calc(100% - 78px); 233 | transition: all 0.5s ease; 234 | z-index: 2; 235 | } 236 | .sidebar.open ~ .home-section{ 237 | left: 250px; 238 | width: calc(100% - 250px); 239 | } 240 | .home-section .text{ 241 | display: inline-block; 242 | color: #D1AAAA; 243 | font-size: 25px; 244 | font-weight: 500; 245 | margin: 18px 246 | } 247 | @media (max-width: 420px) { 248 | .sidebar li .tooltip{ 249 | display: none; 250 | } 251 | } 252 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # This file is the source Rails uses to define your schema when running `bin/rails 6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to 7 | # be faster and is potentially less error prone than running all of your 8 | # migrations from scratch. Old migrations may fail to apply correctly if those 9 | # migrations use external dependencies or application code. 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema[7.0].define(version: 2022_09_15_074133) do 14 | # These are extensions that must be enabled in order to support this database 15 | enable_extension "plpgsql" 16 | 17 | create_table "active_storage_attachments", force: :cascade do |t| 18 | t.string "name", null: false 19 | t.string "record_type", null: false 20 | t.bigint "record_id", null: false 21 | t.bigint "blob_id", null: false 22 | t.datetime "created_at", null: false 23 | t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" 24 | t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true 25 | end 26 | 27 | create_table "active_storage_blobs", force: :cascade do |t| 28 | t.string "key", null: false 29 | t.string "filename", null: false 30 | t.string "content_type" 31 | t.text "metadata" 32 | t.string "service_name", null: false 33 | t.bigint "byte_size", null: false 34 | t.string "checksum" 35 | t.datetime "created_at", null: false 36 | t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true 37 | end 38 | 39 | create_table "active_storage_variant_records", force: :cascade do |t| 40 | t.bigint "blob_id", null: false 41 | t.string "variation_digest", null: false 42 | t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true 43 | end 44 | 45 | create_table "chat_requests", force: :cascade do |t| 46 | t.datetime "created_at", null: false 47 | t.datetime "updated_at", null: false 48 | t.bigint "asker_id" 49 | t.bigint "receiver_id" 50 | t.integer "status", default: 0, null: false 51 | t.boolean "asker_is_pinned", default: false 52 | t.boolean "receiver_is_pinned", default: false 53 | t.index ["asker_id"], name: "index_chat_requests_on_asker_id" 54 | t.index ["receiver_id"], name: "index_chat_requests_on_receiver_id" 55 | end 56 | 57 | create_table "chat_rooms", force: :cascade do |t| 58 | t.bigint "chat_request_id", null: false 59 | t.datetime "created_at", null: false 60 | t.datetime "updated_at", null: false 61 | t.string "name" 62 | t.index ["chat_request_id"], name: "index_chat_rooms_on_chat_request_id" 63 | end 64 | 65 | create_table "events", force: :cascade do |t| 66 | t.string "title" 67 | t.datetime "created_at", null: false 68 | t.datetime "updated_at", null: false 69 | t.bigint "users_id" 70 | t.string "theme" 71 | t.integer "price" 72 | t.text "description" 73 | t.date "date" 74 | t.time "time" 75 | t.string "location" 76 | t.string "image" 77 | t.index ["users_id"], name: "index_events_on_users_id" 78 | end 79 | 80 | create_table "languages", force: :cascade do |t| 81 | t.string "name" 82 | t.datetime "created_at", null: false 83 | t.datetime "updated_at", null: false 84 | end 85 | 86 | create_table "messages", force: :cascade do |t| 87 | t.string "content" 88 | t.bigint "user_id", null: false 89 | t.bigint "chat_room_id", null: false 90 | t.datetime "created_at", null: false 91 | t.datetime "updated_at", null: false 92 | t.index ["chat_room_id"], name: "index_messages_on_chat_room_id" 93 | t.index ["user_id"], name: "index_messages_on_user_id" 94 | end 95 | 96 | create_table "user_languages", force: :cascade do |t| 97 | t.bigint "language_id", null: false 98 | t.bigint "user_id", null: false 99 | t.datetime "created_at", null: false 100 | t.datetime "updated_at", null: false 101 | t.index ["language_id"], name: "index_user_languages_on_language_id" 102 | t.index ["user_id"], name: "index_user_languages_on_user_id" 103 | end 104 | 105 | create_table "users", force: :cascade do |t| 106 | t.string "email", default: "", null: false 107 | t.string "encrypted_password", default: "", null: false 108 | t.string "reset_password_token" 109 | t.datetime "reset_password_sent_at" 110 | t.datetime "remember_created_at" 111 | t.datetime "created_at", null: false 112 | t.datetime "updated_at", null: false 113 | t.string "nickname" 114 | t.float "latitude" 115 | t.float "longitude" 116 | t.string "location" 117 | t.string "name", default: "", null: false 118 | t.string "provider" 119 | t.string "uid" 120 | t.string "image" 121 | t.string "html_url" 122 | t.string "linkedin_url" 123 | t.index ["email"], name: "index_users_on_email", unique: true 124 | t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true 125 | end 126 | 127 | add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" 128 | add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" 129 | add_foreign_key "chat_requests", "users", column: "asker_id" 130 | add_foreign_key "chat_requests", "users", column: "receiver_id" 131 | add_foreign_key "chat_rooms", "chat_requests" 132 | add_foreign_key "events", "users", column: "users_id" 133 | add_foreign_key "messages", "chat_rooms" 134 | add_foreign_key "messages", "users" 135 | add_foreign_key "user_languages", "languages" 136 | add_foreign_key "user_languages", "users" 137 | end 138 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 7 | 8 | 9 | 10 | 149 | 150 | 151 | 152 | 153 | 154 |

500

155 |

Unexpected Error :(

156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 | 174 | 181 | 182 | 183 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 7 | 8 | 9 | 10 | 154 | 155 | 156 | 157 | 158 |

404

159 | 160 |
161 |
162 |
163 |
164 |
165 |
166 | 167 | 168 | 169 | 212 | 213 | -------------------------------------------------------------------------------- /app/assets/stylesheets/pages/_index.scss: -------------------------------------------------------------------------------- 1 | @import "home"; 2 | 3 | 4 | .button { 5 | background: none; 6 | border: none; 7 | cursor: pointer; 8 | line-height: 1.5; 9 | // font: 700 1.2rem 'Roboto Slab', sans-serif; 10 | padding: 0.5em 1.5em; 11 | letter-spacing: 0.05rem; 12 | margin: 0.5em; 13 | // width: 13rem; 14 | background-color: #8d7197; 15 | border-radius: 15px; 16 | font-size: 18px; 17 | text-decoration: none; 18 | } 19 | 20 | 21 | .button:focus { 22 | outline: 2px dotted #ffffff; 23 | } 24 | 25 | 26 | .card { 27 | background-color: #555B6E; 28 | height: 18rem; 29 | border-radius: 15px; 30 | display:flex; 31 | flex-direction: column; 32 | align-items: center; 33 | box-shadow: rgba(0, 0, 0, 0.7); 34 | color:white; 35 | // padding-top: 15px; 36 | // overflow: scroll; 37 | } 38 | 39 | .card-name { 40 | font-size: 1.5rem; 41 | } 42 | 43 | .card-icon-container { 44 | position: relative; 45 | } 46 | 47 | .chat-list { 48 | height: 100vh; 49 | margin: 0 auto; 50 | } 51 | 52 | .draw-border { 53 | box-shadow: inset 0 0 0 4px #ffffff1c; 54 | color: #0000001c; 55 | padding: 8px 25px; 56 | border-radius: 15px; 57 | margin-top: 30px; 58 | } 59 | 60 | .draw-border::before, 61 | .draw-border::after { 62 | border: 0 solid transparent; 63 | box-sizing: border-box; 64 | pointer-events: none; 65 | position: absolute; 66 | width: 0rem; 67 | height: 0; 68 | bottom: 0; 69 | right: 0; 70 | } 71 | 72 | .draw-border:hover::before { 73 | -webkit-transition-delay: 0s, 0s, 0.25s; 74 | transition-delay: 0s, 0s, 0.25s; 75 | } 76 | 77 | .draw-border:hover::after { 78 | -webkit-transition-delay: 0s, 0.25s, 0s; 79 | } 80 | 81 | // .dropdown { 82 | // width: 250px; 83 | // justify-content: flex-end; 84 | // } 85 | 86 | figure { 87 | display: grid; 88 | gap: 1ex; 89 | margin: 0; 90 | text-align: center; 91 | position: relative; 92 | cursor: pointer; 93 | user-select: none; 94 | transition: transform .2s ease-in-out; 95 | width: 148px; 96 | height: 148px; 97 | 98 | &:hover { 99 | transform: scale(1.1); 100 | } 101 | 102 | &:last-child::after { 103 | content: ""; 104 | position: absolute; 105 | right: 2rem; 106 | inline-size: 1rem; 107 | block-size: 100%; 108 | } 109 | 110 | & > picture { 111 | width: 100%; 112 | display: inline-block; 113 | // inline-size: 10ch; 114 | // block-size: 10ch; 115 | border-radius: 50%; 116 | background: #555B6E; 117 | width: 148px; 118 | height: 148px; 119 | 120 | & > img { 121 | display: block; 122 | // inline-size: 100%; 123 | // block-size: 100%; 124 | height: 100%; 125 | object-fit: cover; 126 | // clip-path: circle(42%); 127 | width: 100%; 128 | max-width: 100%; 129 | // width: 160px; 130 | border-radius: 50%; 131 | // border: 1px solid black; 132 | object-fit: cover; 133 | padding: 1px; 134 | // box-shadow: 0px 0px 30px #98A5D0; 135 | } 136 | } 137 | } 138 | 139 | .flex-container{ 140 | display: flex; 141 | justify-content: center; 142 | } 143 | 144 | .grid-container { 145 | display: grid; 146 | grid-template-columns: 1fr 1fr; 147 | grid-gap: 20px; 148 | font-size: 1.2em; 149 | } 150 | 151 | .social-icons { 152 | padding: 0; 153 | list-style: none; 154 | margin: 0em; 155 | display: flex; 156 | } 157 | 158 | .social-icons li { 159 | display: inline-block; 160 | margin: 0.15em; 161 | position: relative; 162 | font-size: 1em; 163 | } 164 | 165 | .social-icons i { 166 | color: #fff; 167 | position: absolute; 168 | top: 14px; 169 | left: 14px; 170 | transition: all 265ms ease-out; 171 | } 172 | 173 | .social-icons a { 174 | display: inline-block; 175 | } 176 | 177 | .social-icons a:before { 178 | transform: scale(1); 179 | -ms-transform: scale(1); 180 | -webkit-transform: scale(1); 181 | content: " "; 182 | width: 45px; 183 | height: 45px; 184 | border-radius: 100%; 185 | display: block; 186 | background: linear-gradient(45deg, #8d7197, #8d7197); 187 | transition: all 200ms ease-out; 188 | } 189 | 190 | .social-icons a:hover:before { 191 | transform: scale(0); 192 | transition: all 200ms ease-in; 193 | } 194 | 195 | .social-icons a:hover i { 196 | transform: scale(2.4); 197 | -ms-transform: scale(2.4); 198 | -webkit-transform: scale(2.4); 199 | color: #ffffff; 200 | background: -webkit-linear-gradient(45deg, #FAF9F9, #FAF9F9); 201 | -webkit-background-clip: text; 202 | -webkit-text-fill-color: transparent; 203 | transition: all 265ms ease-in; 204 | } 205 | 206 | .swiper-horizontal>.swiper-pagination-bullets, 207 | .swiper-pagination-bullets.swiper-pagination-horizontal, 208 | .swiper-pagination-custom, .swiper-pagination-fraction { 209 | bottom:-5px; 210 | } 211 | 212 | .swiper-slide { 213 | text-align: center; 214 | text-align: center; 215 | font-size: 18px; 216 | box-shadow: 0 0 12px 0 rgba(0,0,0,0.5); 217 | margin-top: 30px; 218 | margin-bottom: 30px; 219 | display: -webkit-box; 220 | display: -ms-flexbox; 221 | display: -webkit-flex; 222 | display: flex; 223 | -webkit-box-pack: center; 224 | -ms-flex-pack: center; 225 | -webkit-justify-content: center; 226 | justify-content: center; 227 | -webkit-box-align: center; 228 | -ms-flex-align: center; 229 | -webkit-align-items: center; 230 | align-items: center; 231 | } 232 | 233 | .swiper-button-next { 234 | position:relative !important; 235 | bottom: -190px; 236 | right: -10px !important; 237 | color: #8d7197; 238 | } 239 | 240 | .swiper-button-prev{ 241 | position:relative !important; 242 | bottom: -190px; 243 | left: -10px !important; 244 | color: #8d7197; 245 | } 246 | 247 | 248 | #map { 249 | border-radius: 15px; 250 | border: 0px solid black; 251 | margin-bottom: 30px; 252 | box-shadow: 0 0 12px 0 rgba(0,0,0,0.5); 253 | } 254 | 255 | #container { 256 | display: flex; 257 | justify-content:start; 258 | align-items: center; 259 | } 260 | 261 | .to-pin-user { 262 | opacity: 0.3; 263 | color: white; 264 | } 265 | 266 | .pinned-user { 267 | opacity: 1; 268 | color: white; 269 | } 270 | 271 | .mapboxgl-ctrl-bottom-right{ 272 | display: none; 273 | } 274 | 275 | .mapboxgl-ctrl-bottom-left{ 276 | display: none; 277 | } 278 | .swiper-pagination-bullet-active{ 279 | background-color:#8d7197; 280 | } 281 | 282 | .indexcardpage { 283 | max-width: 1420px !important; 284 | } 285 | -------------------------------------------------------------------------------- /config/initializers/simple_form.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # 3 | # Uncomment this and change the path if necessary to include your own 4 | # components. 5 | # See https://github.com/heartcombo/simple_form#custom-components to know 6 | # more about custom components. 7 | # Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f } 8 | # 9 | # Use this setup block to configure all options available in SimpleForm. 10 | SimpleForm.setup do |config| 11 | # Wrappers are used by the form builder to generate a 12 | # complete input. You can remove any component from the 13 | # wrapper, change the order or even add your own to the 14 | # stack. The options given below are used to wrap the 15 | # whole input. 16 | config.wrappers :default, class: :input, 17 | hint_class: :field_with_hint, error_class: :field_with_errors, valid_class: :field_without_errors do |b| 18 | ## Extensions enabled by default 19 | # Any of these extensions can be disabled for a 20 | # given input by passing: `f.input EXTENSION_NAME => false`. 21 | # You can make any of these extensions optional by 22 | # renaming `b.use` to `b.optional`. 23 | 24 | # Determines whether to use HTML5 (:email, :url, ...) 25 | # and required attributes 26 | b.use :html5 27 | 28 | # Calculates placeholders automatically from I18n 29 | # You can also pass a string as f.input placeholder: "Placeholder" 30 | b.use :placeholder 31 | 32 | ## Optional extensions 33 | # They are disabled unless you pass `f.input EXTENSION_NAME => true` 34 | # to the input. If so, they will retrieve the values from the model 35 | # if any exists. If you want to enable any of those 36 | # extensions by default, you can change `b.optional` to `b.use`. 37 | 38 | # Calculates maxlength from length validations for string inputs 39 | # and/or database column lengths 40 | b.optional :maxlength 41 | 42 | # Calculate minlength from length validations for string inputs 43 | b.optional :minlength 44 | 45 | # Calculates pattern from format validations for string inputs 46 | b.optional :pattern 47 | 48 | # Calculates min and max from length validations for numeric inputs 49 | b.optional :min_max 50 | 51 | # Calculates readonly automatically from readonly attributes 52 | b.optional :readonly 53 | 54 | ## Inputs 55 | # b.use :input, class: 'input', error_class: 'is-invalid', valid_class: 'is-valid' 56 | b.use :label_input 57 | b.use :hint, wrap_with: { tag: :span, class: :hint } 58 | b.use :error, wrap_with: { tag: :span, class: :error } 59 | 60 | ## full_messages_for 61 | # If you want to display the full error message for the attribute, you can 62 | # use the component :full_error, like: 63 | # 64 | # b.use :full_error, wrap_with: { tag: :span, class: :error } 65 | end 66 | 67 | # The default wrapper to be used by the FormBuilder. 68 | config.default_wrapper = :default 69 | 70 | # Define the way to render check boxes / radio buttons with labels. 71 | # Defaults to :nested for bootstrap config. 72 | # inline: input + label 73 | # nested: label > input 74 | config.boolean_style = :nested 75 | 76 | # Default class for buttons 77 | config.button_class = 'btn' 78 | 79 | # Method used to tidy up errors. Specify any Rails Array method. 80 | # :first lists the first message for each field. 81 | # Use :to_sentence to list all errors for each field. 82 | # config.error_method = :first 83 | 84 | # Default tag used for error notification helper. 85 | config.error_notification_tag = :div 86 | 87 | # CSS class to add for error notification helper. 88 | config.error_notification_class = 'error_notification' 89 | 90 | # Series of attempts to detect a default label method for collection. 91 | # config.collection_label_methods = [ :to_label, :name, :title, :to_s ] 92 | 93 | # Series of attempts to detect a default value method for collection. 94 | # config.collection_value_methods = [ :id, :to_s ] 95 | 96 | # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none. 97 | # config.collection_wrapper_tag = nil 98 | 99 | # You can define the class to use on all collection wrappers. Defaulting to none. 100 | # config.collection_wrapper_class = nil 101 | 102 | # You can wrap each item in a collection of radio/check boxes with a tag, 103 | # defaulting to :span. 104 | # config.item_wrapper_tag = :span 105 | 106 | # You can define a class to use in all item wrappers. Defaulting to none. 107 | # config.item_wrapper_class = nil 108 | 109 | # How the label text should be generated altogether with the required text. 110 | # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" } 111 | 112 | # You can define the class to use on all labels. Default is nil. 113 | # config.label_class = nil 114 | 115 | # You can define the default class to be used on forms. Can be overridden 116 | # with `html: { :class }`. Defaulting to none. 117 | # config.default_form_class = nil 118 | 119 | # You can define which elements should obtain additional classes 120 | # config.generate_additional_classes_for = [:wrapper, :label, :input] 121 | 122 | # Whether attributes are required by default (or not). Default is true. 123 | # config.required_by_default = true 124 | 125 | # Tell browsers whether to use the native HTML5 validations (novalidate form option). 126 | # These validations are enabled in SimpleForm's internal config but disabled by default 127 | # in this configuration, which is recommended due to some quirks from different browsers. 128 | # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations, 129 | # change this configuration to true. 130 | config.browser_validations = true 131 | 132 | # Custom mappings for input types. This should be a hash containing a regexp 133 | # to match as key, and the input type that will be used when the field name 134 | # matches the regexp as value. 135 | # config.input_mappings = { /count/ => :integer } 136 | 137 | # Custom wrappers for input types. This should be a hash containing an input 138 | # type as key and the wrapper that will be used for all inputs with specified type. 139 | # config.wrapper_mappings = { string: :prepend } 140 | 141 | # Namespaces where SimpleForm should look for custom input classes that 142 | # override default inputs. 143 | # config.custom_inputs_namespaces << "CustomInputs" 144 | 145 | # Default priority for time_zone inputs. 146 | # config.time_zone_priority = nil 147 | 148 | # Default priority for country inputs. 149 | # config.country_priority = nil 150 | 151 | # When false, do not use translations for labels. 152 | # config.translate_labels = true 153 | 154 | # Automatically discover new inputs in Rails' autoload path. 155 | # config.inputs_discovery = true 156 | 157 | # Cache SimpleForm inputs discovery 158 | # config.cache_discovery = !Rails.env.development? 159 | 160 | # Default class for inputs 161 | # config.input_class = nil 162 | 163 | # Define the default class of the input wrapper of the boolean input. 164 | config.boolean_label_class = 'checkbox' 165 | 166 | # Defines if the default input wrapper class should be included in radio 167 | # collection wrappers. 168 | # config.include_default_input_wrapper_class = true 169 | 170 | # Defines which i18n scope will be used in Simple Form. 171 | # config.i18n_scope = 'simple_form' 172 | 173 | # Defines validation classes to the input_field. By default it's nil. 174 | # config.input_field_valid_class = 'is-valid' 175 | # config.input_field_error_class = 'is-invalid' 176 | end 177 | -------------------------------------------------------------------------------- /app/views/chat_requests/index.html.erb: -------------------------------------------------------------------------------- 1 | 2 |
3 | 14 |
15 |
16 |
    17 | <% @chat_requests_hash[:confirmed].each do |request| %> 18 | <% if current_user == request.receiver %> 19 |
  • <%= request.asker.nickname %> 20 | 21 | <% if request.asker.image.nil? %> 22 | <%= image_tag "userphoto_square.jpg", :class => "img-request" %> 23 | <% else %> 24 | <%= image_tag request.asker.image, :class => "img-request" %> 25 | <% end %> 26 | 27 |
    28 |
    29 | 32 |
    33 |
    34 |
    35 |
  • 36 | <% else %> 37 |
  • 38 |
    <%= request.receiver.nickname %> 39 | 40 | <% if request.receiver.image.nil? %> 41 | <%= image_tag "userphoto_square.jpg", :class => "img-request" %> 42 | <% else %> 43 | <%= image_tag request.receiver.image, :class => "img-request" %> 44 | <% end %> 45 | 46 |
    47 |
    48 | 51 |
    52 |
    53 |
    54 |
  • 55 | <% end %> 56 | <% end %> 57 |
58 |
59 |
60 |
    61 | <% @chat_requests_hash[:rejected].each do |request| %> 62 | <% if current_user == request.receiver %> 63 |
  • 64 |

    <%= request.asker.nickname %>

    65 | 66 | <% if request.asker.image.nil? %> 67 | <%= image_tag "userphoto_square.jpg",:class => "img-request" %> 68 | <% else %> 69 | <%= image_tag request.asker.image,:class => "img-request" %> 70 | <% end %> 71 | 72 |
    73 |
    74 | 77 |
    78 |
    79 |
    80 |
  • 81 | <% else %> 82 |
  • 83 |
    <%= request.receiver.nickname %> 84 | 85 | <% if request.receiver.image.nil? %> 86 | <%= image_tag "userphoto_square.jpg",:class => "img-request" %> 87 | <% else %> 88 | <%= image_tag request.receiver.image,:class => "img-request" %> 89 | <% end %> 90 | 91 |
    92 |
    93 | 96 |
    97 |
    98 |
    99 |
  • 100 | <% end %> 101 | <% end %> 102 |
103 |
104 |
105 |
    106 | <% @chat_requests_hash[:pending].each do |request| %> 107 | <% if current_user == request.asker %> 108 |
  • 109 |

    <%= request.receiver.nickname %>

    110 | 111 | <% if request.receiver.image.nil? %> 112 | <%= image_tag "userphoto_square.jpg", :class => "img-request" %> 113 | <% else %> 114 | <%= image_tag request.receiver.image, :class => "img-request" %> 115 | <% end %> 116 | 117 | <%= render partial: "chat_request", locals: { chat_request: request} %> 118 |
    119 |
    120 | 123 |
    124 |
    125 |
    126 |
  • 127 | <% else %> 128 |
  • 129 |

    <%= request.asker.nickname%>

    130 | 131 | <% if request.asker.image.nil? %> 132 | <%= image_tag "userphoto_square.jpg", :class => "img-request" %> 133 | <% else %> 134 | <%= image_tag request.asker.image, :class => "img-request" %> 135 | <% end %> 136 | 137 | <%= render partial: "chat_request", locals: { chat_request: request} %> 138 |
    139 |
    140 | 143 |
    144 |
    145 |
    146 |
  • 147 | <% end %> 148 | <% end %> 149 |
150 |
151 |
152 |
153 | --------------------------------------------------------------------------------