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
This project is licensed under the GNU Affero General Public License 3 (GNU AGPL 3) - see the LICENSE.md file for details.
Make sure Ruby 2 and Bundler are installed. Also PostgreSQL
should be accessible with the user smalljobs
without password.
Get the source by cloning the repo:
$ git clone [email protected]:ratte/smalljobs.git
$ cd smalljobs
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 local unicorn server
$ RAILS_ENV=development bundle exec unicorn -p 3000 -c config/unicorn.rb
and open the site or the admin interface.
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
If you want start fast with docker
- install docker
- install docker-compose
$ git clone [email protected]:smalljobs/smalljobs.git
$ cd smalljobs/docker/docker_smalljobs
You must edit docker-compose.yml and then
$ docker-compose build
$ docker-compose up -d
And everything will be built
$ docker-compose stop
$ docker-compose start
$ docker exec -it smalljob_docker_web_1 /bin/bash --login -c "stty rows 60 && stty cols 250 && bash --login"
$ foreman start
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:
$ mailcatcher
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.
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.
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.