It’s not super long but comes with a lot of ‘underground’ information about engines. If you’re about to write a modular application, then you should definitely read it.
The goal is to teach you how to build your own modules and at the end of the road, create complete modular applications.
Modular applications offer a different way to work on your application. Since you're focusing on building small reusable components instead of one big application, adding or removing features become easier.
By having a set of components, we could have multiple applications sharing some features but also having their own specificities.
You can try it at https://railssamuraicrm.herokuapp.com/
Account login on Backend
user :
username: [email protected] | password: 123456
- Ruby on Rails
We are going to build the web application using:
- Rails 6.0.3.3
- Ruby 2.7.1
1. Login, Logout, register
2. User manager
3. Create contact for user
4. Contact manager
5. Task manager
$ git clone https://github.com/TanHongIT/SamuraiCRM
$ cd SamuraiCRM
$ bundle install
$ yarn install
You must change the appropriate database configuration
Change configuration at "config/database.yml" with Postgresql.
default: &default
adapter: postgresql
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
username: rails6_samurai_crm
password: 1974
host: localhost
# tutorial for ubuntu linux:
# sudo -u postgres psql
# create user "rails6_samurai_crm" with password '1974';
# create database "rails6_samurai_crm" owner "rails6_samurai_crm";
development:
<<: *default
database: rails6_samurai_crm
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: rails6_samurai_crm_test
production:
<<: *default
database: rails6_samurai_crm_production
You must change the username, password and database name accordingly!
$ rails db:migrate
After running the above command, if you get an error: "LoadError: cannot load such file -- autoprefixer-rails", try running the install command below in the console screen:
$ gem install autoprefixer-rails
Then run the "rails db:migrate" command again.
$ rails s
Now, go to http://localhost:3000/
http://localhost:3000/users/sign_up and create a new user account.
Open new terminal and run:
$ rails c
Paste this command line and run
Samurai::User.first.update_column :admin, true
Now go to http://localhost:3000/admin and login your account.
See also: Samurai version using rails 5.1.7 in combination with ruby 2.6.3: SamuraiCRM_ruby2_6_3_rails5_1_7