├── screenshots ├── a.jpg ├── b.jpg ├── c.jpg └── d.jpg ├── public └── images │ ├── favicon.ico │ ├── favicon-static.ico │ ├── merchant-icon-logo-sm.png │ └── merchant-icon-tiles-sm.png ├── system ├── middleware │ ├── catch-all │ │ └── index.js │ ├── create-event-model │ │ └── index.js │ ├── install-page-links │ │ └── index.js │ ├── error-handler │ │ └── index.js │ ├── populate-data-model │ │ └── index.js │ ├── create-data-model │ │ └── index.js │ └── installer │ │ └── index.js ├── event │ └── test-user │ │ └── index.js ├── handler │ ├── simple-render │ │ └── index.js │ ├── download-file │ │ └── index.js │ └── stripe-charge │ │ └── index.js ├── view │ ├── partials │ │ ├── intro.hbs │ │ ├── subtitle.hbs │ │ ├── header.hbs │ │ ├── buyButton.hbs │ │ ├── htmlHead.hbs │ │ ├── navigation.hbs │ │ ├── htmlFoot.hbs │ │ └── footer.hbs │ ├── cards │ │ ├── livePreviewCard.hbs │ │ ├── productCard.hbs │ │ ├── productPropertiesCard.hbs │ │ ├── quickPurchaseCard.hbs │ │ ├── productScreenshotCard.hbs │ │ └── productLicensingCard.hbs │ ├── about.hbs │ ├── products.hbs │ ├── index.hbs │ ├── product.hbs │ ├── charge.hbs │ └── error.hbs ├── value │ ├── featured-products │ │ └── index.js │ ├── popular-products │ │ └── index.js │ ├── related-products │ │ └── index.js │ ├── browse-products │ │ └── index.js │ └── selected-product │ │ └── index.js └── helpers │ ├── product-expander │ └── index.js │ ├── product-object-lookup │ └── index.js │ └── secure-link │ └── index.js ├── TODO.md ├── model.json ├── server.devel.js ├── process.sample.json ├── server.js ├── .gitignore ├── files └── README.md ├── index.js ├── StackScript ├── package.json ├── ABOUT.md ├── test └── test.js ├── README.md └── LICENSE /screenshots/a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fantasyui-com/online-marketplace/HEAD/screenshots/a.jpg -------------------------------------------------------------------------------- /screenshots/b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fantasyui-com/online-marketplace/HEAD/screenshots/b.jpg -------------------------------------------------------------------------------- /screenshots/c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fantasyui-com/online-marketplace/HEAD/screenshots/c.jpg -------------------------------------------------------------------------------- /screenshots/d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fantasyui-com/online-marketplace/HEAD/screenshots/d.jpg -------------------------------------------------------------------------------- /public/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fantasyui-com/online-marketplace/HEAD/public/images/favicon.ico -------------------------------------------------------------------------------- /public/images/favicon-static.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fantasyui-com/online-marketplace/HEAD/public/images/favicon-static.ico -------------------------------------------------------------------------------- /public/images/merchant-icon-logo-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fantasyui-com/online-marketplace/HEAD/public/images/merchant-icon-logo-sm.png -------------------------------------------------------------------------------- /public/images/merchant-icon-tiles-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fantasyui-com/online-marketplace/HEAD/public/images/merchant-icon-tiles-sm.png -------------------------------------------------------------------------------- /system/middleware/catch-all/index.js: -------------------------------------------------------------------------------- 1 | module.exports = async function({app,conf}) { 2 | app.get('*',function (req, res) { res.redirect('/') }); 3 | } 4 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | # Todo 2 | 3 | - Solve CAPTCHA for each re-download on download page. 4 | - Send email to the customer (containing the PURCHASE CERTIFICATE [link]) 5 | -------------------------------------------------------------------------------- /system/event/test-user/index.js: -------------------------------------------------------------------------------- 1 | modeule.exports = async function( {app} ){ 2 | 3 | return function (req, res) { 4 | 5 | res.end('Hola!') 6 | 7 | }); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /model.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "eSELR", 3 | "description": "Wise, Trustworthy, Open, Portable, Sustainable, Safe and Secure. Welcome to the sustainable design revolution.", 4 | 5 | "email":"captain@eselr.com" 6 | } 7 | -------------------------------------------------------------------------------- /system/middleware/create-event-model/index.js: -------------------------------------------------------------------------------- 1 | module.exports = async function ({ route }) { 2 | return async function (req, res, next) { 3 | try { 4 | // ... // 5 | next(); 6 | } catch (err) { 7 | next(err); 8 | } 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /system/handler/simple-render/index.js: -------------------------------------------------------------------------------- 1 | module.exports = async function({route}){ 2 | 3 | return async (req, res) => { 4 | 5 | //TODO: VERIFY THAT THE OUTPUT DOES NOT CONTAIN JAVASCRIPT: OR DATA: 6 | //TODO: VERIFY THAT THE OUTPUT DOES NOT CONTAIN SCRIPT TAGS. 7 | 8 | res.render(route.viewId, req.model ); 9 | 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /system/view/partials/intro.hbs: -------------------------------------------------------------------------------- 1 |
8 | -------------------------------------------------------------------------------- /system/view/cards/livePreviewCard.hbs: -------------------------------------------------------------------------------- 1 |Preview {{inHTMLData selectedProduct.title}} in full prior to purchase.
5 |7 | {{inHTMLData text}} 8 |
9 | 10 |{{inHTMLData flashMessage.text}}
8 |{{inHTMLData flashMessage.description}}
9 |{{inHTMLData description}}
8 || {{inHTMLData label}} | 10 |{{inHTMLData text}} | 11 |
Purchase {{inHTMLData selectedProduct.title}} Standard License for ${{inHTMLData selectedProduct.price}}
14 | 15 |{{inHTMLData selectedProduct.description}}
7 |8 | {{#each selectedProduct.tags}} 9 | {{this}} 10 | {{~/each}} 11 |
12 | 13 |{{inHTMLData message}}
17 |Use your browser's "back" button and try again.
18 |${text}
` } 23 | marked.setOptions({ renderer }); 24 | 25 | const xssFilters = require('xss-filters'); 26 | hbs.registerHelper('about', function(str) { return marked( fs.readFileSync(path.join(__dirname,'ABOUT.md')).toString() ) }); 27 | hbs.registerHelper('mangle', function(str) { return str.split("").map(i=>i.charCodeAt(0)-1).map(i=>String.fromCharCode(i)).join("")} ); 28 | hbs.registerHelper('inHTMLData', function(str) { return xssFilters.inHTMLData(str); }); 29 | hbs.registerHelper('inSingleQuotedAttr', function(str) { return xssFilters.inSingleQuotedAttr(str); }); 30 | hbs.registerHelper('inDoubleQuotedAttr', function(str) { return xssFilters.inDoubleQuotedAttr(str); }); 31 | hbs.registerHelper('inUnQuotedAttr', function(str) { return xssFilters.inUnQuotedAttr(str); }); 32 | 33 | const express = require('express'); 34 | const app = express(); 35 | app.use(express.static('public')) 36 | 37 | app.set('views', [ path.join(__dirname, 'system', 'view') ]); 38 | app.set("view engine", "hbs"); 39 | 40 | const middlewareInstaller = require( path.join(__dirname, 'system', 'middleware', 'installer') ); 41 | const catchAll = require( path.join(__dirname, 'system', 'middleware', 'catch-all') ); 42 | const errorHandler = require( path.join(__dirname, 'system', 'middleware', 'error-handler') ); 43 | 44 | async function configure(conf){ 45 | await middlewareInstaller({app,conf}); 46 | await catchAll({app,conf}); 47 | await errorHandler({app,conf}); 48 | return app; 49 | } 50 | 51 | module.exports = { 52 | install: async function(o){ 53 | const configured = await configure(o); 54 | return configured; 55 | } 56 | }; 57 | -------------------------------------------------------------------------------- /StackScript: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ######## 4 | # USER # 5 | ######## 6 | 7 | #