Code Monkey home page Code Monkey logo

nectarcommerce's Introduction

Nectar E-Commerce Build Status

Nectar is an open source e-commerce Elixir/Phoenix project to be evolved into E-Commerce framework the elixir way Please share your ideas here

It includes:

Admin

  • Product Management

    • Manage OptionTypes/OptionValues
    • Manage Categories
    • Product with / without variants
    • Search
  • Configuration Management

    • General Settings
    • Shipping Methods
    • Payment Methods
      • Stripe and Braintree supported
  • Cart Management

    • Add / Remove Variant
    • Add Shipping / Billing Address
    • Choose Shipping Method
    • Choose Payment Method
  • Order Management

    • Cancel LineItem
    • Fulfill Order
    • Create New Order
    • Search
  • User Management

    • Create Users
    • Promote / Demote as Admin

User

  • User Registration / Login
  • Product Browsing
    • List and Search
    • on available categories
  • Cart Management
  • Check Order Details

Demo

Docker Image

https://hub.docker.com/r/vinsol/nectarcommerce

  • Simply run docker run -it -p 4000:4000 vinsol/nectarcommerce:latest and go to http://localhost:4000

Getting Started

  • Pre-requisites

  • Clone Project Locally

    • git clone https://github.com/vinsol/nectarcommerce.git
  • Set up Development Environment

    • Copy apps/nectar/config/dev.secret.exs.example as dev.secret.exs
      • cp apps/nectar/config/dev.secret.exs.example apps/nectar/config/dev.secret.exs
    • Configure Postgres Database
    • Configure Arc for images upload
    • Configure Payment Methods
    • Get Application Dependencies
      • mix deps.get
    • Set-up Application Database
      • Drop Database
        • mix ecto.drop -r Nectar.Repo
      • Create Database
        • mix ecto.create -r Nectar.Repo
      • Migrate Database
        • mix ecto.migrate -r Nectar.Repo
      • Seed Database
        • mix run apps/nectar/priv/repo/seeds.exs
    • Build Assets
      • cd apps/nectar
      • npm install
      • npm install babel-preset-es2015 --save
      • ./node_modules/brunch/bin/brunch build
      • Optionally might need bower install
    • Run Phoenix Server with IEx
      • iex -S mix phoenix.server
  • Browse User Interface

  • Browse Admin Interface

Contributing

  1. Fork the repo.
  2. Clone your repo.
  3. Check Getting Started
  4. Make your changes.
  5. Ensure tests pass by running mix test.
  6. Submit your pull request.

Running Tests

We use Travis CI to run the tests for Nectar.

You can see the build statuses at https://travis-ci.org/vinsol/nectarcommerce.

RoadMap

  • Evolve into a Phoenix E-commerce Framework
    • Better and More Shipping Methods Customization
    • Better and More Payment Methods Customization
    • Customize Tax Rate Calculations
    • Customize Package Management
      • Add Order Splitters
  • RealTime Updates using Channels
  • Upgrade to ecto-2
  • Customisable and decoupled Frontend and Backend
    • React Frontend
    • Phoenix Api Backend
  • Improved Stock Management
  • Returns / Refunds Management
  • Payments
    • Add support for capture and refunds
  • Marketing
    • Promotions
    • Email Campaigns
  • More features as per contributions and use :)

Credits

vinsol.com: Ruby on Rails, iOS and Android developers

Copyright (c) 2016 vinsol.com, released under the New MIT License

nectarcommerce's People

Contributors

bansalakhil avatar pikender 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  avatar  avatar  avatar  avatar  avatar  avatar

nectarcommerce's Issues

Extension Approach 1 and 2, only allow to add to schema.

Right now in extension approach 1 and 2 we can only add to existing schema via

add_to_schema do
  # schema declarations to add go here
end

and then we use it like this in models.

schema "source" do
  original fields & relations
  extensions
end

While this is simple, it does not allow us to remove/modify existing relations.

What we can try and do is use something like this in models:

extended_schema "source" do
  original fields & relations
end

and then provide two methods:

add_to_schema do
end

remove_from_schema do
end

using this we can rewrite the schema call.

see initial implementation here and diff

This could allow us to add/remove fields to schema, however we want to be sure before implementing this whether we want to include this feature as it may cause things to break if used with abandon, i.e. compile time pattern matching fails or essential fields used throughout the system being removed.

heroku deployment issue

i have referenced this tutorial for heroku deployment Deploying Elixir with Heroku
but it gave me this error.any idea how to fix this?

remote: -----> Creating .profile.d with env vars
remote: -----> Writing export for multi-buildpack support
remote: -----> Phoenix app detected
remote: 
remote: -----> Loading configuration and environment
remote:        Loading config...
remote:        Detecting assets directory
remote:        WARNING: no package.json detected in root nor custom directory
remote:        * assuming phoenix 1.3.x and later, please check config file
remote:        Will use phoenix configuration:
remote:        * assets path assets
remote:        * mix tasks namespace phx
remote:        Will use the following versions:
remote:        * Node 5.3.0
remote:        Will export the following config vars:
remote: APP_URL
remote: DATABASE_URL
remote: POOL_SIZE
remote: SECRET_KEY_BASE
remote:        * MIX_ENV=prod
remote: 
remote: -----> Installing binaries
remote:        Downloading node 5.3.0...
remote:        Installing Node 5.3.0...
remote:        Using default npm version
remote: 
remote: -----> Building dependencies
remote:        Installing and caching node modules
remote: /app/tmp/buildpacks/abc8fb9e8be131ec2574c4ba9e31b81540d97b3bbce47d96e05959c4f81404ac71605dd35ebbcf7a1abe958c346d8ee266ff035de9254424eb54e8b9480059be/lib/build.sh: line 105: cd: /tmp/build_f26475149c0a158cb477053757c3ab1b/./assets: No such file or directory
remote:  !     Push rejected, failed to compile Phoenix app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...

Anything Happening Here?

Is anyone working on this or using it still? Look's like you've been working on Spree instead.

Nothing new yet ?

Hi I'm from spree/solidus world.
And as an E-commerce, we need more power...

So, what about this project?
Will have a support team or something?

Seed Database Error

Seed Database
mix run apps/nectar/priv/repo/seeds.exs

When I run above command. There are errors happened as following:
....

INSERT INTO "products" ("available_on","description","name","slug","inserted_at"
,"updated_at") VALUES ($1,$2,$3,$4,$5,$6) RETURNING "id" [{2017, 2, 9}, "Sample
Product for testing with 3 variants(One Master + 3 Other)", "Sample Product 2",
"sample-product-2", {{2017, 2, 9}, {1, 15, 30, 0}}, {{2017, 2, 9}, {1, 15, 30, 0
}}]
[debug] QUERY OK db=16.0ms
INSERT INTO "product_option_types" ("option_type_id","product_id","inserted_at",
"updated_at") VALUES ($1,$2,$3,$4) RETURNING "id" [1, 1, {{2017, 2, 9}, {1, 15,
30, 0}}, {{2017, 2, 9}, {1, 15, 30, 0}}]
[debug] QUERY OK db=0.0ms
INSERT INTO "variants" ("bought_quantity","cost_price","is_master","product_id",
"total_quantity","inserted_at","updated_at") VALUES ($1,$2,$3,$4,$5,$6,$7) RETUR
NING "id" [0, #Decimal<10.0>, true, 1, 10, {{2017, 2, 9}, {1, 15, 31, 0}}, {{201
7, 2, 9}, {1, 15, 31, 0}}]
[debug] QUERY OK db=0.0ms
commit []
** (KeyError) key :available_on not found in: %{cost_price: 20.0, discontinue_on
: #Ecto.Date<2017-03-01>, sku: "Variant 1", variant_option_values: [%{option_typ
e_id: 1, option_value_id: 1}]}
(nectar) web/models/variant.ex:178: Nectar.Variant.validate_discontinue_gt_a
vailable_on/2
(nectar) web/models/variant.ex:92: Nectar.Variant.create_variant_changeset/3

(nectar) lib/seed/load_products.ex:58: Seed.LoadProducts.seed_products_with_

variant/0
(elixir) lib/code.ex:370: Code.require_file/2
(mix) lib/mix/tasks/run.ex:82: Mix.Tasks.Run.run/1
(mix) lib/mix/task.ex:294: Mix.Task.run_task/3
(mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2
(elixir) lib/code.ex:370: Code.require_file/2

system crash when checkout multiple products

The error messages is as following.

look like MapSet has duplicate keys.

Parameters: %{}
15:36:14.367 [info] Replied cart:1 :ok
15:36:17.178 request_id=prhal3stab9270g36cpl80v9ibjl97o4 [info] POST /checkout/next
15:36:17.187 request_id=prhal3stab9270g36cpl80v9ibjl97o4 [info] Sent 500 in 0็น•s
15:36:17.188 [error] #PID<0.636.0> running Nectar.Endpoint terminated
Server: localhost:443 (https)
Request: POST /checkout/next
** (exit) an exception was raised:
** (ArgumentError) error when merging the following Ecto.Multi structs:

%Ecto.Multi{names: #MapSet<[:variant_acquire_stock]>, operations: [variant_acquire_stock: {:changeset, #Ecto.Changeset<action: :update, changes: %{bought_quantity: 1, buy_count: 1}, errors: [], data: #Nectar.Variant<>, valid?: true>, []}]}

%Ecto.Multi{names: #MapSet<[:variant_acquire_stock]>, operations: [variant_acquire_stock: {:changeset, #Ecto.Changeset<action: :update, changes: %{bought_quantity: 1, buy_count: 1}, errors: [], data: #Nectar.Variant<>, valid?: true>, []}]}

both declared operations: [:variant_acquire_stock]

    (ecto) lib/ecto/multi.ex:171: Ecto.Multi.do_merge/3
    (elixir) lib/enum.ex:1755: Enum."-reduce/3-lists^foldl/2-0-"/3
    (nectar) web/workflows/checkout/payment.ex:39: Nectar.Workflow.Checkout.Payment.post_transition/3
    (ecto) lib/ecto/multi.ex:386: Ecto.Multi.apply_operation/5
    (elixir) lib/enum.ex:1755: Enum."-reduce/3-lists^foldl/2-0-"/3
    (ecto) lib/ecto/multi.ex:376: anonymous fn/5 in Ecto.Multi.apply_operations/5
    (ecto) lib/ecto/adapters/sql.ex:508: anonymous fn/3 in Ecto.Adapters.SQL.do_transaction/3
    (db_connection) lib/db_connection.ex:1275: DBConnection.transaction_run/4

Make the Zones be Country or State based.

Hey maintainers,

I am searching for an Elixir framework to help me move a few shops from Ruby+Spree to Elixir+NectarFramework (or any other Elixir framework which qualifies, really).

One thing I couldn't help but notice in your demo is that your Zones are only Country-based. I believe you should add State (sub-zones) objects and then make them embeddable inside Countries and Zones alike. The Zones should then have a boolean switch -- probably called "based_on_countries" which, when off, means that the Zone can be comprised of States only, and when it's on, it would mean that the Zone can only be comprised of Countries.

I am not saying you should emulate Spree per se, by the way. I am just saying that this particular feature was pretty useful for me when I had to divide USA into several zones and have separate payment and shipping methods for these zones.

Worldly Hex Package ETA?

Hey!

I was just wondering when you will be releasing the Worldly package on Hex? Even if its just v0.0.1

Cheers
Sam

Could not compile dependency :combine

Hello I am following the documentation but I am getting:

could not compile dependency :jose, "mix compile" failed. You can recompile this dependency with "mix deps.compile jose", update it with "mix deps.update jose" or clean it with "mix deps.clean jose"
** (Mix) Encountered compilation errors

Quest for customizable e-commerce - the elixir way

  • E-Commerce Phoenix Project
  • Built with an intent to be served as a off-the-shelf and easily customizable e-commerce solution
  • We are looking for ideas and suggestions on how to mature the project as e-commerce framework which can be included as a library and customized as per business needs
  • Please share

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.