Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Configurable Events Feature #162

Open
loftwah opened this issue Sep 17, 2024 · 0 comments
Open

Implement Configurable Events Feature #162

loftwah opened this issue Sep 17, 2024 · 0 comments

Comments

@loftwah
Copy link
Owner

loftwah commented Sep 17, 2024

We need to add an events feature to Linkarooie that allows users to create, display, and manage events on their profile. This feature should be highly configurable to cater to various use cases and preferences.

Tasks:

  1. Database and Model Updates:

    • Create an Event model with fields such as:

      • title
      • description
      • start_date
      • end_date
      • location (can be physical or virtual)
      • url (for tickets, more info, etc.)
      • image_url
      • is_featured (boolean)
      • is_visible (boolean)
      • auto_expire (boolean)
      • expiration_date
    • Add association to the User model

  2. API Updates:

    • Create CRUD endpoints for events in the API
    • Implement filtering options (upcoming, past, featured)
  3. User Interface:

    • Design and implement an events section on the user profile page
    • Create forms for adding and editing events
    • Implement a toggle for showing/hiding past events
    • Add an option to feature specific events
  4. Configuration Options:

    • Allow users to set default visibility for past events
    • Implement an auto-expiration feature with configurable timeframe
    • Add option to manually remove/hide specific events
  5. Linking and Integration:

    • Allow events to be linked to other Linkarooie features (e.g., achievements, links)
    • Implement share buttons for easy social media sharing
  6. Search and Discovery:

    • Add events to the site-wide search functionality
    • Create an events discovery page for community-wide events (if applicable)
  7. Notifications:

    • Implement optional reminders for upcoming events (for event creators)
    • Add notification options for users interested in specific event types or creators
  8. Analytics:

    • Track views and interactions with events
    • Provide basic analytics for event creators (views, clicks, etc.)
  9. Mobile Responsiveness:

    • Ensure the events feature is fully responsive on mobile devices
  10. Testing:

    • Write unit tests for the Event model and controller
    • Implement integration tests for the events feature
    • Perform thorough manual testing on various devices and browsers
  11. Documentation:

    • Update user documentation to explain the events feature and its configuration options
    • Create internal documentation for the development team
  12. Performance Optimization:

    • Implement caching for events to reduce database load
    • Optimize queries for fetching and displaying events

Example Event Model:

class Event < ApplicationRecord
  belongs_to :user

  validates :title, presence: true
  validates :start_date, presence: true
  validates :end_date, presence: true
  validate :end_date_after_start_date

  scope :upcoming, -> { where('end_date >= ?', Date.current).order(start_date: :asc) }
  scope :past, -> { where('end_date < ?', Date.current).order(start_date: :desc) }
  scope :featured, -> { where(is_featured: true) }
  scope :visible, -> { where(is_visible: true) }

  def self.auto_expire!
    where(auto_expire: true).where('expiration_date <= ?', Date.current).update_all(is_visible: false)
  end

  private

  def end_date_after_start_date
    return if end_date.blank? || start_date.blank?

    if end_date < start_date
      errors.add(:end_date, "must be after the start date")
    end
  end
end

This feature will enhance user profiles by allowing them to showcase their events, whether they're meetups, webinars, conferences, or any other type of gathering. The configurability ensures it can meet a wide range of user needs.

@loftwah loftwah changed the title Add events feature Implement Configurable Events Feature Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant