Skip to content

Conversation

@amitsharma-kipuhealth
Copy link

Summary

This Pull Request introduces a comprehensive news aggregation project with enhanced features, such as user authentication, story starring, and real-time updates. This application aggregates top stories from various sources and allows users to view, star, and manage their favorite stories.

Project Overview

TopNews, is a Ruby on Rails-based web application that collects and displays top news stories from various sources. Users can register, log in, view stories, and star their favorite stories for easier access in the future.

Key Features

User Authentication:
Users can sign up, log in, and log out securely.
Devise is used for managing user sessions.

Story Aggregation:
Stories are fetched from different news sources.
Fetching is handled by a background job that runs at a scheduled interval.

Starring Stories:
Users can star stories they find interesting.
Starred stories are highlighted and can be viewed separately.

Real-time Updates:
Stories are updated in real-time using a combination of Redis and Sidekiq.
Instant feedback on starring/unstarring actions.

Application Flow

User Registration and Login:
Users register through a sign-up page.
Devise handles authentication and user sessions.
File: app/views/devise/registrations/new.html.erb, app/controllers/application_controller.rb

Fetching Stories:

The StoryFetcherService fetches stories from various APIs.
Stories are stored in Redis for quick access and real-time updates.
File: app/services/story_fetcher_service.rb, config/initializers/sidekiq.rb

Displaying Stories:

Stories are displayed on the home page.
Starred stories are highlighted.
File: app/views/stories/index.html.erb, app/controllers/stories_controller.rb

Starring and Unstarring Stories:

Users can star stories via a star button.
File: app/controllers/stories_controller.rb, app/models/starred_story.rb, app/assets/javascripts/stories.js

Background Jobs:

Job runs at regular intervals to fetch and update stories.
Sidekiq manages background job processing and scheduling.

Database Schema

Users: stores user information (Devise-managed).
Stories: stores fetched stories.
StarredStories: join table for users and their starred stories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants