Giter Site home page Giter Site logo

derose's Introduction

Derose API

this is a API for create a ride and pay it, it's necesary have install the next dependencies:

  • ruby 3.0
  • postgres 12
  • cmake

Set up project

After you have been installed the dependencies you need install gems with:

bundle install 

If you don´t install bundler you can run

gem install bundler 

Now you need generate config files with next command

make copy-config 

Then you must be config the files are in config/ folder:

  • database.yml: Settings for connection to postgres, in this file you must add the access for your database
  • credentials.yml: Settings for credentials for services, in this file you must add de wompi credentials configuration, url (with version api url/api/v1), private_key, and public_key

Finally you must run the next command for create database, run migrations and run seeds in the console

rake set_up 

Run project

rackup

For test api it's necesary use a bearer token for riders and drivers, for this tokens works you don´t change secret key in file config/credentials.yml

token-rider fort test:

  • eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MX0.Os30IZvCoXp-1wgbXAWf-mEgJYfpo4BZVJiaITwADCs
  • eyJhbGciOiJIUzI1NiJ9.eyJpZCI6Mn0.0TbkmTNgs99IlBRt1do6OINE0k3WnA8QvHVo_b_9fKc
  • eyJhbGciOiJIUzI1NiJ9.eyJpZCI6M30.RaFxhtN8JXcopxCkQjVws4BdmPlDYWCzkCSYs3483zM

token-driver for test:

  • eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MX0.Os30IZvCoXp-1wgbXAWf-mEgJYfpo4BZVJiaITwADCs
  • eyJhbGciOiJIUzI1NiJ9.eyJpZCI6Mn0.0TbkmTNgs99IlBRt1do6OINE0k3WnA8QvHVo_b_9fKc
  • eyJhbGciOiJIUzI1NiJ9.eyJpZCI6M30.RaFxhtN8JXcopxCkQjVws4BdmPlDYWCzkCSYs3483zM

image

Run test

rake test

Utils commands

Create database

rake db:create

Drop database

rake db:drop

Apply migrations

rake db:migrate

Rollback last migration

rake db:rollback

Seed the database

rake db:seed

Generate schema file

rake db:schema

Reset the database

rake db:reset

derose's People

Contributors

juanfer2 avatar

Stargazers

Roman avatar

Watchers

 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.