You need Postgresql and Redis running on your computer. You also need ImageMagick
After cloning the project, run:
bundle install
bin/rails db:create db:schema:load
Then ask for the ENV variables below before starting your bin/rails s
server.
The app configuration lies in config/application.yml
and is not
versionned by git (for security reasons). If you've just cloned this
repo, ask a colleague for his application.yml
file over a secure channel.
The bare minimum variables you need to start the website are:
# config/application.yml
ALUMNI_WWW_SHARED_SECRET: "ask_for_it"
ALUMNI_WWW_ENCRYPTING_KEY: "ask_for_it"
CLOUDINARY_URL: "ask_for_it"
To create a new blog post file, you run this command:
rails post:create
You can run this in development to bypass the API cache.
$ DISABLE_CACHE=true rails s
You can work with development API by launching a rails s -p 5000
of lewagon/alumni in another terminal tab, then launch the www
rails app with:
ALUMNI_BASE_URL=http://localhost:5000/api/v1 DISABLE_CACHE=true rails s
The token lasts 2 months. To generate it, launch a rails c
locally then:
oauth = LinkedIn::OAuth2.new; puts oauth.auth_code_url # Go to this URL
code = "WHAT YOU GOT FROM THE URL"
l_token = oauth.get_access_token(code); puts l_token.token
puts "will expire on #{Date.strptime(l_token.expires_at.to_s, '%s')}. You may want to add this date to the calendar"