Giter Club home page Giter Club logo

pkg's Introduction

CoreStore: A standard library for e-commerce | WIP (Work in Progress)

based on an optimized Magento 2 database structure.

Build Status wercker status Appveyor Build status GoDoc Join the chat at https://gitter.im/corestoreio/pkg goreportcard

Magento is a trademark of MAGENTO, INC..

Min. Go Version: 1.11

Usage

To properly use the CoreStore packages, some environment variables must be set before running go generate. (TODO)

Required settings

CS_DSN the environment variable for the MySQL connection.

$ export CS_DSN='username:pa55w0rd@tcp(localhost:3306)/databaseName?parseTime=true&loc=UTC&collation=utf8mb4_unicode_ci'
$ go get github.com/corestoreio/pkg
$ export CS_DSN='see previous'
$ cd $GOPATH/src/github.com/corestoreio/pkg
$ xgo run xcodegen/tableToStruct/*.go

Testing

Setup database for Magento 2 and fill them with the provided testdata.

Create a DSN env var CS_DSN and point it to Magento 2 database. Run the tests.

TODO

If you find an entry in the source like TODO(CS) that means you can ask CS to get more information about how to implement and what to fix if the context of the todo description isn't understandable.

  • Create Magento 2 modules to setup test database and test Magento system.

Details

  • single repo. CoreStore is a single repo. That means things can be changed and rearranged globally atomically with ease and confidence.

  • no backwards compatibility. CoreStore makes no backwards compatibility promises. If you want to use CoreStore, vendor it. And next time you update your vendor tree, update to the latest API if things in CoreStore changed. The plan is to eventually provide tools to make this easier.

  • forward progress because we have no backwards compatibility, it's always okay to change things to make things better. That also means the bar for contributions is lower. We don't have to get the API 100% correct in the first commit.

  • no Go version policy CoreStore packages are usually built and tested with the latest Go stable version. However, CoreStore has no overarching version policy; each package can declare its own set of supported Go versions.

  • code review contributions must be code-reviewed.

  • CLA compliant contributors must agree to the CLA.

  • docs, tests, portability all code should be documented in the normal Go style, have tests, and be portable to different operating systems and architectures. We'll try to get builders in place to help run the tests on different OS/arches. For now we have Travis at least.

Contributing

Please have a look at the contribution guidelines That document is an idea.

Acknowledgements

Some packages have been fully refactored but the initial idea has been extracted from the geniuses listed below:

Name Package License
Steve Francia util/conv MIT Copyright (c) 2014
Martin Angers and Contributors. ctxthrottled The MIT License (MIT) 2014
Dave Cheney util/errors The MIT License (MIT) 2015
Jad Dittmar finance aka. money Copyright (c) 2011
Google Inc youtube/vitess\sqlparser Copyright 2012 BSD Style
Olivier Poitrey ctxmw.WithAccessLog & CORS Copyright (c) 2014-2015 MIT License
Dave Grijalva csjwt Copyright (c) 2012 MIT License
Uber Technologies, Inc. log Copyright (c) 2016 MIT License
2013 The Go Authors singleflight Copyright (c) 2013 BSD Style
Carl Jackson ([email protected]) (Goji) net/responseproxy Copyright (c) 2014, 2015, 2016
Greg Roseberry, 2014; Patrick O'Brien, 2016 util/null BSD Copyright (c) 2014, 2015, 2016
The Go-MySQL-Driver Authors storage/null/time_mysql.go Mozilla Public License, v. 2.0, Copyright 2012
siddontang storage/binlogsync MIT Copyright (c) 2014
siddontang storage/myreplicator MIT Copyright (c) 2014
Tace De Wolf util/byteconv MIT Copyright (c) 2015
Copyright 2013 The Camlistore Authors util/byteconv Apache 2.0
Copyright 2013 Google Inc. storage/lru Apache 2.0
Alex Saskevich util/validation MIT Copyright (c) 2014
Mat Ryer and Tyler Bunnell util/assert or github.com/stretchr/testify Copyright (c) 2012 - 2013
Google Youtube storage/lru Apache License, Version 2.0
Iman Tumorang util/pseudo Copyright (c) 2017 Iman Tumorang
Dmitry Afanasyev util/pseudo Copyright (c) 2014 Dmitry Afanasyev
Michal Witkowski net/csgrpc/auth Copyright (c) 2016 Michal Witkowski, Apache 2
go-pg/pg Authors sql/urlvalues Copyright (c) 2013 MIT

Licensing

CoreStore is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Copyright

Cyrill Schumacher - PGP Key

pkg's People

Contributors

bom-d-van avatar gitter-badger avatar msjulias avatar schumacherfm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pkg's Issues

Docker-compose / Docker

Hi guys,

Hope you are all well !

Do U have any dockerfile or docker-compose template to create a dev environement for your script ?

Would be good in order to use a MongoDB datastore or Elasticsearch for faceted search.

Cheers,
Luc Michalski

question

does this rely on magento ?

I ask because i dont want to use this with magento, but rather with my own acconting software for myself.

Cannot Generate

Hey There!

I'm attempting to setup your framework, see what it's capable of, and then looking into building an AngularJS administration panel/frontend for this framework. I'm a frontend (js, css, html) & PHP developer with a tiny bit of golang experience, so I fear I may be useless on the golang side for awhile. That being said, I'd love to use a project like this for many of my clients and would like to contribute in any way I can.

However, I can't even get it to generate yet. :D My error says:

root@go:/home/go/src/github.com/corestoreio/csfw# go generate ./...
can't load package: package github.com/corestoreio/csfw/tools/csMake: cannot find package "github.com/corestoreio/csfw/tools/csMake" in any of:
        /root/.gvm/gos/go1.4.2/src/github.com/corestoreio/csfw/tools/csMake (from $GOROOT)
        /home/go/src/github.com/corestoreio/csfw/tools/csMake (from $GOPATH)
csfw.go:1: running "go": exit status 1

It appears to be unable to find github.com/corestoreio/csfw/tools/csMake- which I can't find either. Has this been removed? Am I missing something?

Thanks!

How usage?

I do as you said in README , but it does't work.

  1. codegen dir not exists
  2. I copy _codegen as codegen , then run "go run codegen/tableToStruct/*.go" in command line, encounter error:
    codegen/tableToStruct/helper.go:24:2: cannot find package "github.com/corestoreio/csfw/util/magento"

REST Routes

Script to pull out all REST routes from Magento2:

foreach (glob("app/code/Magento/*/etc/webapi.xml") as $webapixml) {
     $module = preg_replace('(app/code/Magento/(.*)/etc/webapi.xml)', '$1', $webapixml);
     print "==== $module ====\n\n";
     $xml = simplexml_load_file($webapixml);
     foreach ($xml as $key => $value) {
        $attr = $value->attributes();
        $method = (string) $attr["method"];
        $url = (string) $attr["url"];
        $line = "    ".(str_pad($method, 6))." ".$url;
        print "$line\n";
    }
    print "\n";
}

Source: Alan Kent

==== Backend ====

    GET    /V1/modules

==== Bundle ====

    POST   /V1/bundle-products/:sku/links/:optionId
    PUT    /V1/bundle-products/:sku/links/:id
    GET    /V1/bundle-products/:productSku/children
    DELETE /V1/bundle-products/:sku/options/:optionId/children/:childSku
    GET    /V1/bundle-products/:sku/options/all
    GET    /V1/bundle-products/options/types
    GET    /V1/bundle-products/:sku/options/:optionId
    POST   /V1/bundle-products/options/add
    PUT    /V1/bundle-products/options/:optionId
    DELETE /V1/bundle-products/:sku/options/:optionId

==== Catalog ====

    POST   /V1/products
    PUT    /V1/products/:sku
    DELETE /V1/products/:sku
    GET    /V1/products
    GET    /V1/products/:sku
    GET    /V1/products/attributes/types
    GET    /V1/products/attributes/:attributeCode
    GET    /V1/products/attributes
    GET    /V1/categories/attributes/:attributeCode
    GET    /V1/categories/attributes
    GET    /V1/categories/attributes/:attributeCode/options
    POST   /V1/products/attributes
    PUT    /V1/products/attributes/:attributeCode
    DELETE /V1/products/attributes/:attributeCode
    GET    /V1/products/types
    GET    /V1/products/attribute-sets/sets/list
    GET    /V1/products/attribute-sets/:attributeSetId
    DELETE /V1/products/attribute-sets/:attributeSetId
    POST   /V1/products/attribute-sets
    PUT    /V1/products/attribute-sets/:attributeSetId
    GET    /V1/products/attribute-sets/:attributeSetId/attributes
    POST   /V1/products/attribute-sets/attributes
    DELETE /V1/products/attribute-sets/:attributeSetId/attributes/:attributeCode
    GET    /V1/products/attribute-sets/groups/list
    POST   /V1/products/attribute-sets/groups
    PUT    /V1/products/attribute-sets/:attributeSetId/groups
    DELETE /V1/products/attribute-sets/groups/:groupId
    GET    /V1/products/attributes/:attributeCode/options
    POST   /V1/products/attributes/:attributeCode/options
    DELETE /V1/products/attributes/:attributeCode/options/:optionId
    GET    /V1/products/media/types/:attributeSetName
    GET    /V1/products/:sku/media/:imageId
    POST   /V1/products/:sku/media
    PUT    /V1/products/:sku/media/:entryId
    DELETE /V1/products/:sku/media/:entryId
    GET    /V1/products/:sku/media
    GET    /V1/products/:sku/group-prices/
    POST   /V1/products/:sku/group-prices/:customerGroupId/price/:price
    DELETE /V1/products/:sku/group-prices/:customerGroupId/
    GET    /V1/products/:sku/group-prices/:customerGroupId/tiers
    POST   /V1/products/:sku/group-prices/:customerGroupId/tiers/:qty/price/:price
    DELETE /V1/products/:sku/group-prices/:customerGroupId/tiers/:qty
    DELETE /V1/categories/:categoryId
    GET    /V1/categories/:categoryId
    POST   /V1/categories
    GET    /V1/categories
    PUT    /V1/categories/:id
    PUT    /V1/categories/:categoryId/move
    GET    /V1/products/options/types
    GET    /V1/products/:sku/options
    GET    /V1/products/:sku/options/:optionId
    POST   /V1/products/options
    PUT    /V1/products/options/:optionId
    DELETE /V1/products/:sku/options/:optionId
    GET    /V1/products/links/types
    GET    /V1/products/links/:type/attributes
    GET    /V1/products/:sku/links/:type
    POST   /V1/products/:sku/links/:type
    DELETE /V1/products/:sku/links/:type/:linkedProductSku
    PUT    /V1/products/:sku/links/:link_type
    GET    /V1/categories/:categoryId/products
    POST   /V1/categories/:categoryId/products
    PUT    /V1/categories/:categoryId/products
    DELETE /V1/categories/:categoryId/products/:sku

==== CatalogInventory ====

    GET    /V1/stockItems/:productSku
    PUT    /V1/stockItems/:productSku
    GET    /V1/stockItems/lowStock/
    GET    /V1/stockStatuses/:productSku

==== CheckoutAgreements ====

    GET    /V1/carts/licence

==== ConfigurableProduct ====

    GET    /V1/configurable-products/:sku/children
    DELETE /V1/configurable-products/:sku/children/:childSku
    PUT    /V1/configurable-products/variation
    POST   /V1/configurable-products/:sku/child
    GET    /V1/configurable-products/:sku/options/:id
    GET    /V1/configurable-products/:sku/options/all
    POST   /V1/configurable-products/:sku/options
    PUT    /V1/configurable-products/:sku/options/:id
    DELETE /V1/configurable-products/:sku/options/:id

==== Customer ====

    GET    /V1/customerGroups/:id
    GET    /V1/customerGroups/default/:storeId
    GET    /V1/customerGroups/default
    GET    /V1/customerGroups/:id/permissions
    GET    /V1/customerGroups/search
    POST   /V1/customerGroups
    PUT    /V1/customerGroups/:id
    DELETE /V1/customerGroups/:id
    GET    /V1/attributeMetadata/customer/attribute/:attributeCode
    GET    /V1/attributeMetadata/customer/form/:formCode
    GET    /V1/attributeMetadata/customer
    GET    /V1/attributeMetadata/customer/custom
    GET    /V1/attributeMetadata/customerAddress/attribute/:attributeCode
    GET    /V1/attributeMetadata/customerAddress/form/:formCode
    GET    /V1/attributeMetadata/customerAddress
    GET    /V1/attributeMetadata/customerAddress/custom
    GET    /V1/customers/:customerId
    POST   /V1/customers
    PUT    /V1/customers/:id
    PUT    /V1/customers/me
    GET    /V1/customers/me
    PUT    /V1/customers/me/activate
    GET    /V1/customers/search
    PUT    /V1/customers/:email/activate
    PUT    /V1/customers/me/password
    GET    /V1/customers/:customerId/password/resetLinkToken/:resetPasswordLinkToken
    PUT    /V1/customers/password
    GET    /V1/customers/:customerId/confirm
    POST   /V1/customers/confirm
    PUT    /V1/customers/validate
    GET    /V1/customers/:customerId/permissions/readonly
    DELETE /V1/customers/:customerId
    POST   /V1/customers/isEmailAvailable
    GET    /V1/customers/addresses/:addressId
    GET    /V1/customers/me/billingAddress
    GET    /V1/customers/:customerId/billingAddress
    GET    /V1/customers/me/shippingAddress
    GET    /V1/customers/:customerId/shippingAddress
    DELETE /V1/addresses/:addressId

==== Downloadable ====

    GET    /V1/products/:sku/downloadable-links
    GET    /V1/products/:sku/downloadable-links/samples
    POST   /V1/products/:sku/downloadable-links
    PUT    /V1/products/:sku/downloadable-links/:id
    DELETE /V1/products/downloadable-links/:id
    POST   /V1/products/:sku/downloadable-links/samples
    PUT    /V1/products/:sku/downloadable-links/samples/:id
    DELETE /V1/products/downloadable-links/samples/:id

==== Eav ====

    GET    /V1/eav/attribute-sets/list
    GET    /V1/eav/attribute-sets/:attributeSetId
    DELETE /V1/eav/attribute-sets/:attributeSetId
    POST   /V1/eav/attribute-sets
    PUT    /V1/eav/attribute-sets/:attributeSetId

==== GiftMessage ====

    GET    /V1/carts/:cartId/gift-message
    GET    /V1/carts/:cartId/gift-message/:itemId
    POST   /V1/carts/:cartId/gift-message
    POST   /V1/carts/:cartId/gift-message/:itemId

==== Integration ====

    POST   /V1/integration/admin/token
    POST   /V1/integration/customer/token

==== Quote ====

    GET    /V1/carts/:cartId
    GET    /V1/carts
    POST   /V1/carts/
    POST   /V1/customers/:customerId/carts
    PUT    /V1/carts/:cartId
    POST   /V1/carts/mine
    GET    /V1/carts/mine
    PUT    /V1/carts/mine/order
    GET    /V1/guest-carts/:cartId
    POST   /V1/guest-carts
    PUT    /V1/guest-carts/:cartId
    PUT    /V1/guest-carts/:cartId/order
    PUT    /V1/carts/:cartId/selected-shipping-method
    GET    /V1/carts/:cartId/selected-shipping-method
    GET    /V1/carts/:cartId/shipping-methods
    PUT    /V1/carts/mine/selected-shipping-method
    GET    /V1/carts/mine/selected-shipping-method
    GET    /V1/carts/mine/shipping-methods
    PUT    /V1/guest-carts/:cartId/selected-shipping-method
    GET    /V1/guest-carts/:cartId/selected-shipping-method
    GET    /V1/guest-carts/:cartId/shipping-methods
    GET    /V1/carts/:cartId/items
    POST   /V1/carts/items
    PUT    /V1/carts/items/:itemId
    DELETE /V1/carts/:cartId/items/:itemId
    GET    /V1/guest-carts/:cartId/items
    POST   /V1/guest-carts/items
    PUT    /V1/guest-carts/items/:itemId
    DELETE /V1/guest-carts/:cartId/items/:itemId
    GET    /V1/carts/mine/items
    POST   /V1/carts/mine/items
    PUT    /V1/carts/mine/items/:itemId
    DELETE /V1/carts/mine/items/:itemId
    GET    /V1/carts/:cartId/selected-payment-method
    PUT    /V1/carts/:cartId/selected-payment-method
    GET    /V1/carts/:cartId/payment-methods
    GET    /V1/guest-carts/:cartId/selected-payment-method
    PUT    /V1/guest-carts/:cartId/selected-payment-method
    GET    /V1/guest-carts/:cartId/payment-methods
    GET    /V1/carts/mine/selected-payment-method
    PUT    /V1/carts/mine/selected-payment-method
    GET    /V1/carts/mine/payment-methods
    GET    /V1/carts/:cartId/billing-address
    POST   /V1/carts/:cartId/billing-address
    GET    /V1/guest-carts/:cartId/billing-address
    POST   /V1/guest-carts/:cartId/billing-address
    GET    /V1/carts/mine/billing-address
    POST   /V1/carts/mine/billing-address
    GET    /V1/carts/:cartId/coupons
    PUT    /V1/carts/:cartId/coupons/:couponCode
    DELETE /V1/carts/:cartId/coupons
    GET    /V1/guest-carts/:cartId/coupons
    PUT    /V1/guest-carts/:cartId/coupons/:couponCode
    DELETE /V1/guest-carts/:cartId/coupons
    GET    /V1/carts/mine/coupons
    PUT    /V1/carts/mine/coupons/:couponCode
    DELETE /V1/carts/mine/coupons
    GET    /V1/carts/:cartId/shipping-address
    POST   /V1/carts/:cartId/shipping-address
    GET    /V1/guest-carts/:cartId/shipping-address
    POST   /V1/guest-carts/:cartId/shipping-address
    GET    /V1/carts/mine/shipping-address
    POST   /V1/carts/mine/shipping-address
    PUT    /V1/carts/:cartId/order
    GET    /V1/carts/:cartId/totals
    GET    /V1/guest-carts/:cartId/totals
    GET    /V1/carts/mine/totals

==== Sales ====

    GET    /V1/orders/:id
    GET    /V1/orders
    GET    /V1/orders/:id/statuses
    POST   /V1/orders/:id/cancel
    POST   /V1/orders/:id/emails
    POST   /V1/orders/:id/hold
    POST   /V1/orders/:id/unhold
    POST   /V1/orders/:id/comments
    GET    /V1/orders/:id/comments
    PUT    /V1/orders/create
    PUT    /V1/orders/:parent_id
    GET    /V1/invoices/:id
    GET    /V1/invoices
    GET    /V1/invoices/:id/comments
    POST   /V1/invoices/:id/emails
    POST   /V1/invoices/:id/void
    POST   /V1/invoices/:id/capture
    POST   /V1/invoices/comments
    POST   /V1/invoices/
    GET    /V1/creditmemo/:id/comments
    GET    /V1/creditmemos
    GET    /V1/creditmemo/:id
    PUT    /V1/creditmemo/:id
    POST   /V1/creditmemo/:id/emails
    POST   /V1/creditmemo/:id/comments
    POST   /V1/creditmemo
    GET    /V1/shipment/:id
    GET    /V1/shipments
    GET    /V1/shipment/:id/comments
    POST   /V1/shipment/:id/comments
    POST   /V1/shipment/:id/emails
    POST   /V1/shipment/track
    DELETE /V1/shipment/track/:id
    POST   /V1/shipment/
    GET    /V1/shipment/:id/label
    POST   /V1/orders/
    GET    /V1/transactions/:id
    GET    /V1/transactions

==== Tax ====

    POST   /V1/taxRates
    GET    /V1/taxRates/:rateId
    PUT    /V1/taxRates
    DELETE /V1/taxRates/:rateId
    GET    /V1/taxRates/search
    POST   /V1/taxRules
    PUT    /V1/taxRules
    DELETE /V1/taxRules/:ruleId
    GET    /V1/taxRules/:ruleId
    GET    /V1/taxRules/search
    POST   /V1/taxClasses
    GET    /V1/taxClasses/:taxClassId
    PUT    /V1/taxClasses/:classId
    DELETE /V1/taxClasses/:taxClassId
    GET    /V1/taxClasses/search

Database library

Hi, this db repository "github.com/jinzhu/gorm", you can have a look.

Why AGPL?

idea think tank:

https://news.ycombinator.com/item?id=34774152

Yes. AGPL is a great choice and counters SaaS companies that are trying to grift and abuse open-source with a modified competing product without contributing back.

The short answer is "no". The high-level concept of AGPLv3 is to prevent someone who'd like to re-sell the OSS company's features (billing in our case). For instance, let's say you're a vertical SaaS like Mindbody, selling software to yoga studio owners so that they manage their business: scheduling, payment, and billing. If you use Lago to build your own billing feature (and sell it as part of your product), you'd need to either buy a commercial license (we call it "Lago Embedded") from us OR open source your code. Let me know if you need more clarifications!

Roadmap

Is there a roadmap to get a sense of where the project is going?

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.