Skip to content

Commit 5e5ea33

Browse files
bornavmaindotmarcell
authored andcommitted
[flagd-ui] added basic functionality and webui interface
1 parent 39f5e47 commit 5e5ea33

23 files changed

+5658
-0
lines changed

src/flagd-ui/.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

src/flagd-ui/.gitignore

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts

src/flagd-ui/Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM node:20.15.1-slim
2+
WORKDIR /data
3+
COPY . .
4+
RUN npm install
5+
CMD [ "/bin/bash -c 'npm run dev'" ]
6+

src/flagd-ui/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
# or
14+
bun dev
15+
```
16+
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18+
19+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20+
21+
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
22+
23+
## Learn More
24+
25+
To learn more about Next.js, take a look at the following resources:
26+
27+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29+
30+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31+
32+
## Deploy on Vercel
33+
34+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35+
36+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

src/flagd-ui/data/output.json

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"$schema": "https://flagd.dev/schema/v0/flags.json",
3+
"flags": {
4+
"productCatalogFailure": {
5+
"description": "Fail product catalog service on a specific product",
6+
"state": "ENABLED",
7+
"variants": {
8+
"on": true,
9+
"off": false
10+
},
11+
"defaultVariant": "off"
12+
},
13+
"recommendationServiceCacheFailure": {
14+
"description": "Fail recommendation service cache",
15+
"state": "DISABLED",
16+
"variants": {
17+
"on": true,
18+
"off": false
19+
},
20+
"defaultVariant": "on"
21+
},
22+
"adServiceManualGc": {
23+
"description": "Triggers full manual garbage collections in the ad service",
24+
"state": "DISABLED",
25+
"variants": {
26+
"on": true,
27+
"off": false
28+
},
29+
"defaultVariant": "on"
30+
},
31+
"adServiceHighCpu": {
32+
"description": "Triggers high cpu load in the ad service",
33+
"state": "ENABLED",
34+
"variants": {
35+
"on": true,
36+
"off": false
37+
},
38+
"defaultVariant": "off"
39+
},
40+
"adServiceFailure": {
41+
"description": "Fail ad service",
42+
"state": "ENABLED",
43+
"variants": {
44+
"on": true,
45+
"off": false
46+
},
47+
"defaultVariant": "off"
48+
},
49+
"kafkaQueueProblems": {
50+
"description": "Overloads Kafka queue while simultaneously introducing a consumer side delay leading to a lag spike",
51+
"state": "ENABLED",
52+
"variants": {
53+
"on": 100,
54+
"off": 0
55+
},
56+
"defaultVariant": "off"
57+
},
58+
"cartServiceFailure": {
59+
"description": "Fail cart service",
60+
"state": "ENABLED",
61+
"variants": {
62+
"on": true,
63+
"off": false
64+
},
65+
"defaultVariant": "off"
66+
},
67+
"paymentServiceFailure": {
68+
"description": "Fail payment service charge requests",
69+
"state": "ENABLED",
70+
"variants": {
71+
"on": true,
72+
"off": false
73+
},
74+
"defaultVariant": "off"
75+
},
76+
"paymentServiceUnreachable": {
77+
"description": "Payment service is unavailable",
78+
"state": "ENABLED",
79+
"variants": {
80+
"on": true,
81+
"off": false
82+
},
83+
"defaultVariant": "off"
84+
},
85+
"loadgeneratorFloodHomepage": {
86+
"description": "Flood the frontend with a large amount of requests.",
87+
"state": "ENABLED",
88+
"variants": {
89+
"on": 100,
90+
"off": 0
91+
},
92+
"defaultVariant": "off"
93+
},
94+
"imageSlowLoad": {
95+
"description": "slow loading images in the frontend",
96+
"state": "ENABLED",
97+
"variants": {
98+
"10sec": 10000,
99+
"5sec": 5000,
100+
"off": 0
101+
},
102+
"defaultVariant": "off"
103+
}
104+
}
105+
}

src/flagd-ui/next.config.mjs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {};
3+
4+
export default nextConfig;

0 commit comments

Comments
 (0)