Code Monkey home page Code Monkey logo

oblyk-api's Introduction

Oblyk API | Climbing Community API

Oblyk is an open-source community website dedicated to climbing. It aims to build a large open-data database of cliffs, routes and climbing gyms in France and around the world that can be freely consulted via an API. Climbers can also use this tool to rate their crosses or find climbing partners.

This repository is the API part of Oblyk project.
For front app, go here : oblyk-app

Dependencies

  • ruby 2.6.5
  • bundle >= 2.0.0
  • docker >= 20.10
    • docker-compose >= 1.25

Installation

# Clone project
git clone [email protected]:oblyk/oblyk-api.git

# Go to project folder
cd oblyk-api

# Install gem
bundle

# Copy example local_env.yml 
cp config/local_env.example.yml config/local_env.yml

# Up docker
docker-compose up -d

# Create oblyk_development database
bundle exec rails db:setup

Launch Oblyk rails server

bundle exec rails s

Go to localhost:3000
Enjoy !

Create your organization for set yours API private key

First open rails console

bundle exec rails c

End create your organization

my_organization = Organization.new name: 'My Awesome Organization', email: '[email protected]', api_usage_type: 'personal'
my_organization.save
my_organization.api_access_token
# => vvPpFZhg....
# You can use this token in HttpApiAccessToken header

Run sidekiq

Sidekiq si job system, start it to unstack the background tasks

bundle exec sidekiq

Go to localhost:3000 to see the monitor.
Sidekiq user and password is configured in config/local_env.yml

Helpers

Recreate the search base

bundle exec rake search_tasks:import["Crag"]
bundle exec rake search_tasks:import["CragRoute"]
bundle exec rake search_tasks:import["GuideBookPaper"]
bundle exec rake search_tasks:import["Area"]
bundle exec rake search_tasks:import["Gym"]
bundle exec rake search_tasks:import["Word"]
bundle exec rake search_tasks:import["User"]

Recreate feeds

(sidekiq must be started)

bundle exec rake create_feeds:for_model["Alert"]
bundle exec rake create_feeds:for_model["Gym"]
bundle exec rake create_feeds:for_model["GuideBookPaper"]
bundle exec rake create_feeds:for_model["GuideBookPdf"]
bundle exec rake create_feeds:for_model["GuideBookWeb"]
bundle exec rake create_feeds:for_model["Word"]
bundle exec rake create_feeds:for_model["Video"]
bundle exec rake create_feeds:for_model["Photo"]
bundle exec rake create_feeds:for_model["AscentCragRoute"]
bundle exec rake create_feeds:for_model["Article"]
bundle exec rake create_feeds:for_model["Crag"]
bundle exec rake create_feeds:for_model["CragRoute"]

Generate API documentation

RAILS_ENV=test rails db:migrate # if necessary
bundle exec rake docs:generate

Go to http://localhost:3000/documentation

oblyk-api's People

Contributors

lucien-chastan avatar glthm avatar pectum83 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.