MedicTrust

Health Record Application

Project Name:
MedicTrust
Begin at:
21 September, 2017
Seen :
291
Url:
https://medic-trust.com
End At:
21 October, 2018

Build Rest Full API for mobile developer using Ruby on Rails, 
1. Develope API / Web Service
2. Develope and maintanance server 
3. Write API Documentation for Mobile Developer 

Technology
- Ruby 2.1.0
- Rails 4.1.0
- i18n (Multilanguage)
- Capistrano
- Redis
- cronjob (whenever gem)
- Capistrano
- Active Model Serializer

 

Setup in Local

  • Use RVM and Required Ruby 2.1.0 and Rails 4.1.0
  • If you have more version in u'r pc. enter into directory MTI and use
  rvm use 2.1.0
  rvm gemset use <name_your_gemset_rails_version_4.1.0

-Bundle install

  • rake db:setup it will be create database medictrust_development and medictrust_test in mysql
  • Import database dummy
  • Run server rails s

Deployment

MedicTrust use Capistrano for deployment

If u want to deploy please Commit and push all file changed because Capistrano take the source from git server not from local

See capistrano task

cap -T

if success the output will be

cap bundler:install                # Install the current Bundler environment
cap bundler:map_bins               # Maps all binaries to use `bundle exec` by default
cap delayed_job:restart            # Restart the delayed_job process
cap delayed_job:start              # Start the delayed_job process
cap delayed_job:stop               # Stop delayed job process
cap deploy                         # Deploy a new release
cap deploy:check                   # Check required files and directories exist
cap deploy:check:directories       # Check shared and release directories exist
cap deploy:check:linked_dirs       # Check directories to be linked exist in shared
cap deploy:check:linked_files      # Check files to be linked exist in shared
cap deploy:check:make_linked_dirs  # Check directories of files to be linked exist in shared
cap deploy:cleanup                 # Clean up old releases
cap deploy:cleanup_assets          # Cleanup expired assets
cap deploy:cleanup_rollback        # Remove and archive rolled-back release
cap deploy:compile_assets          # Compile assets
cap deploy:finished                # Finished
cap deploy:finishing               # Finish the deployment, clean up server(s)
cap deploy:finishing_rollback      # Finish the rollback, clean up server(s)
cap deploy:log_revision            # Log details of the deploy
cap deploy:migrate                 # Runs rake db:migrate if migrations are set
cap deploy:normalize_assets        # Normalize asset timestamps
cap deploy:published               # Published
cap deploy:publishing              # Publish the release
cap deploy:restart                 # Restart application
cap deploy:revert_release          # Revert to previous release timestamp
cap deploy:reverted                # Reverted
cap deploy:reverting               # Revert server(s) to previous release
cap deploy:rollback                # Rollback to previous release
cap deploy:rollback_assets         # Rollback assets
cap deploy:started                 # Started
cap deploy:starting                # Start a deployment, make sure server(s) ready
cap deploy:symlink:linked_dirs     # Symlink linked directories
cap deploy:symlink:linked_files    # Symlink linked files
cap deploy:symlink:release         # Symlink release to current
cap deploy:symlink:shared          # Symlink files and directories from shared to release
cap deploy:updated                 # Updated
cap deploy:updating                # Update server(s) by setting up a new release
cap install                        # Install Capistrano, cap install STAGES=staging,production
cap puma:config                    # Setup Puma config file
cap puma:halt                      # halt puma
cap puma:phased-restart            # phased-restart puma
cap puma:restart                   # restart puma
cap puma:start                     # Start puma
cap puma:status                    # status puma
cap puma:stop                      # stop puma
cap rails:console                  # Interact with a remote rails console
cap rvm:check                      # Prints the RVM and Ruby version on the target host
cap whenever:clear_crontab         # Clear application's crontab entries using Whenever
cap whenever:update_crontab        # Update application's crontab entries using Whenever

To use the task please specify the environment

Example deployment to staging Environment

cap staging deploy

Example deployment to Production Environment

cap production deploy

cap production deploy will run

  • update source from git server
  • rake db:migrate
  • rake asset:precompile
  • restart delayed_job
  • restart puma / server

Example to run Rails console using capistrano

cap production rails:console

Screenshot