This is the repo for the development of the Small.Jobs exchange smalljobs.ch. Small.Jobs is a project to increase intergenerational Contacts with exchanging "small jobs" from adults to kids.
- Michael Kessler - Initial Prototype (R.I.P)
- Verein SmallJobs - Final development of smalljobs
- Version 0.X - Live since Autumn 2017
Clone the repo
Get the source by cloning the repo:
$ git clone email@example.com:ratte/smalljobs.git $ cd smalljobs
Prepare the database
Get the database ready and populate with needed data:
$ rake db:setup
Alternatively you can sync the production database to your local database:
$ heroku pg:pull DATABASE_URL smalljobs_development
Start the server
Start the local unicorn server
$ RAILS_ENV=development bundle exec unicorn -p 3000 -c config/unicorn.rb
Update to latest version
You can update your local project with:
$ cd smalljobs $ git pull origin master $ rake db:migrate
If you want to test the Application in a proper environment, use Vagrant/Virtualbox for testing:
$ vagrant up $ ssh vagrant $ cd /vagrant
Handling of vagrant-Box
Local SMPT Server
If you want to preview the app emails, you need to install MailCatcher with:
$ gem install mailcatcher
and then start the local SMTP server before starting the Rails app server with:
Now you can browser the sent email by opening http://localhost:1080 in your browser.
SmallJobs is tested extensively, so make sure you do not break the specs before pushing to master.
$ rake spec
You may want to enable continous testing by running Guard:
$ bundle exec guard
This application uses several third-party services. All access keys and passwords are stored as a environmental variables. These services are:
- S3 storage on Amazon AWS - used to store some images by Rich and Carrierwave gems. You can read about configuring it here: https://github.com/kreativgebiet/rich#uploading-to-s3 and here: https://github.com/carrierwaveuploader/carrierwave#using-amazon-s3
- Sendgrid - as smtp server. You should provide SENDGRID_USERNAME and SENDGRID_PASSWORD.
- Devise - used for authentication. Secret key and pepper are stored as DEVISE_SECRET and DEVISE_PEPPER
- Scout - for monitoring. Scout APM key is stored as SCOUT_KEY.
Creating new administrator
In order to be able to create new administrator you must be administrator yourself. If this is your first run of the application, then I suggest disabling checking for administrator role for admin panel. To do so just comment out
config.authorize_with do redirect_to main_app.root_path unless current_admin != nil end
in the config/initializers/rails_admin.rb file.
Go to the admin panel (/admin). In the 'Administratoren' page create new administrator. Provide new email and password and save the changes. Now when user logs in using that data he will be signed in as an administrator.
Creating new region
First you need to setup new domain. To do this on Heroku:
- Go to the Heroku dashboard
- Open your app (be sure to get the one running on production)
- Go to the settings page
- Under the 'Domains and certificates' section click 'Add domain' button
- Enter domain name and save changes
- Make sure that domain is checked as 'Ok' (if not check domain name or your ssl certificate)
Before you can use new domain, you must prepare database data. The simplest way to do this is to use admin panel on existing domain. Go to the admin panel (for example https://winterthur.smalljobs.ch/admin) and follow these steps:
- Create new Region using domain name chosen before and populate it with some places.
- Create new Organisation using one of places in created previously Region. You don't need to select brokers right now (but you can). Mark organization as active.
- Create new Broker (or, if you are using existing one, skip this step). Select Organization created in previous step.
- Create new Employment for Region, Organisation and Broker created in previous steps.
- You should now be able to access new domain.
- Optionally you can add more Organisations, Brokers and Employments to your new Region. Remember to always select places belonging tou your new Region.
- R.I.P Michael Kessler (2015), a wonderful Character and amazing monster of a programmer who implemented the Prototype in an amazing Quality.
- Verein SocialBox (Mich Wyser) - for starting the project as an Open-Source Alternative
- Prix Génération / AXA Winterthur for financing the Startup of SmallJobs
- Tatenträger (http://tatentraeger.ch) - for finishing the development, integrating it into the Jugendapp and sending it into reality with Damian Kurpiewski, Hubert Burdach, Łukasz Bojarski and Rafael Freuler.
- Joinapps (http://joinapps.ch) – for their faith in the project and financial support for the final stretch of development before the public release.