Coder Social home page Coder Social logo

minicommerce's Introduction

Minicommerce

A working example of a Grape API mounted alongside Rails app that uses Trailblazer with Service Object Pattern / DDD.

Stacks

  • Rails
  • Grape
  • Trailblazer

Dependencies

  • PostgreSQL
  • Elasticsearch

Pattern

Model

Using default model directory app/models from Rails. Handle primitive database only.

Repository

In directory app/concepts/*/repository. Handle any persistent transaction.

Contract

In directory app/concepts/*/contract. Handle any use case validation.

Entity

In directory app/concepts/*/entity. Handle response to endpoint.

Operation

In directory app/concepts/*/operation. Handle use case / business process.

Policy

In directory app/concepts/*/policy. Handle user permission to use case.

Endpoint

In directory app/controllers/API. Handle endpoint API.

Playing Around

  1. Clone the repository
  2. bundle install
  3. rake db:create
  4. rake db:migrate
  5. rake db:seed
  6. rails s
  7. Check swagger doc on http://localhost:3000/doc
  8. Go to Auth and then click Explore button
  9. Generate token
  10. Use the token to play around in main API

Test

  • rake db:test:prepare
  • rspec

The Boring Legal Things

Copyright

Use whatever you wish if this repository inspire you

minicommerce's People

Contributors

yunanhelmy avatar

Stargazers

 avatar Uysim avatar

Watchers

James Cloos avatar  avatar  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.