christophercliff / flatmarket Goto Github PK
View Code? Open in Web Editor NEWA free, open source e-commerce platform for static websites.
Home Page: https://christophercliff.com/flatmarket/
License: MIT License
A free, open source e-commerce platform for static websites.
Home Page: https://christophercliff.com/flatmarket/
License: MIT License
Since it is bigger.
When I try to run flatmarket build ...
I get the following errors
/usr/local/lib/node_modules/flatmarket/lib/themes/default/index.jsx:27
<div className="container">
^
SyntaxError: Unexpected token <
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Module._extensions..js (module.js:478:10)
at Object.require.extensions.(anonymous function) [as .jsx] (/usr/local/lib/node_modules/flatmarket/node_modules/babel/node_modules/babel-core/lib/api/register/node.js:214:7)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at getMarkup (/usr/local/lib/node_modules/flatmarket/lib/index.js:174:21)
at buildLayout (/usr/local/lib/node_modules/flatmarket/lib/index.js:133:18)
at tryCatcher (/usr/local/lib/node_modules/flatmarket/node_modules/bluebird/js/main/util.js:26:23)
at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/flatmarket/node_modules/bluebird/js/main/promise.js:503:31)
at Promise._settlePromiseAt (/usr/local/lib/node_modules/flatmarket/node_modules/bluebird/js/main/promise.js:577:18)
at Promise._settlePromiseAtPostResolution (/usr/local/lib/node_modules/flatmarket/node_modules/bluebird/js/main/promise.js:244:10)
at Async._drainQueue (/usr/local/lib/node_modules/flatmarket/node_modules/bluebird/js/main/async.js:128:12)
at Async._drainQueues (/usr/local/lib/node_modules/flatmarket/node_modules/bluebird/js/main/async.js:133:10)
First, thanks for writing this piece of software and making it available to everyone! The idea is great and the implementation seems good. I especially like the idea of separating the client from the server side, which makes it very easy to integrate with already-existing websites.
That being said, I have a hard time making this work: I've checked the sources locally and followed the instructions located in the README.md
but I fail to generate a app.js
file. I wonder if this is due to recent changes in how webpack works or if it's due to my setup, but here are some details that might be useful in order to debug this.
After checking-out the source locally, I did a npm install
and make reset
. Once everything was installed, I tried to run the demonstration with make example-dev
. Webpack states that it compiled successfully but when I look in the build
folder, I don't see the app.js
file that should be in there.
Here is the result of a tree build
:
build/
├── flatmarket.json
├── images
│ ├── banana.png
│ ├── cherry.png
│ ├── peach.png
│ ├── pineapple.png
│ ├── plum.png
│ └── pomegranate.png
└── index.html
As you can see, all static files seems to be present except app.js
. It's probably important to note that:
make example-dev
, I edited it to change the value of the Stripe secret key;make example-dev
command doesn't return. It just hangs forever if I don't stop it (with ctrl-c)I admit that I'm not an expert with this ecosystem, and I would love to have some help / hints as to how to make this work, thanks!
I'd love to use flatmarket and integrate into an already existing site.
I guess I can copy and paste the HTML from the build/
directory into my site. However my request is for options to specify the template
as well as the resulting page name (i.e. not index.html
).
Existing
-h, --help output usage information
-c, --component [file] the Component
-d, --destination [dir] the build directory
-D, --dev run in dev mode
-p, --preview run in preview mode
-s, --source [dir] the source directory
-S, --stripe-secret-key [key] the Stripe secret key passed to the local server
-V, --version output the version number
New Options:
-t, --template [file] Template HTML doc
-o, --output [file] Resulting HTML page name
Hi,
I've got a static site (S3), want to get up and running with Stripe.
I've got the demo running locally - no problem.
I'm missing something fundamental moving from the demo to a static site and proxy server. Which pieces go where?
Im using the build command
./node_modules/.bin/flatmarket -c ./node_modules/flatmarket-cli/node_modules/flatmarket-theme-bananas/index.jsx -d pay ./src/flatmarket.json
node -v v10.19.0
npm -v 6.14.4
the error is:
Error: Cannot find module '/node_modules/flatmarket-cli/node_modules/flatmarket-theme-bananas/index.jsx'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
if I try this other build command it won't work
./node_modules/.bin/flatmarket ./src/flatmarket.json \
--component ./node_modules/flatmarket-theme-bananas/index.jsx
ReferenceError: Unknown plugin "/mnt/c/Users/serod/Documents/xan/tienda/node_modules/flatmarket-cli/node_modules/babel-plugin-transform-react-jsx" specified in "base" at 0, attempted to resolve relative to "/mnt/c/Users/serod/Documents/xan/tienda/node_modules/flatmarket-theme-bananas"
I've been trying to follow a guide from Netlify, but the only thing I've manage to do is make it work using the "--dev and stripe_key" arguments.
I've even asked for help in Netlify forum about this https://community.netlify.com/t/flatmarket-fails-at-deploy/19868
Some other issues I have with this project is that even if I make it work locally using the --dev and stripe key arguments in the build command, they stripe version needs to be updated and emails are not being sent when a purchase is made, but those are minor issues if I can't make it launch it on Netlify.
I'm not an expert but I've been trying to install in these 4-5 days different versions of nodejs and I still can't find the right combination to make it work.
Looking at all those other issues created in 2016, it feels like this project is not really usable in 2020.
It's such a pity because I've seen it work and it's a really awesome UI and simplistic way to make small purchases, but the lack of long term support and maintainability makes me want to try another alternative for this.
I really hope I'm wrong and people is still using this nowadays!
Tried installing the CLI and failed because my version of node was 6.x.
Switched to v4.8.3
via nvm
...
➜ flatmarket npm install flatmarket-cli
npm WARN peerDependencies The peer dependency webpack@^2.0.0 || ^3.0.0 included from expose-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN engine [email protected]: wanted: {"node":"4.2.x"} (current: {"node":"4.8.3","npm":"2.15.11"})
npm WARN deprecated [email protected]: Deprecated.
\
> [email protected] install /Users/chrisd/flatmarket/node_modules/flatmarket-cli/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents
> node install
[fsevents] Success: "/Users/chrisd/flatmarket/node_modules/flatmarket-cli/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
npm ERR! Darwin 16.7.0
npm ERR! argv "/Users/chrisd/.nvm/versions/node/v4.8.3/bin/node" "/Users/chrisd/.nvm/versions/node/v4.8.3/bin/npm" "install" "flatmarket-cli"
npm ERR! node v4.8.3
npm ERR! npm v2.15.11
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants webpack@^2.0.0 || ^3.0.0
npm ERR! peerinvalid Peer [email protected] wants webpack@^1.9.11
npm ERR! peerinvalid Peer [email protected] wants webpack@>=1.3.0 <3
npm ERR! Please include the following file with any support request:
npm ERR! /Users/chrisd/flatmarket/npm-debug.log
relevant parts of the log which is really long...
82947 info install [email protected]
82948 info postinstall [email protected]
82949 verbose unlock done using /Users/chrisd/.npm/_locks/flatmarket-cli-87700ca9fa0baf5c.lock for /Users/chrisd/flatmarket/node_modules/flatmarket-cli
82950 verbose validateInstall loading /Users/chrisd/flatmarket/package.json for validation
82951 verbose stack Error: The package [email protected] does not satisfy its siblings' peerDependencies requirements!
82951 verbose stack at /Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/lib/install.js:125:32
82951 verbose stack at /Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/lib/install.js:268:7
82951 verbose stack at /Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/read-installed/read-installed.js:142:5
82951 verbose stack at /Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
82951 verbose stack at cb (/Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
82951 verbose stack at /Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
82951 verbose stack at cb (/Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
82951 verbose stack at /Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
82951 verbose stack at cb (/Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
82951 verbose stack at /Users/chrisd/.nvm/versions/node/v4.8.3/lib/node_modules/npm/node_modules/read-installed/read-installed.js:263:14
82952 verbose cwd /Users/chrisd/flatmarket
82953 error Darwin 16.7.0
82954 error argv "/Users/chrisd/.nvm/versions/node/v4.8.3/bin/node" "/Users/chrisd/.nvm/versions/node/v4.8.3/bin/npm" "install" "flatmarket-cli"
82955 error node v4.8.3
82956 error npm v2.15.11
82957 error code EPEERINVALID
82958 error peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
82958 error peerinvalid Peer [email protected] wants webpack@^2.0.0 || ^3.0.0
82958 error peerinvalid Peer [email protected] wants webpack@^1.9.11
82958 error peerinvalid Peer [email protected] wants webpack@>=1.3.0 <3
82959 verbose exit [ 1, true ]
As described here https://support.stripe.com/questions/email-receipts , Stripe has two ways to manage email receipts:
receipt_email
with the charge creation requestemail
when creating a customer, and then turning on customer receipts from the email settings in Stripe dashboardAs shown below (code from hapi-flatmarket/lib/index.js), Flatmarket can handle plans (in which case it uses stripe.customers.create
) or single charges (in which case it uses stripe.charges.create
):
The question is: Is it possible to support email receipts by slightly modifying this?
Thanks in advance!
I want to use this project for potentially one-off products. I understand the whole concept is serverless but is there a way to decrement the product amount after a purchase?
edit: Maybe using firebase.io for product details instead of static hosting?
I cannot and the terminal cannot find /node_modules/.bin/flatmarket
See #38.
It looks like products must be pre-defined in the config, and in the example only one item can be picked. Is there a way to combine multiple items into a single purchase?
Hello, I just came across a similar but more recent application that also uses AWS lambda for e-commerce. They support Stripe relay for handling of goods. What are the main differences between it and flatmarket?
Get the latest React stuff.
Hey Chris, first off thank you a million times for making this. Its quite rad.
I'm running into what appears to be an SSL error. I did a little research and it seemed like the old SSL token for webpack-dev-server was out of date. Below is the error I get. I would assume the reason I'm not getting the js payload is because of the SSL issue.
Please post a link and short description of your use case here!
How would one go about this? If I want to build a totally bespoke site, is there an API schema for server?
Sweet project, btw 👍
Stripe Checkout now has official support for shipping address. Flatmarket should support this feature. See this blog post for some background and example implementation.
Depends on:
Update actions.js to allow shipping address and integrate with flatmarket-client. Must be back compatible.
When I attempt to make a purchase on the test site in the README I get an error "Invalid API key: pk_test_************enUe"
Probably just needs to be updated, but if the demo is supposed to have an invalid API key to prevent purchases maybe mention it in the README
flatmarket-example
directorynpm install
# ./node_modules/.bin/flatmarket src/flatmarket.json --stripe-secret-key 12345 --component node_modules/flatmarket-theme-bananas/index.jsx
(node:65846) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
ReferenceError: Unknown plugin "flatmarket/packages/flatmarket-example/node_modules/flatmarket-cli/node_modules/babel-plugin-transform-react-jsx" specified in "base" at 0, attempted to resolve relative to "flatmarket/packages/flatmarket-example/node_modules/flatmarket-theme-bananas"
at flatmarket/packages/flatmarket-example/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17
at Array.map (native)
at Function.normalisePlugins (flatmarket/packages/flatmarket-example/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
at OptionManager.mergeOptions (flatmarket/packages/flatmarket-example/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
at OptionManager.init (flatmarket/packages/flatmarket-example/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at compile (flatmarket/packages/flatmarket-example/node_modules/babel-register/lib/node.js:103:45)
at loader (flatmarket/packages/flatmarket-example/node_modules/babel-register/lib/node.js:144:14)
at Object.require.extensions.(anonymous function) [as .jsx] (flatmarket/packages/flatmarket-example/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at getMarkup (flatmarket/packages/flatmarket-example/node_modules/flatmarket-cli/lib/index.js:171:21)
at buildLayout (flatmarket/packages/flatmarket-example/node_modules/flatmarket-cli/lib/index.js:126:18)
at tryCatcher (flatmarket/packages/flatmarket-example/node_modules/bluebird/js/main/util.js:26:23)
OSX
node -v = v7.7.1
Do I need to look at a different version of node? Am I doing something wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.