GithubHelp home page GithubHelp logo

yongfook / zipsell Goto Github PK

View Code? Open in Web Editor NEW
561.0 22.0 106.0 213 KB

A free open source platform for selling digital downloads such as ebooks

Home Page: https://www.zipsell.org

License: MIT License

Ruby 65.61% JavaScript 1.45% CSS 5.32% HTML 26.51% CoffeeScript 1.12%
ecommerce-platform downloads digital-products digital-assets ebook-downloader ebook-manager ebooks

zipsell's Introduction

Zipsell intro

Zipsell

Zipsell helps you set up an online store for selling digital products such as ebooks, music, videos, source code etc.

Zipsell handles payment processing via stripe and sends customers secure expiring Amazon S3 links to the files they have purchased. Since it is self-hosted, you receive payments directly and avoid paying commissions to 3rd party marketplaces.

Zipsell is built with Ruby on Rails.

Demo site - http://demo.zipsell.org

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Zipsell is a Ruby on Rails app. These instructions assume you have run a rails app on your local machine before.

Installing

Clone the project into a local folder and run the included setup file:

git clone https://github.com/yongfook/zipsell
cd zipsell
./bin/setup

Configuration

During local setup above, a git-ignored config file is generated at config/application.yml.

Populate this with your local and production config for Amazon AWS, Stripe etc. You can have environment-specific values for local, test and production. ENV config is handled by the Figaro gem.

The config template looks like this:

#general - all required
shop_name: My Shop
shop_domain: localhost:3000
shop_email_support: [email protected]
shop_email_noreply: [email protected]

#email - all required, for email delivery in production
SMTP_host: 
SMTP_port: 
SMTP_username: 
SMTP_password: 

#payments - all required, for processing payments
stripe_api_key: 
stripe_publishable_key: 

#file storage - all required, for storing files securely
AWS_REGION: 
AWS_BUCKET: 
AWS_ACCESS_KEY_ID: 
AWS_SECRET_ACCESS_KEY: 

#file management - all required
file_expiry_hours: "24"
file_max_downloads: "10"

#cdn host - optional, for faster static asset serving in production
cdn_host_assets: 
cdn_host_s3_bucket: 

#analytics - optional, in the format UA-XXXXXXXX-XX
google_analytics_id:

#
# production:
#   stripe_api_key: 
#   stripe_publishable_key: 

These should be self explanatory except for the optional cdn host section.

cdn_host_assets: This is the optional Rails asset pipeline cdn host. Use this if you want to serve css / js faster. Include the protocol you want to use e.g. https://myapp.cdn.com

cdn_host_s3_bucket: This is the optional Amazon Cloudfront cdn host for your S3 bucket. Use this if you want to serve uploaded image files faster. Do not include the protocol, use only the hostname e.g. randomname.cloudfront.net

Running locally

Start your rails server:

rails s

Your shopfront is at:

http://0.0.0.0:3000

Your admin dashboard is at:

http://0.0.0.0:3000/admin

Deployment on Heroku

To deploy to heroku for the first time:

heroku create
git push heroku master
heroku run rails db:migrate
figaro heroku:set -e production

The last line updates the remote heroku server with the ENV config in config/application.yml.

You will need to run this command again if you change your production config.

Contributing

In general, we follow the "fork-and-pull" Git workflow.

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

Built With

  • Amazon S3 is used as the file store. All downloadable files have non-public access rights and download links are securely signed with a configurable expiry time.
  • Bulma is used as the css framework.
  • Figaro is used to set production configuration without commiting files or storing sensitive information in databases.
  • Heroku is used as the production environment in my readme, although you are free to deploy it anywhere else.
  • Paperclip is used for file attachments. I purposely removed Active Storage from the app as it is currently not suitable for serving files via CDN. Zipsell needs flexibility - image previews can be served from a CDN while private, downloadable files are served directly from the S3 bucket.
  • Ruby on Rails is used as the web application framework.
  • Stripe is used as the payment processor. You use your own Stripe account with Zipsell and all payments go directly to you.

License

This project is licensed under the MIT License - see the LICENSE file for details

zipsell's People

Contributors

aikedejongste avatar danielpk avatar jaryl avatar nickgs avatar yongfook 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

zipsell's Issues

Suggestion / request - use Dependabot to keep dependencies up-to-date

First of all, thanks for Zipsell!

I've got a suggestion / request: would you be up for using Dependabot to automatically create dependency update PRs for this repo? I ran it against my fork and it generated these PRs. I'll port the capybara one across to this repo now.

I built Dependabot, but I'm honestly only suggesting it because I hope it can save you some time. I'd love any feedback, and obviously having open source repos like Zipsell using it helps boost its profile, but if it's not helpful to you then it's not really worth anything.

You can install it from here or here if you decide to give it a try. It's been through GitHub's security testing (to be allowed in the GitHub Marketplace) and is used by a few thousand organisations, and the source code is here.

:octocat:

paypal support?

Zipsell is great. Unfortunately Stripe is not yet supported in some countries including mine.

Is there a paypal support coming?

After Heroku Deployment Products will not save.

Had some issues with figaro, and installed ENV on heroku as dynamo. Which seamed to work out. However when I try to make a new product and save it, the product never saves.

Any thoughts on how to determine ifs an amazon setting or heroku build issue.

Heroku console:

2019-02-14T04:43:35.780528+00:00 app[web.1]: I, [2019-02-14T04:43:35.780434 #4] INFO -- : [a592eb97-02c9-4a4d-beac-38649f5a5385] [paperclip] Trying to link /tmp/54dc05cdc8a2babf246b99ae4630012020190214-4-11n0bwn.pdf to /tmp/79e9f490298a1de6558b3d11573c2cc820190214-4-1813ie8.pdf 2019-02-14T04:43:35.780966+00:00 app[web.1]: I, [2019-02-14T04:43:35.780868 #4] INFO -- : [a592eb97-02c9-4a4d-beac-38649f5a5385] Command :: file -b --mime '/tmp/79e9f490298a1de6558b3d11573c2cc820190214-4-1813ie8.pdf' 2019-02-14T04:43:35.783246+00:00 app[web.1]: I, [2019-02-14T04:43:35.783151 #4] INFO -- : [a592eb97-02c9-4a4d-beac-38649f5a5385] [paperclip] Content Type Spoof: Filename OOAK_Object_Test_Page.pdf (inode/x-empty from Headers, ["application/pdf"] from Extension), content type discovered from file command: inode/x-empty. See documentation to allow this combination. 2019-02-14T04:43:35.788564+00:00 app[web.1]: D, [2019-02-14T04:43:35.788462 #4] DEBUG -- : [a592eb97-02c9-4a4d-beac-38649f5a5385] �[1m�[35m (1.2ms)�[0m �[1m�[31mROLLBACK�[0m 2019-02-14T04:43:35.789083+00:00 app[web.1]: I, [2019-02-14T04:43:35.788986 #4] INFO -- : [a592eb97-02c9-4a4d-beac-38649f5a5385] Completed 422 Unprocessable Entity in 37ms (ActiveRecord: 5.1ms) 2019-02-14T04:43:35.790057+00:00 app[web.1]: F, [2019-02-14T04:43:35.789962 #4] FATAL -- : [a592eb97-02c9-4a4d-beac-38649f5a5385] 2019-02-14T04:43:35.790156+00:00 app[web.1]: F, [2019-02-14T04:43:35.790067 #4] FATAL -- : [a592eb97-02c9-4a4d-beac-38649f5a5385] ActiveRecord::RecordInvalid (Validation failed: Image has contents that are not what they are reported to be, Image is invalid, File has contents that are not what they are reported to be, Image content type is invalid): 2019-02-14T04:43:35.790248+00:00 app[web.1]: F, [2019-02-14T04:43:35.790163 #4] FATAL -- : [a592eb97-02c9-4a4d-beac-38649f5a5385] 2019-02-14T04:43:35.790369+00:00 app[web.1]: F, [2019-02-14T04:43:35.790265 #4] FATAL -- : [a592eb97-02c9-4a4d-beac-38649f5a5385] app/controllers/products_controller.rb:32:inblock in create'
2019-02-14T04:43:35.790371+00:00 app[web.1]: [a592eb97-02c9-4a4d-beac-38649f5a5385] app/controllers/products_controller.rb:31:in create'

Some issues in Windows 10

OS and Ruby details:
Windows 10 64 bit, version 1803
Ruby version: 2.4.1; Rails version: 5.2.2

Issue No 1: == Command ["bin/rails db:setup"] failed ==

After running the command "ruby bin/setup" everything goes fine except it fails to execute "rails db:setup".

image

Issue no 2: ActiveRecord::RecordInvalid (Validation failed: Image Paperclip::Errors::NotIdentifiedByImageMagickError):

image

After creating a product, it is not saving that. When I click on the "Save" button nothing happens. There is this error on the console.

~PS Here I am a Ruby beginner so I can't figure out how to fix this. before running it on Windows, I failed in using this on Ubuntu 16.10 as well (there were errors in compiling process (while running ./bin/setup command)).

For reference here is the "application.yaml" file, tell me if I am doing something wrong..............................thanks..

Hosting for Free on Cloud Platforms?

This looks awesome, really keen to use it on one of my own URLs but don't know much about Ruby on Rails.

Heroku offer a free plan but seems to sleep after 30 mins. Can you advise of any free options to host this? Perhaps on the major cloud platforms? Here are the free tier details:

https://aws.amazon.com/free/?awsf.Free%20Tier%20Types=categories%23featured
https://cloud.google.com/free/
https://azure.microsoft.com/en-us/free/

Perhaps Google App Engine or Azure App Service or Elastic Beanstalk? Not sure who these work with a getting a decent looking URL.

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.