src
├── __fixtures__ # dummy models
├── api # API clients
├── components # shared components
│ └── comp-name
│ ├── comp-name # component's components
│ ├── index.tsx
│ ├── index.test.ts
│ └── index.stories.ts
├── constants # shared constants
├── hooks # shared hooks
├── mocks # API mock files
│ └── services
├── queries # react query modules
│ └── module-name
│ ├── query-hook.ts # use query hook
│ └── mutation-hook.ts # use mutation hook
├── styles # shared styles
├── types # application types
└── utils # utils filesFirst time running, you need to install dependencies.
make update/web-depsWe use msw for mocking API, so you can see UI without running API server.
make run/webThe app will be available at http://localhost:9090.
If you want to connect to a real API server, additional settings on the .env file are needed.
First, create your own .env file based on the .env.example file.
cp .env.example .envAdd your API endpoint to the .env file like this:
API_ENDPOINT=https://{API_ADDRESS}
Set ENABLE_MOCK to false explicitly.
ENABLE_MOCK=false
If the API server has authorization by cookie, set API_COOKIE to the cookie you have already obtained through other clients
(typically you need to send some kind of request from an authenticated client and peek at the request header in some way).
API_COOKIE={COOKIE}
Take Chrome for example;
- Access to the existing UI.
- Open the developer tools and go to the network panel.
- Find the
GetMerequest and select it. - Copy the whole value of the
Cookiein "Request Headers" and paste it toAPI_COOKIE={COOKIE}in the.envfile.
TIP: If you don't want to step up (or don't have) a PipeCD controlplane API server, you can login to https://play.pipecd.dev and use its API with your authenticated account.
