GithubHelp home page GithubHelp logo

ideawizard / openbazaar-ui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from overra/openbazaar-ui

0.0 1.0 0.0 2.23 MB

OpenBazaar UI

Home Page: https://openbazaar.org

Shell 0.20% JavaScript 19.50% CSS 53.37% HTML 26.92%

openbazaar-ui's Introduction

OpenBazaar Client

This is still heavily under development, only a small portion ties into the OpenBazaar node. Create an issue with any bugs you find and feel free to contribute.

Screenshot Timeline | Video demo

Requirements

  • nw.js v0.12.0
  • node.js & npm
  • bower npm i -g bower
  • gulp npm i -g gulp
  • OB ws.py check_origin override

Installation

Setting the Websocket Port

When OpenBazaar opens, it will print a port. For example:

{'nat_type': 'Symmetric NAT', 'external_ip': '110.77.235.189', 
'external_port': 29865}

This UI needs to know which port to connect to. Take note of this port - it will be used as the WS_PORT env var when building, as seen below.

OB ws.py check_origin override

This bypasses the origin check in tornado's WebSocketHandler so that the nw app can communicate with OpenBazaar.

  • Stop your OpenBazaar node
  • Apply the changes to ws.py below
  • Start OpenBazaar node and make note of the web server port (i.e. 127.0.0.1:56573)
--- a/node/ws.py
+++ b/node/ws.py
@@ -1158,3 +1158,8 @@ class WebSocketHandler(tornado.websocket.WebSocketHandler):
						 self.loop.current().add_callback(send_response)
				 except Exception:
						 logging.error("Error adding callback", exc_info=True)
+
+    # overwrite tornado.websocket.WebSocketHandler's check_origin
+    # https://github.com/tornadoweb/tornado/blob/master/tornado/websocket.py#L311
+    def check_origin(self, origin):
+        return True

openbazaar ui

git clone https://github.com/OpenBazaar/OpenBazaar-UI.git openbazaar-ui && cd $_
mkdir nw 

# Copy nw.js related files to `/path/to/openbazaar-ui/nw'

# Install gulp related modules and bower components
# If you're on linux and ./nw/nw points to your nw.js binary
# you should be able to `gulp watch` -- need osx support
# 
# WS_PORT=56573
./configure.sh ob_port

# change this to point to your nw.js
/path/to/openbazaar-ui/nw/nw .

Running in Browser instead of nw.js

You might want to debug in a normal browser instead of running nw.js. To do this:

# Fill in WS_PORT from OpenBazaar. See above.
# `browser-dev` will compile files for the browser, and open your 
# default browser to the correct host and port.
WS_PORT=<websocket port> gulp browser-dev

Project structure

- dist/ 						<- compiled output
- src/
	- fonts/ 					<- web fonts from brick.im
	- images/ 					<- logos, icons and svg loaders
	- js/
		- controllers/
			- App.js 			<- (as AppController in angular)
			- ...
		- directives/
		- services/
		- app.js 				<- main js file
	- scss/
		- app.scss 				<- main scss file
		- _(.*).scss 			<- attempt at breaking up styles
	- vendor/
		- js/ 					<- js libraries not on bower
		- ... 					<- components installed by bower
	- views/
		- includes/
		- templates/
		- index.jade

Known Issues

  • Random app freeze, not sure if specific to my OS / setup
  • Lots of unfinishedness
  • Stuff needs to be moved into directives and services/factories
  • Inconsistent file naming patterns, coding style
    • Maybe a styleguide based on google/twitter guides?
  • Left over code litter
  • Little to no comments
  • Perhaps to complex of structure?

License

(ISC)

Copyright (c) 2015, Adam Snodgrass [email protected]

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

openbazaar-ui's People

Contributors

overra avatar strml avatar reganlawton avatar

Watchers

James Cloos avatar

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.