Skip to content

Commit 5803dd9

Browse files
committed
setup deployment and readme
1 parent b3d79ad commit 5803dd9

File tree

7 files changed

+94
-66
lines changed

7 files changed

+94
-66
lines changed

.env

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
VITE_ORDERLY_BROKER_ID=demo
2+
VITE_ORDERLY_BROKER_NAME=Demo
3+
VITE_ORDERLY_NETWORK_ID=testnet

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ node_modules
22

33
/.cache
44
/build
5-
.env
65
.npmrc
6+
.specstory

Dockerfile

-36
This file was deleted.

README.md

+83-26
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,109 @@
1-
# Template for Orderly SDK v2 based on Remix
1+
# Orderly Broker UI Template
22

3-
## Getting started
3+
This template provides a quick way to set up a customized trading UI for Orderly Network brokers, built with Remix and deployable on GitHub Pages.
44

5-
1. Clone the code:
5+
## Quick Start
6+
7+
1. **Fork the Repository**
8+
9+
Fork this repository to your GitHub account to create your broker's UI.
10+
11+
2. **Clone Your Fork**
612

713
```sh
8-
git clone https://github.com/OrderlyNetwork/orderly-js-sdk-remix-template.git
9-
cd orderly-js-sdk-remix-template
14+
git clone https://github.com/YOUR_USERNAME/broker-template.git
15+
cd broker-template
1016
```
1117

12-
2. Install the dependencies
18+
3. **Install Dependencies**
1319

1420
```sh
15-
npm install
21+
yarn install
1622
```
1723

18-
3. Development
24+
## Configuration Steps
25+
26+
### 1. Broker Configuration
1927

20-
Run the dev server:
28+
Edit the `.env` file to set up your broker details:
2129

22-
```shellscript
23-
npm run dev
30+
```env
31+
VITE_ORDERLY_BROKER_ID=your_broker_id
32+
VITE_ORDERLY_BROKER_NAME=Your Broker Name
33+
VITE_ORDERLY_NETWORK_ID=mainnet # or testnet for testing
2434
```
2535

26-
4. Deployment
36+
### 2. Theme Customization
2737

28-
First, build your app for production:
38+
1. Visit the [Orderly Storybook Trading Page](https://storybook.orderly.network/?path=/story/package-trading-tradingpage--page)
39+
2. Customize your preferred theme using the controls
40+
3. Export the generated CSS
41+
4. Replace the contents of `app/styles/theme.css` with your exported CSS
2942

30-
```sh
31-
npm run build
32-
```
43+
### 3. UI Configuration
3344

34-
Then run the app in production mode:
45+
Edit `app/utils/config.tsx` to customize your UI:
3546

36-
```sh
37-
npm start
38-
```
47+
- **Footer Links**: Update `footerProps` with your social media links
48+
- **Logos**: Replace the main and secondary logos in the `appIcons` section
49+
- **PnL Sharing**: Customize the PnL poster backgrounds and colors in `sharePnLConfig`
50+
51+
Required assets:
52+
- Place your logos in the `public` directory:
53+
- Main logo: `public/orderly-logo.svg`
54+
- Secondary logo: `public/orderly-logo-secondary.svg`
55+
- Favicon: `public/favicon.png`
56+
- PnL sharing backgrounds: `public/pnl/poster_bg_[1-4].png`
57+
58+
## Development
3959

40-
5. Create docker image
60+
Run the development server:
4161

4262
```sh
43-
docker build -t orderly-js-sdk-remix-template .
63+
yarn dev
4464
```
4565

46-
## Docs
66+
## Deployment
4767

48-
For more information, please visit the following link:
68+
1. Build the application:
69+
70+
```sh
71+
yarn build
72+
```
4973

50-
- [Orderly JS SDK](https://github.com/OrderlyNetwork/js-sdk)
51-
- [SDK documentation](https://orderly.network/docs/sdks)
74+
2. Base URL Configuration:
75+
76+
The base URL configuration depends on your deployment method:
77+
78+
- **For GitHub Pages subdirectory deployment** (`https://your-username.github.io/broker-template/`):
79+
Keep the basename configuration in `vite.config.ts`:
80+
```typescript
81+
// vite.config.ts
82+
remix({
83+
basename: "/your-repo-name", // Change this to match your repository name
84+
// ... other options
85+
})
86+
```
87+
88+
- **For custom domain deployment** (`https://your-domain.com`):
89+
Remove the basename configuration in `vite.config.ts`:
90+
```typescript
91+
// vite.config.ts
92+
remix({
93+
// basename: "/your-repo-name", // Remove or comment out this line
94+
// ... other options
95+
})
96+
```
97+
98+
3. Deploy to GitHub Pages:
99+
- Enable GitHub Pages in your repository settings
100+
- Set the build and deployment source to branch (not GitHub Actions)
101+
- Select the branch you want to deploy (typically `gh-pages` or `main`)
102+
- For custom domain setup, follow the [GitHub Pages custom domain configuration guide](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site)
103+
104+
## Additional Resources
105+
106+
- [Orderly JS SDK Documentation](https://github.com/OrderlyNetwork/js-sdk)
107+
- [Orderly Network Documentation](https://orderly.network/docs/sdks)
108+
- [Storybook Theme Editor](https://storybook.orderly.network/?path=/story/package-trading-tradingpage--page)
52109

app/components/orderlyProvider/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ const OrderlyProvider: FC<{ children: ReactNode }> = (props) => {
77
return (
88
<WalletConnectorProvider>
99
<OrderlyAppProvider
10-
brokerId="orderly"
11-
brokerName="Orderly"
12-
networkId="testnet"
10+
brokerId={import.meta.env.VITE_ORDERLY_BROKER_ID}
11+
brokerName={import.meta.env.VITE_ORDERLY_BROKER_NAME}
12+
networkId={import.meta.env.VITE_ORDERLY_NETWORK_ID}
1313
appIcons={config.orderlyAppProvider.appIcons}
1414
>
1515
{props.children}

app/utils/config.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ const config: OrderlyConfig = {
3636
description: "Trade with Orderly to earn ORDER",
3737
icon: <OrderlyIcon size={14} />,
3838
activeIcon: <OrderlyActiveIcon size={14} />,
39+
target: "_blank",
3940
},
4041

4142
{
4243
name: "Staking",
4344
href: "https://app.orderly.network/staking",
4445
description: "Stake ORDER/esORDER to acquire VALOR",
46+
icon: <OrderlyIcon size={14} />,
47+
activeIcon: <OrderlyActiveIcon size={14} />,
4548
target: "_blank",
4649
},
4750
],

vite.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default defineConfig(() => {
1717
},
1818
plugins: [
1919
remix({
20+
basename: "/broker-template",
2021
ssr: false,
2122
future: {
2223
v3_fetcherPersist: true,

0 commit comments

Comments
 (0)