marsbased / pathfinder-rails Goto Github PK
View Code? Open in Web Editor NEWRails Template for MarsBased projects
License: MIT License
Rails Template for MarsBased projects
License: MIT License
Seems like our blog posts don't have sufficient information for Pocket to load the images.
Dunno what else to write, it's 3.19am ffs
Run the whole installation with default values.
After creating the rails project, generators like rails generate devise:install
should work.
Generators launch this error:
config/environments/development.rb:59:in 'block in <top (required)>': uninitialized constant ActiveSupport::EventedFileUpdateChecker (NameError)
Maybe because something related to Rails 5: http://stackoverflow.com/questions/37978091/uninitialized-constant-activesupporteventedfileupdatechecker-in-env-config-fil
Rails version: 5.0
Ruby version: 2.3.1
We are always using the feature/modularize branch. We need to fix this to use the master branch.
path = if File.exists? @rails_template
File.dirname(@rails_template)
else
@tmp_dir = Dir.mktmpdir
run "git clone -b 'feature/modularize' [email protected]:MarsBased/pathfinder.git #{@tmp_dir}"
@tmp_dir
end
This line produces a Rubocop error:
Rubocop error: Performance/Redundant Merge.
It is solved by using: config.exception_level_filters['ActionController::RoutingError'] = 'ignore'
instead.
Review this model and think about how we should start working with it. After that, we should modify the variable config.mailer in the devise config file.
Rubocop files can be referenced from a URL. The MarsBased rubocop file found in https://github.com/MarsBased/marstyle needs to be referenced in the pathfinder generator.
We are currently planning to open emails in the development environment using Mailcatcher. However, I find that Letter Opener Web has some advantages over Mailcatcher.
See gem documentation for more info: https://github.com/fgrehm/letter_opener_web
Don't confuse with letter_opener, that we discarded in the past because it opened a new browser tab every time an email was sent.
The advantages that I see to change are:
WDYT?
The template needs to ask you if you are using MarsMan in the project in order to configure simple_form properly.
Some of the code is depending on sidekiq. I'm leaving the code required to implement this.
Routes
resource :status, only: :show
Controller
class StatusesController < ApplicationController
def show
check_database
check_sidekiq_redis
head :ok
end
private
def check_database
ActiveRecord::Migrator.current_version
end
def check_sidekiq_redis
Sidekiq.redis(&:info)
end
end
It allows you to see the BG jobs errors inside sidekiq.
We need to search another name for init_file, as it's doing other things other than creating initializers.
@oriolbcn suggests #cook
There are several helpers methods like ask_with_default
that can be extracted into a separate file to be reused by other configuration files.
There is no contributing guide for MarsBased public repositories. We need to create one and then apply it to different projects.
We need to add some gems instructions/info when asking for them to share repo url, explain what they do, prevent issues (like double compression: middleware gzip + nginx zip)...
Add Waffle integration and add Waffle badge to project.
Instead of executing: rails new new_app -m http://blabla.github.com/pathfinder/template.rb
it would be nice to have an url like http://pathfinder.marsbased.com pointing to the github template file
For high-traffic sites we configure a CDN to serve static assets. The CDN is configured to point an Amazon S3 bucket instead of accessing directly to the application compiled assets.
AssetSync is our tool of choice to upload assets to Amazon S3 when deploying new versions of our software.
We need to make it compatible with the Pathfinder Cloud66 configuration: #6
Read Changelog and decide what features do we want to support. For example, new system tests.
There are some questions with default values and some of them without. We must always offer a default value based in our experience building projects.
Marsman can't be integrated as a gem, so we need to manually include all the scss files to the project manually.
Currently Rails template is not working for Rails 5.x projects.
We don't need to support both Rails 5 & Rails 4 in our generator. I suggest changing it to support Rails 5 only.
During one of our development projects we made changes to the rails_template.rb file but they weren't moved to the repository.
Update the current Rails template with those changes.
It stills add the PostgreSQL gem.
https://github.com/jmhobbs/terminal-parrot
π π π π π
I think we should create a test codebase to check that every recipe works. This is a nice to have when we update rails gems, or perform a refactor in the code.
I suggest:
rspec
doesn't fail, or /admin returns a 200 response for active_admin)What do you think?
We need to add the option to integrate the app with MarsBased CircleCI
Currently we have an empty README file. We need to improve it to add relevant information to the project.
Write a README file covering the following topics:
At MarsBased we usually work with Cloud66. However, there are some configurations that need to be performed when deploying to Cloud66 with the Pathfinder tech stack.
This is a list of common features that we require:
We need to add them as an option to the Pathfinder.
The default configuration needs to be added for the production environment.
The config needs to be optional
Sometimes Rails fails with a CSRF Exception. If the request is not AJAX we show an ugly error. If the request is AJAX it is even worse. The application fails silently.
These errors sometimes happen (without a malicious behaviour) when the browser is using a cached page to send a form.
To prevent this, we need to implement a workaround for these 2 situations. For the Ajax one, I recommend doing this:
Inside ApplicationController
rescue_from ActionController::InvalidAuthenticityToken, with: :recover_from_csrf_ajax_error
def recover_from_csrf_ajax_error
fail ActionController::InvalidAuthenticityToken unless request.xhr?
render :refresh_window
end
and inside application/refresh_window.js
location.reload();
For the other one, maybe we want to render a flash.
We need to discuss this further.
There are some projects with low traffic that can run in a standalone server or clients that prefer to have the application in their own infrastructure.
For some of this projects we are using Docker to manage the installation.
###Β Task description
Include in the PathFinder the required configuration files (Dockerfile, docker-compose) to be able to deploy the project to an standalone Docker server.
https://schneems.com/2017/11/08/80-smaller-rails-footprint-with-rack-deflate/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.