This project is an platform where users can host an event and invite guests simliar to Eventbrite
This project has User
and Event
models, and an Invitation
table which serves as a through table to associate what User
is invited to what Event
This is the simple representation of the Association between the User
, Event
, and Invitation
models
class User < ApplicationRecord
has_many :events, foreign_key: 'creator_id', class_name: 'Event'
has_many :invitations
has_many :invites, through: :invitations, source: :event
end
class Event < ApplicationRecord
belongs_to :creator, class_name: 'User'
has_many :invitations, dependent: :destroy
has_many :attendees, through: :invitations, source: :attendee
end
class Invitation < ApplicationRecord
belongs_to :event
belongs_to :attendee, foreign_key: :user_id, class_name: 'User'
end
Checkout the live demo at Live
- Rails
- Bootstrap 5
- HTML
- CSS (SCSS)
- Database (SQLite3) for development
To run the project in your local machine follow this step by step instruction:
- Open your terminal and run
git clone git@github.com:cyonii/private-events.git
- Once the repo is cloned, navigate into it's directory with
cd private-events
- Run
bundle install
to install dependencies - Run
yarn install
- Run
rails db:migrate
- You can run
rails db:seed
to populate the database with fake data - After your run the previous operations, run
rails server
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
Give a ⭐️ if you like this project!
👤 CY Kalu
- GitHub: @cyonii
- Twitter: @theOnuoha
- LinkedIn: Silas Kalu