Code Monkey home page Code Monkey logo

ecommerce's Introduction

๐Ÿ‘œ A simple RESTful API for Purchases and Products

License: GPL v3 Github All Releases GitHub release Build Status Codecov Docker Pulls Docker Pulls

Deploy

Features

Products Features

Feature Coded? Description
Add a Product โœ” Ability of Add a Product on the System
List Products โœ” Ability of List Products
Edit a Product โœ” Ability of Edit a Product
Delete a Product โœ” Ability of Delete a Product
Stock โœ” Ability of Update the Stock
Stock History โœ” Ability to see the Stock History

Purchase Features

Feature Coded? Description
Create a Cart โœ” Ability of Create a new Cart
See Cart โœ” Ability to see the Cart and it items
Remove a Cart โœ” Ability of Remove a Cart
Add Item โœ” Ability of add a new Item on the Cart
Remove a Item โœ” Ability of Remove a Item from the Cart
Checkout โœ” Ability to Checkout

eCommerce

eCommerce it's an open source (test scenario) software made to create a easy and simple "Shop" API, where you have two micro services, one the Products API that stores and handles everything Related to Stock and Products. And the Purchase API where you can create orders (cart's) and checkout items.

The purpose of this repository it's for education and test. But the code it's being coded in a proper way.

Documentation

eCommerce has a full API documentation made with Swagger, you can check it by accessing this link.

If you have any Issue or bug you can submit a new Issue by accessing this link.

If you want to Contribute you can submit a Pull Request, remember to READ the Contributing Guide

Installation

  • eCommerce it's splitted into two standalone RESTful API's, so you can run it on whatever port you want. Installing
  • eCommerce it's easy, the tutorial above will explain to you.
  • eCommerce uses Groovy 2.4 and Grails 3.2.11.

You can run eCommerce in different ways. You can go to the Releases Page and download the source code of the latest release, or a bundled .war or a standalone java application (.jar).

It's recommend see the notes on this section.

Development

You can attach the .war in WebServers like Tomcat using the Management Interface.

If you want run the standalone .jar just download it, and open your CMD/Terminal and write:

If you want RUN the Products API

java -jar ecommerce-products-api-XXX.jar OR ./products-api/grailsw run-app

If you want RUN the Purchases API

java -jar ecommerce-purchase-api-XXX.jar OR ./purchase-api/grailsw run-app

You also can build from the sources by running the Grails Console, just went to one of the API's folder purchase-api or products-api and write on your CMD/Terminal the following:

grailsw assemble

If you want to run it in development scenario, you can also do it by building the sources. You have two manner to do it. You can Gradle or directly Grails. Both products-api and purchase-api comes with Groovy, Grails and Gradle standalone packages. So you can run it without the need of installing they.

Option #1 - Run by Gradle

gradlew bootRun

Option #2 - Run by Grailsw

grailsw run-app

Production

Production Environments are focused in being ready. That means, you just need execute the Jar File.

In the Production Environment all eCommerce API's are configured to work with MySQL in two databases; productsAPI and purchaseAPI and to work with a default username and password combination:

Note.: Remember importing each SQL files, if using MySQL for Production. You can find them inside products-api/src/main/sql/ and purchase-api/src/main/sql/

  • Username: commerce
  • Password: commerceapi
  • Database: productsapi & purchaseapi
  • Port: 3306

You can change those credentials in the application.yaml file. In production environments you need import the database schema before running the software. Both products-api and purchase-api DDL files are available on this folder.

Notes

Note.: By default products-api runs on port 8080 and purchase-api on port 8090.

Note.: In all Development and Test Scenarios, eCommerce uses H2 in-memory Database.

Note.: You can change your database credentials both for development/test and production scenarios in the app-config.yml available on each API sources root. Those configuration files can be used also externally, after building the .jar

Note.: You also can clean the sources and rebuild the sources by running grailsw clean

Running Test Cases

You can easily run the Test Cases using the standalone Grails package built-in with both the API's. Just went to the home folder of one of them (products-api or purchase-api). And write on your CMD/Terminal:

grailsw test-app

Credits

This development/educational scenario was coded and created by Claudio Santoro unde the GNU GPL v3 License. The objective of this repository it's as practical test of RESTful API's with Java + Groovy.

ecommerce's People

Contributors

ovflowd avatar

Watchers

Owen Rubel 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.