1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00
commons/README.md
2019-04-09 10:42:00 +02:00

123 lines
4.7 KiB
Markdown

[![banner](https://raw.githubusercontent.com/oceanprotocol/art/master/github/repo-banner%402x.png)](https://oceanprotocol.com)
<h1 align="center">Commons</h1>
> Marketplace front-end and backend server to explore, download, and publish open data sets.
> https://commons.oceanprotocol.com
[![Build Status](https://travis-ci.com/oceanprotocol/commons.svg?token=3psqw6c8KMDqfdGQ2x6d&branch=master)](https://travis-ci.com/oceanprotocol/commons)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-7b1173.svg?style=flat-square)](https://github.com/prettier/prettier)
[![js oceanprotocol](https://img.shields.io/badge/js-oceanprotocol-7b1173.svg)](https://github.com/oceanprotocol/eslint-config-oceanprotocol)
[![css bigchaindb](https://img.shields.io/badge/css-bigchaindb-39BA91.svg)](https://github.com/bigchaindb/stylelint-config-bigchaindb)
<img alt="screen shot 2019-02-08 at 16 53 57" src="https://user-images.githubusercontent.com/90316/52489283-27080e80-2bc2-11e9-8ec0-508c21eb86f7.png">
---
### 🦑🦑🦑 This marketplace is deployed under https://commons.oceanprotocol.com and can be used there. Feel free to [report any issues](https://github.com/oceanprotocol/commons/issues) you encounter. 🦑🦑🦑
If you're a developer and want to contribute to, or want to utilize this marketplace's code in your projects, then keep on reading.
---
- [🏄 Get Started](#-get-started)
- [🐳 Use with Barge](#-use-with-barge)
- [🛳 Production](#-production)
- [👩‍🔬 Testing](#-testing)
- [🎁 Contributing](#-contributing)
- [⬆️ Bumping version](#-bumping-version)
- [✨ Code Style](#-code-style)
- [🏛 License](#-license)
This repo contains a client and a server, both written in TypeScript:
- **client**: React app setup with [squid-js](https://github.com/oceanprotocol/squid-js), bootstrapped with [Create React App](https://github.com/facebook/create-react-app)
- **server**: Node.js app, utilizing [Express](https://expressjs.com). The server provides various microservices, like remote file checking.
## 🏄 Get Started
To spin up both, the client and the server in a watch mode for local development, execute:
```bash
npm install
npm start
```
Open [http://localhost:3000](http://localhost:3000) to view the client in the browser. The page will reload if you make edits to files in either `./client` or `./server`.
To make use of all the functionality, you need to connect to the Ocean network. By default, the client will connect to [Ocean's Nile test network](https://docs.oceanprotocol.com/concepts/testnets/#the-nile-testnet) remotely.
### 🐳 Use with Barge
If you prefer to connect to locally running components instead of remote connections to Ocean's Nile network, you can spin up [`barge`](https://github.com/oceanprotocol/barge) and use a local network:
```bash
git clone git@github.com:oceanprotocol/barge.git
cd barge
./start_ocean.sh --latest --no-pleuston --local-spree-node
```
Modify `./client/src/config/config.ts` to use those local connections.
## 🛳 Production
To create a production build of both, the client and the server, run from the root of the project:
```bash
npm run build
```
Builds the client for production to the `./client/build` folder, and the server into the `./server/dist` folder.
## 👩‍🔬 Testing
```bash
npm test
```
Launches the test runner in the interactive watch mode.
## 🎁 Contributing
See the page titled "[Ways to Contribute](https://docs.oceanprotocol.com/concepts/contributing/)" in the Ocean Protocol documentation.
## ⬆️ Bumping version
Use the `bumpversion.sh` script to bump the project version. You can execute the script using {major|minor|patch} as first argument to bump the version accordingly:
- To bump the patch version: `./bumpversion.sh patch`
- To bump the minor version: `./bumpversion.sh minor`
- To bump the major version: `./bumpversion.sh major`
After that, you need to commit, push and git tag the commit if desired/needed.
## ✨ Code Style
For linting and auto-formatting you can use from the root of the project:
```bash
# auto format all ts & css with eslint & stylelint
npm run lint
# auto format all ts & css with prettier, taking all configs into account
npm run format
```
## 🏛 License
```text
Copyright 2018 Ocean Protocol Foundation Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```