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

Setting up the Newsroom Infrastructure #9

Merged
merged 81 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
167fd17
added topics & subtopics
May 2, 2023
7766f2b
adding topic, subtopic and feed relationship
May 2, 2023
82c2bed
added topics and feeds
May 2, 2023
dcde40d
adding the topics defenition
May 2, 2023
01b9b22
adding a blueprint setup
May 2, 2023
1c1631f
Merge pull request #10 from realstorypro/blueprint-import
May 2, 2023
99175f1
updating rubocop
May 2, 2023
d43df43
added ability to injest feeds
May 3, 2023
3cad759
added webmock and feedly lib spec
May 3, 2023
2aafba9
added a job to process all subtopics
May 3, 2023
7f6248e
added a job to process all subtopics
May 3, 2023
695b4e6
Merge pull request #11 from realstorypro/injest-feed
May 3, 2023
a3a90f6
added ability to process feedly items
May 3, 2023
293e3cc
updating the feed item processing logic
May 3, 2023
e3e16e8
updating the feed item processing logic
May 3, 2023
145a813
Merge pull request #12 from realstorypro/proces-feedly
May 3, 2023
d7c978c
adding taggings
May 3, 2023
7061530
adding taggings
May 3, 2023
c025df2
adding tags to the content
May 3, 2023
4840ed3
Merge pull request #13 from realstorypro/clean-and-classify
May 3, 2023
5d57f82
added stories and assignments
May 3, 2023
a4d334a
working on the tag -> story link generation job
May 4, 2023
1b5d08e
refactorign the story job
May 4, 2023
caeebd7
cleaning up
May 4, 2023
d8bea2c
adding factories
May 4, 2023
a43f538
Merge pull request #14 from realstorypro/add-stories
May 4, 2023
e70237d
assemble job complete
May 4, 2023
4c9193c
setup the assembly function
May 4, 2023
c54e88f
Merge pull request #15 from realstorypro/assemble
May 4, 2023
75e3865
added stories
May 4, 2023
1068bea
updated the markdown cleanup logic
May 4, 2023
6bd9016
Merge pull request #16 from realstorypro/story-press
May 4, 2023
f340a93
updatign the look
May 5, 2023
64403e9
generating the store submission stem
May 5, 2023
128bef6
got story stems working
May 5, 2023
258ba64
stylign the stories section
May 5, 2023
2494521
Merge pull request #17 from realstorypro/story-stems
May 5, 2023
4ff98b2
processing stories and updating views
May 6, 2023
76d758b
adding tags
May 6, 2023
0eaf9de
updating styling
May 6, 2023
cbe0bde
recompiling the enterprise
May 6, 2023
efaf395
updated stories display view
May 6, 2023
6ce712e
Merge pull request #18 from realstorypro/process-stories
May 6, 2023
f71830e
adding ability to exclude tags
May 6, 2023
0442ffa
updated count logic and added tag exclusion fine tuning ability
May 6, 2023
107f4d8
Merge pull request #19 from realstorypro/exclude-tags
May 6, 2023
9ef9b06
added ability to generate image ideas
May 6, 2023
a46d52b
added image generation task
May 6, 2023
4f7b4d5
updating image idea generation
May 6, 2023
2fbaa86
added image generation
May 7, 2023
573bcda
Merge pull request #20 from realstorypro/make-images
May 7, 2023
a6a9c69
seting up midjourney integration
May 8, 2023
761fc55
adding the show view
May 9, 2023
6899ac1
setting up the midjourney
May 9, 2023
dde8173
refactoring images
May 9, 2023
eb72eb9
Merge pull request #21 from realstorypro/midjourney
May 9, 2023
edcf7cd
adding a job to process the rest of the image formats
May 9, 2023
7632366
updating image assembly job
May 9, 2023
9591417
adding the ability to list and create entries
May 9, 2023
e2a7cc2
adding the storypro library
May 9, 2023
098072a
adding update actions
May 9, 2023
248218a
adding delete statements
May 9, 2023
567b60f
implemented all methods w/ exception of elements
May 9, 2023
1a39548
disabling unused methods
May 9, 2023
516594c
adding the ability to add elements
May 10, 2023
fff71cf
finished setting up the api library
May 10, 2023
57b2932
adding get tag and categories
May 10, 2023
e91c663
added a library for storypro
May 10, 2023
1ac39e0
Merge pull request #22 from realstorypro/other-image-sizes
May 10, 2023
b7c3b86
addressing some rubocop complaints
May 10, 2023
09a8053
Merge pull request #23 from realstorypro/rubocop
May 10, 2023
b8d0543
built a publisher class with a basic api
May 11, 2023
f21018f
cleaning up the discussion job
May 11, 2023
428ddf4
cleaning up the discussion job
May 11, 2023
609f252
Merge pull request #24 from realstorypro/publisher
May 11, 2023
6a46c5a
setting up the image upload + discussion building
May 11, 2023
123f72b
refactoring the jobs and publisher library
May 11, 2023
7a1cc58
Merge pull request #25 from realstorypro/image-upload
May 11, 2023
44edd4a
cleaning up logic + comments
May 12, 2023
2f47abc
cleaning up
May 12, 2023
6e5222d
Merge pull request #26 from realstorypro/logic-cleanup
May 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ node_modules
.irb_history

/.vite/

.byebug_history
7 changes: 7 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ inherit_from: .rubocop_todo.yml

require: rubocop-rails

Style/Documentation:
Enabled: false

AllCops:
NewCops: disable
Exclude:
Expand All @@ -14,4 +17,8 @@ AllCops:
- 'config/spring.rb'
- 'config/puma.rb'
- '.irbrc'
- 'lib/tasks/themes.rake'
- 'lib/cli/**/*'
- 'app/lib/story_pro.rb'
- 'app/jobs/**/*'

24 changes: 24 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,27 @@ Style/SymbolArray:
# URISchemes: http, https
Layout/LineLength:
Max: 127


Rails/FilePath:
Exclude:
- 'config/initializers/apipie.rb'
-
Metrics/ParameterLists:
Exclude:
- 'app/mailers/admin_mailer.rb'

Rails/OutputSafety:
Exclude:
- 'app/helpers/devise_helper.rb'
- 'app/helpers/application_helper.rb'

Rails/UniqueValidationWithoutIndex:
Exclude:
- 'app/models/assignment.rb'
- 'app/models/story_tag.rb'
- 'app/models/tagging.rb'

Rails/SkipsModelValidations:
Exclude:
- 'lib/tasks/stories.rake'
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@ gem "bootsnap", require: false
gem 'canonical-rails', github: 'jumph4x/canonical-rails'
gem 'config'
gem 'deep_cloneable', '~> 3.2.0'
gem 'uploadcare-rails'
gem 'friendly_id'
gem 'httparty'
gem 'maruku'
gem 'reverse_markdown'
gem 'invisible_captcha'
gem 'jsonb_accessor'
gem "jbuilder"
gem 'rack-canonical-host'
gem 'simple_scheduler'
gem 'sitemap_generator'
gem 'slack-notifier'
gem 'ruby-openai'

# Database
gem 'hiredis'
Expand All @@ -47,6 +50,7 @@ gem "stimulus-rails"
gem 'turbo-rails'
gem 'view_component'
gem 'vite_rails'
gem 'redcarpet'

# Errors
gem 'appsignal'
Expand All @@ -61,6 +65,7 @@ group :development, :test do
gem 'rubocop'
gem 'rubocop-rails'
gem 'tty-prompt'
gem 'webmock'
end

group :development do
Expand All @@ -77,6 +82,7 @@ group :test do
gem 'rspec-rails'
gem 'rspec_tap', require: false
gem 'selenium-webdriver'
gem 'shoulda-matchers', '~> 5.0'
gem 'webdrivers'
end

100 changes: 86 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GIT

GIT
remote: https://github.com/kaminari/kaminari.git
revision: ff07a285215cfb8a5f70515e86decf4a16ff643c
revision: 68fdf60cd6fa6552ac59f26dba3f71ff3c20ba52
branch: master
specs:
kaminari (1.2.2)
Expand Down Expand Up @@ -118,7 +118,7 @@ GEM
apipie-rails (1.0.0)
actionpack (>= 5.0)
activesupport (>= 5.0)
appsignal (3.4.1)
appsignal (3.4.2)
rack
ast (2.4.2)
awesome_print (1.9.2)
Expand All @@ -138,10 +138,12 @@ GEM
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
concurrent-ruby (1.2.2)
config (4.1.0)
config (4.2.0)
deep_merge (~> 1.2, >= 1.2.1)
dry-validation (~> 1.0, >= 1.0.0)
connection_pool (2.4.0)
crack (0.4.5)
rexml
crass (1.0.6)
date (3.3.3)
deep_cloneable (3.2.0)
Expand All @@ -154,6 +156,8 @@ GEM
responders
warden (~> 1.2.3)
diff-lcs (1.5.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.8.1)
dotenv-rails (2.8.1)
dotenv (= 2.8.1)
Expand All @@ -171,6 +175,10 @@ GEM
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-monads (1.6.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-schema (1.13.1)
concurrent-ruby (~> 1.0)
dry-configurable (~> 1.0, >= 1.0.1)
Expand Down Expand Up @@ -199,11 +207,31 @@ GEM
railties (>= 5.0.0)
faker (3.2.0)
i18n (>= 1.8.11, < 2)
faraday (2.7.4)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (3.0.2)
ffi (1.15.5)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
friendly_id (5.5.0)
activerecord (>= 4.0.0)
globalid (1.1.0)
activesupport (>= 5.0)
hashdiff (1.0.1)
hashie (5.0.0)
hiredis (0.6.3)
http (5.1.1)
addressable (~> 2.8)
http-cookie (~> 1.0)
http-form_data (~> 2.2)
llhttp-ffi (~> 0.4.0)
http-cookie (1.0.5)
domain_name (~> 0.5)
http-form_data (2.3.0)
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
Expand All @@ -219,7 +247,10 @@ GEM
activerecord (>= 5.0)
activesupport (>= 5.0)
pg (>= 0.18.1)
loofah (2.20.0)
llhttp-ffi (0.4.0)
ffi-compiler (~> 1.0)
rake (~> 13.0)
loofah (2.21.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.8.1)
Expand All @@ -233,10 +264,14 @@ GEM
meta-tags (2.18.0)
actionpack (>= 3.2.0, < 7.1)
method_source (1.0.0)
mimemagic (0.4.3)
nokogiri (~> 1)
rake
mini_mime (1.1.2)
minitest (5.18.0)
msgpack (1.7.0)
multi_xml (0.6.0)
multipart-post (2.3.0)
net-imap (0.3.4)
date
net-protocol
Expand Down Expand Up @@ -307,6 +342,7 @@ GEM
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
redcarpet (3.6.0)
redis (5.0.6)
redis-client (>= 0.9.0)
redis-client (0.14.1)
Expand All @@ -315,6 +351,9 @@ GEM
responders (3.1.0)
actionpack (>= 5.2)
railties (>= 5.2)
retries (0.0.5)
reverse_markdown (2.1.1)
nokogiri
rexml (3.2.5)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
Expand All @@ -324,14 +363,14 @@ GEM
rspec-mocks (3.12.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-rails (6.0.1)
rspec-rails (6.0.2)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
rspec-core (~> 3.11)
rspec-expectations (~> 3.11)
rspec-mocks (~> 3.11)
rspec-support (~> 3.11)
rspec-core (~> 3.12)
rspec-expectations (~> 3.12)
rspec-mocks (~> 3.12)
rspec-support (~> 3.12)
rspec-support (3.12.0)
rspec_tap (0.2.0)
rubocop (1.50.2)
Expand All @@ -344,23 +383,29 @@ GEM
rubocop-ast (>= 1.28.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.28.0)
rubocop-ast (1.28.1)
parser (>= 3.2.1.0)
rubocop-rails (2.19.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
ruby-openai (4.0.0)
faraday (>= 1)
faraday-multipart (>= 1)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
selenium-webdriver (4.9.0)
selenium-webdriver (4.9.1)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sidekiq (7.0.9)
shoulda-matchers (5.3.0)
activesupport (>= 5.2.0)
sidekiq (7.1.0)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
redis-client (>= 0.11.0)
redis-client (>= 0.14.0)
simple_form (5.2.0)
actionpack (>= 5.2)
activemodel (>= 5.2)
Expand Down Expand Up @@ -406,15 +451,32 @@ GEM
railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.4.2)
uploadcare-api_struct (1.1.0)
dry-configurable (~> 1.0)
dry-inflector (~> 1.0)
dry-monads (~> 1.6)
hashie (~> 5.0)
http (~> 5.1)
uploadcare-rails (3.3.4)
rails (>= 6)
uploadcare-ruby (>= 4.3)
uploadcare-ruby (4.3.3)
mimemagic (~> 0.4)
parallel (~> 1.22)
retries (~> 0.0)
uploadcare-api_struct (>= 1.1, < 2)
view_component (3.0.0)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
vite_rails (3.0.14)
railties (>= 5.1, < 8)
vite_ruby (~> 3.0, >= 3.2.2)
vite_ruby (3.3.1)
vite_ruby (3.3.2)
dry-cli (>= 0.7, < 2)
rack-proxy (~> 0.6, >= 0.6.1)
zeitwerk (~> 2.2)
Expand All @@ -429,6 +491,10 @@ GEM
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
webmock (3.18.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
websocket (1.2.9)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
Expand Down Expand Up @@ -475,12 +541,16 @@ DEPENDENCIES
rails (~> 7.0.4, >= 7.0.4.3)
rails-controller-testing
rapid_ui!
redcarpet
redis
reverse_markdown
rspec-rails
rspec_tap
rubocop
rubocop-rails
ruby-openai
selenium-webdriver
shoulda-matchers (~> 5.0)
sidekiq
simple_form
simple_scheduler
Expand All @@ -491,10 +561,12 @@ DEPENDENCIES
stimulus-rails
tty-prompt
turbo-rails
uploadcare-rails
view_component
vite_rails
web-console
webdrivers
webmock

RUBY VERSION
ruby 3.2.2p53
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 🚀 Enterprise

### ActiveJobs

```ruby
AssembleJob.perform_now
```

#### Mailcatcher
Is the best way to test emails in development. It catches all emails sent by your application and displays them in a web interface. You can also use it to test HTML emails during development.

Expand Down
3 changes: 1 addition & 2 deletions app/controllers/concerns/restricted_access.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ module RestrictedAccess
def check_access
redirect_to unauthorized_index_path unless current_user.has_access?
end

end
end
8 changes: 8 additions & 0 deletions app/controllers/feeds_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class FeedsController < ApplicationController
include RestrictedAccess

def index
@feeds = Feed.all.order(id: :desc).page params[:page]
@total_feeds = Feed.all.count
end
end
2 changes: 1 addition & 1 deletion app/controllers/page_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class PageController < ApplicationController
include RestrictedAccess
def index
@topics = Topic.all.order(:name)
end

end
Loading