Coder Social home page Coder Social logo

Comarev-API

rspec workflow rubocop workflow

All Contributors

This application is a partner management system. Basically, the Comarev admins register the interested companies that want to give a discount on their products/services to the Comarev contributors who are also registered in the system. Then, when the contributor buys something at the company (Comarev partner), they just have to scan a QR Code emitted in our dashboard and the system will return if they are ok with the payment (contribution), or not. If so, the contributor can get a discount.

Please check the WHO_WE_ARE section for more information.

Welcome Contributors!

Please feel free to contribute! While we welcome all contributions to this app, pull-requests that address outstanding Issues and have appropriate test coverage for them will be strongly prioritized.

Please check the Contributing section for more information.

Roadmap

Check our board for more details about what we're building.

  • Comarev API MVP

The core of this system is ready and running on production. But there are lot of improvements we can do and we need your help!

Development

Getting started

Clone the project from Github:

git clone [email protected]:comarev/comarev.git && cd comarev

Install dependencies:

bundle install

Create a .env file by copying the existing one:

cp .env.example .env

Go to the .env file and set this:

PG_HOST=<your_database_host>
PG_USERNAME=<your_database_username>
PG_PASSWORD=<your_database_password>

Prepare database.yml:

cp config/database.example.yml config/database.yml

Create the database:

bundle exec rails db:create

Run migrations:

bundle exec rails db:migrate

Run database seeds:

  # to populate with some users

  bundle exec rails db:seed

Run the server:

bundle exec rails s

Run tests:

bundle exec rspec

After running the server, you can also preview the emails at http://localhost:3000/rails/mailers.

Setup with docker

You will need to install docker-compose

Prepare database.yml & .env

cp config/database.example.yml config/database.yml && cp .env.example .env

Build the app image

docker-compose build

Database setup:

docker-compose run --rm api rails db:setup

Start the containers:

docker-compose up

Them you should have the comarev-api running on localhost:3000

There will be this users to login:

admin: [email protected] regular: [email protected]

with password: 123456, for both

To stop the containers run:

docker-compose down

Usage

For information concerning API usage and endpoints examples, please check the Usage section.

Application Concepts

Users

A user can be an admin, manager, emplyoee or a customer.

  • Admins are the Comarev employees and can constrol the entire system. They are able to create the other kind of users. To become an admin, the user need the admin attibute true.
  • Managers are the company managers. They can emmit their QR Code and also check if a user is able to get discount. To become a manager, the user needs to be assigned to a company.
  • Employees do the same as managers, but they can't invite other employees or manage the company config.
  • Customers are the Comarev contributors. They are supposed to pay invoices and get discounts. If the user is neither an admin nor a manager, he's a customer.

Companies

A company is a comarev partner. They offer discounts to the Comarev contributors.

Invoices

A invoice is created for a user. When all invoices are paid, the user is able to get a discount. Invoices can only be created and mark as paid by an admin user, but customers can visualize them.

Found this project interesting?

If you found this project useful, then please consider leaving a ⭐ on Github, thanks :D

Contributors ✨


Mauricio Lima

πŸ’» πŸ“–

Gabriel Belgamo

πŸ’» πŸ“–

Bruno Viveiros

πŸ’»

RenanRambul

πŸ’»

Thiago Antonello Vargas

πŸ’»

ivopozzani

πŸ’»

AntΓ΄nio Paulino

πŸ’»

Rafael Perches Pierri

πŸ’»

Mathew Thomas

πŸ’»

Rhian

πŸ’»

Wender Freese

πŸ‘€

Rodrigo Vitiello

πŸ‘€

AndrΓ© Moreira

πŸ’»

Guilherme Monteiro

πŸ’»

Edigleysson Silva

πŸ‘€

Heitor de Melo

πŸ’»

AntΓ΄nio Simei

πŸ’»

Eric Poloni Araujo

πŸ’» πŸ‘€

Ronaldo de Sousa Araujo

πŸ‘€

This project follows the all-contributors specification. Contributions of any kind welcome!

comarev's Projects

comarev icon comarev

Rails API of an open source project to help Comarev, a charity organization.

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.