saleor-dashboard/README.md

72 lines
1.7 KiB
Markdown
Raw Normal View History

2019-06-19 16:04:50 +00:00
# Saleor Dashboard
2019-06-19 14:40:52 +00:00
2019-06-19 16:09:48 +00:00
![1 copy 2x](https://user-images.githubusercontent.com/5421321/47799917-8afd7a00-dd2b-11e8-88c7-63588e25bcea.png)
A GraphQL-powered, single-page dashboard application for [Saleor](https://github.com/mirumee/saleor/).
2019-09-22 12:30:10 +00:00
## Demo
2019-10-28 16:25:00 +00:00
See the [public demo](https://pwa.saleor.io/dashboard/) of Saleor Dashboard!
2019-09-22 12:30:10 +00:00
Or launch the demo on a free Heroku instance.
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
2019-06-19 16:04:50 +00:00
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
### Prerequisites
2019-09-22 12:30:10 +00:00
- Node.js 10.0+
2019-06-19 16:04:50 +00:00
- A running instance of [Saleor](https://github.com/mirumee/saleor/).
### Installing
Clone the repository:
```
$ git clone https://github.com/mirumee/saleor-dashboard.git
2019-06-19 16:04:50 +00:00
```
Enter the project directory:
```
2019-06-19 16:06:12 +00:00
$ cd saleor-dashboard
2019-06-19 16:04:50 +00:00
```
Install NPM dependencies:
```
2019-06-19 16:06:12 +00:00
$ npm i
2019-06-19 16:04:50 +00:00
```
2019-06-19 14:40:52 +00:00
2019-06-19 15:41:42 +00:00
### Configuration
2019-06-19 14:40:52 +00:00
2019-06-19 16:04:50 +00:00
There are two environment variables available for configuration:
2019-09-22 12:30:10 +00:00
- `API_URI` (required) - URI of a running instance of Saleor GraphQL API.
If you are running Saleor locally with the default settings, set `API_URI` to: `http://localhost:8000/graphql/`.
2019-06-19 16:04:50 +00:00
2019-09-22 12:30:10 +00:00
- `APP_MOUNT_URI` - URI at which the Dashboard app will be mounted.
E.g. if you set `APP_MOUNT_URI` to `/dashboard/`, your app will be mounted at `http://localhost:9000/dashboard/`.
2019-06-19 14:40:52 +00:00
2019-12-04 10:25:51 +00:00
- `STATIC_URL` - URL where the static files are located.
E.g. if you use S3 bucket, you should set it to the bucket's URL. By default Saleor assumes you serve static files from the root of your site at `http://localhost:9000/`.
2019-06-19 15:41:42 +00:00
### Development
2019-06-19 14:40:52 +00:00
2019-06-19 16:04:50 +00:00
To start the development server run:
```
2019-06-19 16:06:12 +00:00
$ npm start
2019-06-19 16:04:50 +00:00
```
2019-06-19 14:40:52 +00:00
2019-06-19 15:41:42 +00:00
### Production
2019-06-19 14:40:52 +00:00
2019-06-19 16:04:50 +00:00
To build the application bundle run:
```
2019-06-19 16:06:12 +00:00
$ npm run build
2019-06-19 16:04:50 +00:00
```