saleor-dashboard/README.md

90 lines
2.1 KiB
Markdown
Raw Normal View History

2019-06-19 16:04:50 +00:00
# Saleor Dashboard
2019-06-19 14:40:52 +00:00
![Saleor Dashboard](https://user-images.githubusercontent.com/249912/82305745-5c52fd00-99be-11ea-9ac6-cc04a6f28c91.png)
2019-06-19 16:09:48 +00:00
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
```
2020-02-03 11:53:51 +00:00
Enter the project directory:
```
$ cd saleor-dashboard
```
2020-01-22 14:51:33 +00:00
#### Using stable release
To use the official stable release, checkout to a release tag:
```
2020-05-14 07:23:29 +00:00
$ git checkout 2.10.0
2020-01-22 14:51:33 +00:00
```
See the list of all releases here: https://github.com/mirumee/saleor-dashboard/releases/
#### Using development version
If you want to use the latest development version, checkout to the `master` branch:
```
$ git checkout master
```
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
```