Compare commits

...

10 Commits

32 changed files with 6624 additions and 1 deletions

24
.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

Binary file not shown.

View File

@@ -1,2 +1,30 @@
# developer_docs # NearleDaily Developer Docs
Welcome to the NearleDaily Developer Documentation portal.
This project is a React and Vite based application that provides a beautiful, modern, two-pane API documentation interface for integrating with NearleDaily's backend services including Users, Orders, Tenants, Products, and Locations.
## Getting Started
### Prerequisites
- Node.js (v20.x or above)
### Running Locally
1. Install dependencies:
```bash
npm install
```
2. Start the development server:
```bash
npm run dev
```
3. Open your browser and navigate to `http://localhost:5173`
## Built With
- React
- Vite
- Tailwind CSS
- Lucide Icons

21
eslint.config.js Normal file
View File

@@ -0,0 +1,21 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import { defineConfig, globalIgnores } from 'eslint/config'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{js,jsx}'],
extends: [
js.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
globals: globals.browser,
parserOptions: { ecmaFeatures: { jsx: true } },
},
},
])

13
index.html Normal file
View File

@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/src/assets/nearle.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>NearleDaily API</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>

3737
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

32
package.json Normal file
View File

@@ -0,0 +1,32 @@
{
"name": "nearledaily-docs",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"clsx": "^2.1.1",
"lucide-react": "^1.11.0",
"react": "^19.2.5",
"react-dom": "^19.2.5",
"tailwind-merge": "^3.5.0"
},
"devDependencies": {
"@eslint/js": "^9.11.1",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.18",
"eslint": "^9.11.1",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.12",
"postcss": "^8.4.35",
"tailwindcss": "^3.4.1",
"vite": "^5.2.0"
}
}

6
postcss.config.js Normal file
View File

@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

1
public/favicon.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.3 KiB

24
public/icons.svg Normal file
View File

@@ -0,0 +1,24 @@
<svg xmlns="http://www.w3.org/2000/svg">
<symbol id="bluesky-icon" viewBox="0 0 16 17">
<g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
<defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
</symbol>
<symbol id="discord-icon" viewBox="0 0 20 19">
<path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
</symbol>
<symbol id="documentation-icon" viewBox="0 0 21 20">
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
</symbol>
<symbol id="github-icon" viewBox="0 0 19 19">
<path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
</symbol>
<symbol id="social-icon" viewBox="0 0 20 20">
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
</symbol>
<symbol id="x-icon" viewBox="0 0 19 19">
<path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
scratch/docx_content.txt Normal file

Binary file not shown.

View File

@@ -0,0 +1,233 @@
0: Nearle Mobile API Full GraphQL Documentation
1: GetCustomerLocations
2: REST Params:
3: {"customerid": 6060}
4: GraphQL Query:
5: query GetCustomerLocations($customerid: bigint!) {
6: customer_locations(where: { customerid: { _eq: $customerid } }) {
7: locationid
8: latitude
9: longitude
10: address
11: }
12: }
13: GraphQL Variables:
14: {"customerid": 6060}
15: GetCustomerOrdersV3
16: REST Params:
17: {"customerid":6060,"tenantid":1087,"moduleid":2,"fromdate":"2026-01-01T00:00:00","todate":"2026-12-31T23:59:59","orderstatus":"delivered","keyword":"%pizza%","limit":10,"offset":0}
18: GraphQL Query:
19: query GetCustomerOrders($customerid: bigint!, $tenantid: bigint!, $moduleid: bigint!, $fromdate: timestamptz!, $todate: timestamptz!, $orderstatus: String!, $keyword: String, $limit: Int!, $offset: Int!) {
20: orders(
21: where: {
22: customerid: { _eq: $customerid }
23: tenantid: { _eq: $tenantid }
24: moduleid: { _eq: $moduleid }
25: orderstatus: { _eq: $orderstatus }
26: orderdate: { _gte: $fromdate, _lte: $todate }
27: _or: [{ orderid: { _ilike: $keyword } }]
28: }
29: limit: $limit
30: offset: $offset
31: ) {
32: orderid
33: orderstatus
34: orderamount
35: }
36: }
37: GraphQL Variables:
38: {"customerid":6060,"tenantid":1087,"moduleid":2,"fromdate":"2026-01-01T00:00:00","todate":"2026-12-31T23:59:59","orderstatus":"delivered","keyword":"%pizza%","limit":10,"offset":0}
39: GetCustomer
40: REST Params:
41: {"customerid":6060}
42: GraphQL Query:
43: query GetCustomer($customerid: bigint!) {
44: customers(where: { customerid: { _eq: $customerid } }) {
45: customerid
46: name
47: contactno
48: }
49: }
50: GraphQL Variables:
51: {"customerid":6060}
52: GetCustomerRequests
53: REST Params:
54: {"customerid":6060,"limit":10,"offset":0}
55: GraphQL Query:
56: query GetCustomerRequests($customerid: bigint!, $limit: Int!, $offset: Int!) {
57: customer_requests(where: { customerid: { _eq: $customerid } }, limit: $limit, offset: $offset) {
58: requestid
59: status
60: }
61: }
62: GraphQL Variables:
63: {"customerid":6060,"limit":10,"offset":0}
64: GetProductSubcategories
65: REST Params:
66: {"categoryid":1001}
67: GraphQL Query:
68: query GetProductSubcategories($categoryid: bigint!) {
69: app_subcategory(where: { categoryid: { _eq: $categoryid } }) {
70: subcategoryid
71: subcategoryname
72: }
73: }
74: GraphQL Variables:
75: {"categoryid":1001}
76: GetAppCategories
77: REST Params:
78: {}
79: GraphQL Query:
80: query GetAppCategories {
81: app_category {
82: categoryid
83: categoryname
84: }
85: }
86: GraphQL Variables:
87: {}
88: GetProductVariants
89: REST Params:
90: {"tenantid":1087,"subcategoryid":14}
91: GraphQL Query:
92: query GetProductVariants($tenantid: bigint!, $subcategoryid: bigint!) {
93: product_variants(where: { tenantid: { _eq: $tenantid }, subcategoryid: { _eq: $subcategoryid } }) {
94: variantid
95: productname
96: price
97: }
98: }
99: GraphQL Variables:
100: {"tenantid":1087,"subcategoryid":14}
101: GetTenantPromotions
102: REST Params:
103: {"tenantid":1087,"locationid":1}
104: GraphQL Query:
105: query GetTenantPromotions($tenantid: bigint!, $locationid: bigint!) {
106: promotions(where: { tenantid: { _eq: $tenantid }, locationid: { _eq: $locationid } }) {
107: promotionid
108: title
109: }
110: }
111: GraphQL Variables:
112: {"tenantid":1087,"locationid":1}
113: GetAppConfig
114: REST Params:
115: {"configid":15}
116: GraphQL Query:
117: query GetAppConfig($configid: bigint!) {
118: app_config(where: { configid: { _eq: $configid } }) {
119: configkey
120: configvalue
121: }
122: }
123: GraphQL Variables:
124: {"configid":15}
125: searchcustomers
126: REST Params:
127: {"tenantid":1087,"keyword":"%john%"}
128: GraphQL Query:
129: query SearchCustomers($tenantid: bigint!, $keyword: String!) {
130: customers(where: { tenantid: { _eq: $tenantid }, name: { _ilike: $keyword } }) {
131: customerid
132: name
133: }
134: }
135: GraphQL Variables:
136: {"tenantid":1087,"keyword":"%john%"}
137: getTenantorders
138: REST Params:
139: {}
140: GraphQL Query:
141: query GetTenantOrders {
142: orders {
143: orderid
144: tenantid
145: }
146: }
147: GraphQL Variables:
148: {}
149: getstaff
150: REST Params:
151: {"tenantid":1087}
152: GraphQL Query:
153: query GetStaff($tenantid: bigint!) {
154: staff(where: { tenantid: { _eq: $tenantid } }) {
155: staffid
156: name
157: }
158: }
159: GraphQL Variables:
160: {"tenantid":1087}
161: GetTenantInfo
162: REST Params:
163: {"tenantid":1079}
164: GraphQL Query:
165: query GetTenantInfo($tenantid: bigint!) {
166: tenants(where: { tenantid: { _eq: $tenantid } }) {
167: tenantname
168: city
169: }
170: }
171: GraphQL Variables:
172: {"tenantid":1079}
173: getTenantlocations
174: REST Params:
175: {"tenantid":1}
176: GraphQL Query:
177: query GetTenantLocations($tenantid: bigint!) {
178: tenant_locations(where: { tenantid: { _eq: $tenantid } }) {
179: locationid
180: locationname
181: }
182: }
183: GraphQL Variables:
184: {"tenantid":1}
185: getapplocations
186: REST Params:
187: {}
188: GraphQL Query:
189: query GetAppLocations {
190: app_location {
191: applocationid
192: locationname
193: }
194: }
195: GraphQL Variables:
196: {}
197: getsubcategory
198: REST Params:
199: {"moduleid":6,"categoryid":1}
200: GraphQL Query:
201: query GetSubCategory($moduleid: bigint!, $categoryid: bigint!) {
202: app_subcategory(where: { categoryid: { _eq: $categoryid }, category: { modules: { moduleid: { _eq: $moduleid } } } }) {
203: subcategoryid
204: subcategoryname
205: }
206: }
207: GraphQL Variables:
208: {"moduleid":6,"categoryid":1}
209: GetPartners
210: REST Params:
211: {"applocationid":1,"partnerid":44,"limit":10,"offset":0}
212: GraphQL Query:
213: query GetPartners($applocationid: bigint!, $partnerid: bigint, $limit: Int!, $offset: Int!) {
214: partners(where: { applocationid: { _eq: $applocationid }, partnerid: { _eq: $partnerid } }, limit: $limit, offset: $offset) {
215: partnerid
216: name
217: }
218: }
219: GraphQL Variables:
220: {"applocationid":1,"partnerid":44,"limit":10,"offset":0}
221: GetlocationsConfig
222: REST Params:
223: {}
224: GraphQL Query:
225: query GetLocationConfig {
226: app_locationconfigs {
227: applocationid
228: configkey
229: }
230: }
231: GraphQL Variables:
232: {}

15
scratch/extract_docx.py Normal file
View File

@@ -0,0 +1,15 @@
import docx
import json
def extract_docx_content(file_path):
doc = docx.Document(file_path)
full_text = []
for para in doc.paragraphs:
full_text.append(para.text)
return "\n".join(full_text)
content = extract_docx_content('Nearle_Full_API_Documentation.docx')
with open('scratch/docx_content_utf8.txt', 'w', encoding='utf-8') as f:
lines = content.split('\n')
for i, line in enumerate(lines):
f.write(f"{i}: {line}\n")

184
src/App.css Normal file
View File

@@ -0,0 +1,184 @@
.counter {
font-size: 16px;
padding: 5px 10px;
border-radius: 5px;
color: var(--accent);
background: var(--accent-bg);
border: 2px solid transparent;
transition: border-color 0.3s;
margin-bottom: 24px;
&:hover {
border-color: var(--accent-border);
}
&:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
}
.hero {
position: relative;
.base,
.framework,
.vite {
inset-inline: 0;
margin: 0 auto;
}
.base {
width: 170px;
position: relative;
z-index: 0;
}
.framework,
.vite {
position: absolute;
}
.framework {
z-index: 1;
top: 34px;
height: 28px;
transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg)
scale(1.4);
}
.vite {
z-index: 0;
top: 107px;
height: 26px;
width: auto;
transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg)
scale(0.8);
}
}
#center {
display: flex;
flex-direction: column;
gap: 25px;
place-content: center;
place-items: center;
flex-grow: 1;
@media (max-width: 1024px) {
padding: 32px 20px 24px;
gap: 18px;
}
}
#next-steps {
display: flex;
border-top: 1px solid var(--border);
text-align: left;
& > div {
flex: 1 1 0;
padding: 32px;
@media (max-width: 1024px) {
padding: 24px 20px;
}
}
.icon {
margin-bottom: 16px;
width: 22px;
height: 22px;
}
@media (max-width: 1024px) {
flex-direction: column;
text-align: center;
}
}
#docs {
border-right: 1px solid var(--border);
@media (max-width: 1024px) {
border-right: none;
border-bottom: 1px solid var(--border);
}
}
#next-steps ul {
list-style: none;
padding: 0;
display: flex;
gap: 8px;
margin: 32px 0 0;
.logo {
height: 18px;
}
a {
color: var(--text-h);
font-size: 16px;
border-radius: 6px;
background: var(--social-bg);
display: flex;
padding: 6px 12px;
align-items: center;
gap: 8px;
text-decoration: none;
transition: box-shadow 0.3s;
&:hover {
box-shadow: var(--shadow);
}
.button-icon {
height: 18px;
width: 18px;
}
}
@media (max-width: 1024px) {
margin-top: 20px;
flex-wrap: wrap;
justify-content: center;
li {
flex: 1 1 calc(50% - 8px);
}
a {
width: 100%;
justify-content: center;
box-sizing: border-box;
}
}
}
#spacer {
height: 88px;
border-top: 1px solid var(--border);
@media (max-width: 1024px) {
height: 48px;
}
}
.ticks {
position: relative;
width: 100%;
&::before,
&::after {
content: '';
position: absolute;
top: -4.5px;
border: 5px solid transparent;
}
&::before {
left: 0;
border-left-color: var(--border);
}
&::after {
right: 0;
border-right-color: var(--border);
}
}

121
src/App.jsx Normal file
View File

@@ -0,0 +1,121 @@
import React, { useState, useMemo, useEffect } from 'react';
import { Menu, Layers } from 'lucide-react';
import Sidebar from './components/Sidebar';
import EndpointViewer from './components/EndpointViewer';
import Introduction from './components/Introduction';
import ThemeToggle from './components/ThemeToggle';
import { graphqlTopics, GRAPHQL_BASE_URL } from './data/apiData';
import { restTopics, REST_BASE_URL } from './data/restTopics';
const processTopics = (topics, baseUrl, type) =>
topics.map(t => ({ ...t, baseUrl, type, uniqueId: `${type}-${t.id}` }));
const allGraphql = processTopics(graphqlTopics, GRAPHQL_BASE_URL, 'graphql');
const allRest = processTopics(restTopics, REST_BASE_URL, 'rest');
function filterTopics(topics, q) {
if (!q) return topics;
return topics.filter(t =>
t.name.toLowerCase().includes(q) ||
(t.description || '').toLowerCase().includes(q) ||
t.endpoints.some(e =>
e.name.toLowerCase().includes(q) ||
e.url.toLowerCase().includes(q) ||
(e.description || '').toLowerCase().includes(q)
)
);
}
function App() {
const [activeTopic, setActiveTopic] = useState(null);
const [searchQuery, setSearchQuery] = useState('');
const [sidebarOpen, setSidebarOpen] = useState(false);
const [dark, setDark] = useState(() => {
if (typeof window === 'undefined') return false;
const saved = localStorage.getItem('theme');
if (saved) return saved === 'dark';
return window.matchMedia('(prefers-color-scheme: dark)').matches;
});
useEffect(() => {
const root = document.documentElement;
root.classList.toggle('dark', dark);
localStorage.setItem('theme', dark ? 'dark' : 'light');
}, [dark]);
const q = searchQuery.trim().toLowerCase();
const visibleGraphql = useMemo(() => filterTopics(allGraphql, q), [q]);
const visibleRest = useMemo(() => filterTopics(allRest, q), [q]);
// On mobile, picking a topic should close the drawer
const selectTopic = (topic) => {
setActiveTopic(topic);
setSidebarOpen(false);
};
return (
<div className="min-h-screen bg-slate-50 dark:bg-dark-900 bg-grid-pattern flex relative overflow-hidden transition-colors duration-300">
{/* Ambient background glows */}
<div className="absolute top-0 -left-4 w-72 h-72 bg-brand-300 rounded-full mix-blend-multiply filter blur-3xl opacity-20 dark:opacity-10 animate-blob"></div>
<div className="absolute top-0 -right-4 w-72 h-72 bg-indigo-300 rounded-full mix-blend-multiply filter blur-3xl opacity-20 dark:opacity-10 animate-blob animation-delay-2000"></div>
<div className="absolute -bottom-8 left-20 w-72 h-72 bg-pink-300 rounded-full mix-blend-multiply filter blur-3xl opacity-20 dark:opacity-10 animate-blob animation-delay-4000"></div>
{/* Mobile top bar */}
<header className="lg:hidden fixed top-0 left-0 right-0 h-16 z-30 glass flex items-center justify-between px-4">
<div className="flex items-center gap-2.5 text-slate-900 dark:text-slate-100 font-bold text-lg">
<div className="w-7 h-7 rounded-lg bg-gradient-to-br from-brand-500 to-indigo-600 flex items-center justify-center shadow-glow">
<Layers className="text-white w-3.5 h-3.5" />
</div>
<span className="tracking-tight">NearleDaily</span>
</div>
<button
onClick={() => setSidebarOpen(true)}
aria-label="Open navigation menu"
className="w-10 h-10 -mr-1 flex items-center justify-center rounded-lg text-slate-600 dark:text-slate-300 hover:bg-slate-100/60 dark:hover:bg-white/5 transition-colors"
>
<Menu size={22} />
</button>
</header>
{/* Mobile drawer backdrop */}
{sidebarOpen && (
<div
onClick={() => setSidebarOpen(false)}
className="lg:hidden fixed inset-0 z-30 bg-slate-900/40 backdrop-blur-sm"
/>
)}
<Sidebar
graphqlTopics={visibleGraphql}
restTopics={visibleRest}
activeTopic={activeTopic}
setActiveTopic={selectTopic}
searchQuery={searchQuery}
setSearchQuery={setSearchQuery}
open={sidebarOpen}
onClose={() => setSidebarOpen(false)}
/>
<ThemeToggle dark={dark} setDark={setDark} />
<main className="lg:ml-[280px] flex-1 min-h-screen relative z-10 pt-16 lg:pt-0">
{activeTopic ? (
<div className="max-w-[1200px] mx-auto p-5 sm:p-8 lg:p-16 opacity-0 animate-fade-in-up">
<EndpointViewer topic={activeTopic} />
</div>
) : (
<div className="opacity-0 animate-fade-in-up">
<Introduction
allGraphql={allGraphql}
allRest={allRest}
setActiveTopic={selectTopic}
/>
</div>
)}
</main>
</div>
);
}
export default App;

BIN
src/assets/hero.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/assets/nearle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

1
src/assets/react.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

1
src/assets/vite.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@@ -0,0 +1,364 @@
import React, { useState, useEffect } from 'react';
import { Play, FileJson, Server, CheckCircle2, AlertCircle, Copy, Check, Loader2 } from 'lucide-react';
import { graphqlMeta } from '../data/apiData';
import { highlightJSON } from '../lib/highlight';
function safeDecode(v) {
try { return decodeURIComponent(v); } catch { return v; }
}
function parseUrlParams(url) {
const [, query = ''] = url.split('?');
const params = {};
if (query) {
for (const pair of query.split('&')) {
const [name, value = ''] = pair.split('=');
if (name) params[name] = safeDecode(value);
}
}
return params;
}
function EndpointRow({ endpoint, topic }) {
const isRest = topic.type === 'rest';
const meta = !isRest ? graphqlMeta[endpoint.name] : null;
const [queryText, setQueryText] = useState(meta?.query || '');
const [variablesText, setVariablesText] = useState(meta?.variables || '{}');
const [params, setParams] = useState(() => parseUrlParams(endpoint.url));
const [result, setResult] = useState(null);
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState(null);
const [copied, setCopied] = useState(false);
useEffect(() => {
setQueryText(meta?.query || '');
setVariablesText(meta?.variables || '{}');
setParams(parseUrlParams(endpoint.url));
setResult(null);
setError(null);
}, [endpoint.name]);
const copyResponse = async () => {
if (!result) return;
try {
await navigator.clipboard.writeText(JSON.stringify(result.data, null, 2));
setCopied(true); setTimeout(() => setCopied(false), 1500);
} catch {}
};
const execute = async () => {
setError(null);
setIsLoading(true);
setResult(null);
try {
if (isRest) {
// REST: fetch directly (fiesta.nearle.app supports CORS)
const path = endpoint.url.split('?')[0];
const isGet = endpoint.method === 'GET';
let url = topic.baseUrl + endpoint.url;
if (isGet && Object.keys(params).length > 0) {
const qs = new URLSearchParams(params).toString();
url = topic.baseUrl + path + (qs ? '?' + qs : '');
}
const options = {
method: endpoint.method,
headers: { 'Content-Type': 'application/json' },
};
if (!isGet && endpoint.body) {
options.body = typeof endpoint.body === 'string'
? endpoint.body
: JSON.stringify(endpoint.body);
}
const res = await fetch(url, options);
const text = await res.text();
let data;
try { data = JSON.parse(text); } catch { data = text; }
setResult({ status: res.status, ok: res.ok, data });
} else {
// GraphQL / Hasura
const base = topic.baseUrl;
let requestUrl = base + endpoint.url;
const options = {
method: endpoint.method,
headers: {
'x-hasura-admin-secret': 'nearle-admin-secret',
'Content-Type': 'application/json',
},
};
if (endpoint.method === 'GET' && !endpoint.useGraphql) {
const emptyKeys = Object.entries(params).filter(([, v]) => String(v).trim() === '').map(([k]) => k);
if (emptyKeys.length) {
setError('Required parameter(s): ' + emptyKeys.join(', '));
setIsLoading(false);
return;
}
const path = endpoint.url.split('?')[0];
const qs = new URLSearchParams(params).toString();
requestUrl = base + path + (qs ? '?' + qs : '');
} else {
const parsedVars = variablesText?.trim() ? JSON.parse(variablesText) : {};
requestUrl = base + '/v1/graphql';
options.method = 'POST';
options.body = JSON.stringify({ query: queryText, variables: parsedVars });
}
const res = await fetch(requestUrl, options);
const data = await res.json();
setResult({ status: res.status, ok: res.ok, data });
}
} catch (err) {
setError(String(err));
} finally {
setIsLoading(false);
}
};
const methodColor = {
GET: 'bg-emerald-100/50 text-emerald-700 border-emerald-200',
POST: 'bg-blue-100/50 text-blue-700 border-blue-200',
PUT: 'bg-amber-100/50 text-amber-700 border-amber-200',
DELETE: 'bg-red-100/50 text-red-700 border-red-200',
PATCH: 'bg-purple-100/50 text-purple-700 border-purple-200',
}[endpoint.method] || 'bg-slate-100/50 text-slate-700 border-slate-200';
const urlPath = endpoint.url.split('?')[0];
return (
<div className="py-10 sm:py-16 border-t border-slate-200/60 dark:border-white/10 group/row" id={endpoint.name}>
<div className="grid grid-cols-1 xl:grid-cols-12 gap-8 lg:gap-16">
{/* Left Column: Description & Parameters */}
<div className="xl:col-span-5 space-y-8">
<div>
<div className="flex items-center gap-4 mb-4">
<span className={`px-2.5 py-1 rounded text-xs font-bold tracking-widest border ${methodColor}`}>
{endpoint.method}
</span>
<h3 className="text-xl sm:text-2xl font-bold text-slate-900 dark:text-slate-100 tracking-tight break-all">
{endpoint.name}
</h3>
</div>
<p className="text-[15px] text-slate-600 dark:text-slate-400 leading-relaxed">{endpoint.description}</p>
</div>
<div className="bg-white dark:bg-dark-800 border border-slate-200/80 dark:border-white/10 rounded-xl p-3.5 font-mono text-sm shadow-sm flex items-start gap-2 group-hover/row:border-brand-300 dark:group-hover/row:border-brand-500/40 transition-colors min-w-0">
<Server size={14} className="text-brand-400 shrink-0 mt-0.5" />
<div className="min-w-0 flex-1">
<div className="text-xs text-slate-400 dark:text-slate-500 truncate">{topic.baseUrl}</div>
<div className="font-semibold text-slate-800 dark:text-slate-200 break-all">{urlPath}</div>
</div>
</div>
{/* Query params (GET endpoints) */}
{endpoint.method === 'GET' && Object.keys(params).length > 0 && (
<div className="pt-2">
<h4 className="text-xs font-bold text-slate-400 dark:text-slate-500 mb-4 uppercase tracking-widest flex items-center gap-2">
<span className="w-4 h-[1px] bg-slate-300 dark:bg-slate-600"></span> Query Parameters
</h4>
<div className="space-y-4">
{Object.entries(params).map(([key, val]) => (
<div key={key} className="flex flex-col gap-2">
<label className="text-sm font-semibold text-slate-800 dark:text-slate-200 flex justify-between items-center">
{key}
<span className="text-[10px] text-slate-400 dark:text-slate-500 uppercase tracking-wider font-mono">string</span>
</label>
<input
className="w-full px-3.5 py-2.5 bg-white dark:bg-white/5 border border-slate-200 dark:border-white/10 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-brand-500/20 focus:border-brand-500 transition-all shadow-sm text-slate-700 dark:text-slate-200"
value={val}
placeholder={`Enter ${key}...`}
onChange={e => {
const newVal = e.target.value;
setParams(p => ({ ...p, [key]: newVal }));
if (!isRest) {
try {
setVariablesText(JSON.stringify({
...JSON.parse(variablesText || '{}'),
[key]: isNaN(newVal) || newVal === '' ? newVal : Number(newVal)
}, null, 2));
} catch {}
}
}}
/>
</div>
))}
</div>
</div>
)}
</div>
{/* Right Column: Code Panel */}
<div className="xl:col-span-7">
<div className="dark-glass rounded-2xl overflow-hidden shadow-code flex flex-col h-full min-h-[360px] sm:min-h-[450px] transform transition-transform duration-500 group-hover/row:-translate-y-1">
{/* macOS window dots */}
<div className="h-10 bg-white/5 border-b border-white/5 flex items-center px-4 gap-2 shrink-0">
<div className="w-3 h-3 rounded-full bg-red-500/80"></div>
<div className="w-3 h-3 rounded-full bg-amber-500/80"></div>
<div className="w-3 h-3 rounded-full bg-emerald-500/80"></div>
<div className="ml-4 text-xs font-mono text-slate-500">Request Payload</div>
</div>
{/* Pane content */}
{meta ? (
// GraphQL editor: query + variables
<div className="flex-1 grid grid-cols-1 md:grid-cols-2 divide-y md:divide-y-0 md:divide-x divide-white/5">
<div className="p-5 flex flex-col group/pane relative">
<div className="text-[11px] font-bold text-slate-400 mb-3 uppercase tracking-wider flex items-center gap-2">
<FileJson size={14} className="text-brand-400" /> GraphQL Query
</div>
<textarea
className="flex-1 w-full bg-transparent text-slate-300 font-mono text-[13px] focus:outline-none resize-none leading-relaxed selection:bg-brand-500/30 scrollbar-hide"
value={queryText}
onChange={e => setQueryText(e.target.value)}
spellCheck="false"
/>
</div>
<div className="p-5 flex flex-col bg-white/[0.02]">
<div className="text-[11px] font-bold text-slate-400 mb-3 uppercase tracking-wider">Variables JSON</div>
<textarea
className="flex-1 w-full bg-transparent text-emerald-400 font-mono text-[13px] focus:outline-none resize-none leading-relaxed selection:bg-emerald-500/30 scrollbar-hide"
value={variablesText}
onChange={e => setVariablesText(e.target.value)}
spellCheck="false"
/>
</div>
</div>
) : endpoint.body ? (
// REST body JSON preview
<div className="flex-1 p-5 flex flex-col">
<div className="text-[11px] font-bold text-slate-400 mb-3 uppercase tracking-wider flex items-center gap-2">
<FileJson size={14} className="text-brand-400" /> Request Body (JSON)
</div>
<pre className="flex-1 text-slate-300 font-mono text-[13px] whitespace-pre-wrap leading-relaxed overflow-auto scrollbar-hide"
dangerouslySetInnerHTML={{ __html: highlightJSON(endpoint.body) }}
/>
</div>
) : (
// URL preview for no-body endpoints
<div className="flex-1 p-8 flex flex-col justify-start">
<div className="text-[11px] font-bold text-slate-400 mb-4 uppercase tracking-wider flex items-center gap-2">
<Server size={14} className="text-brand-400" /> Full Request URL
</div>
<div className="font-mono text-[13px] leading-loose break-all">
<span className={`font-bold mr-2 ${
endpoint.method === 'GET' ? 'text-emerald-400' :
endpoint.method === 'POST' ? 'text-blue-400' :
endpoint.method === 'PUT' ? 'text-amber-400' :
endpoint.method === 'DELETE' ? 'text-red-400' : 'text-purple-400'
}`}>{endpoint.method}</span>
<span className="text-slate-500">{topic.baseUrl}</span>
<span className="text-slate-200">{urlPath}</span>
{Object.keys(params).length > 0 && (
<>
<span className="text-pink-400">?</span>
{Object.entries(params).map(([k, v], i, arr) => (
<span key={k}>
<span className="text-brand-300">{k}</span>
<span className="text-slate-500">=</span>
<span className="text-slate-300">{encodeURIComponent(v)}</span>
{i < arr.length - 1 && <span className="text-slate-600">&</span>}
</span>
))}
</>
)}
</div>
</div>
)}
{/* Execution Bar */}
<div className="bg-black/40 p-4 flex justify-between items-center border-t border-white/5 backdrop-blur-md">
<span className="text-[12px] text-brand-400 font-mono px-3 py-1 bg-brand-500/10 rounded-full border border-brand-500/20">
Ready
</span>
<button
onClick={execute}
disabled={isLoading}
className="bg-brand-600 hover:bg-brand-500 text-white px-5 py-2 rounded-lg text-sm font-semibold transition-all flex items-center gap-2 disabled:opacity-50 shadow-[0_0_15px_rgba(2,132,199,0.4)] hover:shadow-[0_0_25px_rgba(2,132,199,0.6)] hover:-translate-y-0.5 active:translate-y-0"
>
{isLoading
? <div className="w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin" />
: <Play size={14} className="fill-current" />}
{isLoading ? 'Executing...' : 'Send Request'}
</button>
</div>
{/* Response Box */}
{(result || error) && (
<div className="border-t border-white/10 p-5 max-h-[350px] overflow-y-auto bg-black/60 relative">
<div className="sticky top-0 pb-3 mb-3 bg-black/60 backdrop-blur-md border-b border-white/5 flex items-center justify-between">
<span className="text-[11px] font-bold text-slate-400 uppercase tracking-wider">Response JSON</span>
<div className="flex items-center gap-3">
{result && (
<>
<span className={`text-[11px] px-2.5 py-1 rounded-md font-bold font-mono flex items-center gap-1.5 ${result.ok ? 'bg-emerald-500/20 text-emerald-400 border border-emerald-500/30' : 'bg-red-500/20 text-red-400 border border-red-500/30'}`}>
{result.ok ? <CheckCircle2 size={12} /> : <AlertCircle size={12} />}
{result.status}
</span>
<button
onClick={copyResponse}
className="flex items-center gap-1.5 text-[11px] font-bold uppercase tracking-widest text-slate-400 hover:text-brand-400 transition-colors"
>
{copied ? <Check size={12} /> : <Copy size={12} />}
{copied ? 'Copied' : 'Copy'}
</button>
</>
)}
</div>
</div>
{error ? (
<div className="text-red-400 font-mono text-[13px] leading-relaxed break-all">{error}</div>
) : typeof result?.data === 'string' ? (
<pre className="text-slate-300 font-mono text-[13px] whitespace-pre-wrap leading-relaxed">{result.data}</pre>
) : (
<pre
className="text-slate-300 font-mono text-[13px] whitespace-pre-wrap leading-relaxed"
dangerouslySetInnerHTML={{ __html: highlightJSON(result?.data) }}
/>
)}
</div>
)}
</div>
</div>
</div>
</div>
);
}
export default function EndpointViewer({ topic }) {
if (!topic) return null;
return (
<div className="pb-24">
<div className="mb-12">
<h1 className="text-3xl sm:text-4xl lg:text-5xl font-bold text-slate-900 dark:text-slate-100 mb-4 tracking-tight break-words">{topic.name}</h1>
<p className="text-base sm:text-lg text-slate-600 dark:text-slate-400 max-w-3xl leading-relaxed">{topic.description}</p>
<div className="mt-4 flex items-center gap-3">
<span className={`inline-flex items-center gap-1.5 text-[11px] font-bold uppercase tracking-widest px-3 py-1 rounded-full border ${
topic.type === 'graphql'
? 'bg-brand-50 dark:bg-brand-500/10 text-brand-600 dark:text-brand-400 border-brand-100 dark:border-brand-500/20'
: 'bg-indigo-50 dark:bg-indigo-500/10 text-indigo-600 dark:text-indigo-400 border-indigo-100 dark:border-indigo-500/20'
}`}>
<span className="w-1.5 h-1.5 rounded-full bg-current"></span>
{topic.type === 'graphql' ? 'GraphQL' : 'REST API'}
</span>
<span className="text-sm text-slate-400 dark:text-slate-500">{topic.endpoints.length} endpoint{topic.endpoints.length !== 1 ? 's' : ''}</span>
</div>
</div>
<div className="space-y-4">
{topic.endpoints.map(endpoint => (
<EndpointRow key={`${topic.uniqueId}/${endpoint.name}`} endpoint={endpoint} topic={topic} />
))}
</div>
</div>
);
}

View File

@@ -0,0 +1,103 @@
import React from 'react';
import { ArrowRight, Code2, Zap, Users, ShoppingCart, Home, Box, Link2, Truck, UserCircle, Bike, FileText, CreditCard, Wrench } from 'lucide-react';
import { GRAPHQL_BASE_URL } from '../data/apiData';
import { REST_BASE_URL } from '../data/restTopics';
const topicIcons = {
users: Users,
orders: ShoppingCart,
tenants: Home,
products: Box,
locations: Link2,
partners: Bike,
deliveries: Truck,
customers: UserCircle,
invoice: FileText,
payments: CreditCard,
utils: Wrench,
mobile: Box,
};
export default function Introduction({ allGraphql, allRest, setActiveTopic }) {
const allTopics = [...allGraphql, ...allRest];
return (
<div className="max-w-[1000px] mx-auto px-5 py-12 sm:px-12 sm:py-20 lg:px-24 lg:py-28">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-brand-50 dark:bg-brand-500/10 border border-brand-100 dark:border-brand-500/20 text-brand-600 dark:text-brand-400 text-sm font-medium mb-8">
<Zap size={14} className="fill-current" />
v2.0 Developer API
</div>
<h1 className="text-3xl sm:text-4xl lg:text-5xl font-bold text-slate-900 dark:text-slate-100 mb-6 tracking-tight">
<span className="text-gradient">NearleDaily API</span>
</h1>
<p className="text-lg sm:text-xl text-slate-600 dark:text-slate-400 mb-12 max-w-2xl leading-relaxed">
A comprehensive, lightning-fast platform designed for logistics, order management,
and multi-tenant POS administration available through both Hasura GraphQL and REST APIs.
</p>
<div className="mb-8">
<h2 className="text-xs font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500 mb-4">Base URLs</h2>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3 mb-10">
<div className="bg-white dark:bg-dark-800 border border-slate-200/60 dark:border-white/10 rounded-xl p-4 shadow-sm">
<div className="text-[11px] text-brand-600 dark:text-brand-400 font-bold uppercase tracking-widest mb-1.5">GraphQL</div>
<code className="font-mono text-sm text-slate-700 dark:text-slate-300 break-all">{GRAPHQL_BASE_URL}</code>
</div>
<div className="bg-white dark:bg-dark-800 border border-slate-200/60 dark:border-white/10 rounded-xl p-4 shadow-sm">
<div className="text-[11px] text-indigo-600 dark:text-indigo-400 font-bold uppercase tracking-widest mb-1.5">REST API</div>
<code className="font-mono text-sm text-slate-700 dark:text-slate-300 break-all">{REST_BASE_URL}</code>
</div>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
{allTopics.map((topic, index) => {
const Icon = topicIcons[topic.id] || Zap;
return (
<div
key={topic.uniqueId}
onClick={() => setActiveTopic(topic)}
className="group relative bg-white dark:bg-dark-800 p-6 rounded-2xl border border-slate-200/60 dark:border-white/10 shadow-sm hover:shadow-xl hover:shadow-brand-500/5 hover:border-brand-200 dark:hover:border-brand-500/30 transition-all duration-300 cursor-pointer overflow-hidden"
style={{ animationDelay: `${index * 80}ms` }}
>
<div className="absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-brand-50 dark:from-brand-500/10 to-transparent rounded-bl-full opacity-0 group-hover:opacity-100 transition-opacity duration-500"></div>
<div className="relative z-10">
<h3 className="text-lg font-bold text-slate-900 dark:text-slate-100 mb-2 group-hover:text-brand-600 dark:group-hover:text-brand-400 transition-colors flex items-center gap-2">
<div className="p-1.5 bg-brand-50 dark:bg-brand-500/10 text-brand-600 dark:text-brand-400 rounded-md group-hover:bg-brand-100 dark:group-hover:bg-brand-500/20 transition-colors">
<Icon size={18} />
</div>
{topic.name}
<ArrowRight size={16} className="opacity-0 -translate-x-4 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300 ml-auto" />
</h3>
<div className="flex items-center gap-2 mt-1 mb-2">
<span className={`text-[10px] font-bold uppercase tracking-widest px-2 py-0.5 rounded border ${
topic.type === 'graphql'
? 'bg-brand-50 dark:bg-brand-500/10 text-brand-600 dark:text-brand-400 border-brand-100 dark:border-brand-500/20'
: 'bg-indigo-50 dark:bg-indigo-500/10 text-indigo-600 dark:text-indigo-400 border-indigo-100 dark:border-indigo-500/20'
}`}>
{topic.type === 'graphql' ? 'GraphQL' : 'REST'}
</span>
<span className="text-[11px] text-slate-400 dark:text-slate-500">{topic.endpoints.length} endpoint{topic.endpoints.length !== 1 ? 's' : ''}</span>
</div>
<p className="text-sm text-slate-500 dark:text-slate-400 leading-relaxed">
{topic.description}
</p>
</div>
</div>
);
})}
</div>
<div className="mt-16 flex items-center gap-4 p-6 bg-slate-900 dark:bg-dark-700 text-slate-300 rounded-2xl shadow-code border border-transparent dark:border-white/5">
<Code2 className="text-brand-400 shrink-0" size={24} />
<p className="text-sm">
Explore real-time interactive endpoints. GraphQL requests are authenticated with the admin secret. REST endpoints support CORS and can be called directly from the browser.
</p>
</div>
</div>
);
}

122
src/components/Sidebar.jsx Normal file
View File

@@ -0,0 +1,122 @@
import React, { useState } from 'react';
import { Search, ChevronRight, ChevronDown, Layers, Terminal, Users, ShoppingCart, Home, Box, Link2, Truck, UserCircle, Bike, FileText, CreditCard, Wrench, X } from 'lucide-react';
const topicIcons = {
users: Users,
orders: ShoppingCart,
tenants: Home,
products: Box,
locations: Link2,
partners: Bike,
deliveries: Truck,
customers: UserCircle,
invoice: FileText,
payments: CreditCard,
utils: Wrench,
mobile: Box,
};
export default function Sidebar({ graphqlTopics, restTopics, activeTopic, setActiveTopic, searchQuery, setSearchQuery, open: drawerOpen = false, onClose }) {
const [open, setOpen] = useState({ general: true, graphql: true, rest: true });
const toggle = (key) => setOpen(prev => ({ ...prev, [key]: !prev[key] }));
const renderGroup = (topics, title, key) => (
<div>
<button
onClick={() => toggle(key)}
className="w-full flex items-center justify-between px-2 py-1.5 text-slate-800 dark:text-slate-200 font-semibold text-sm hover:text-brand-600 dark:hover:text-brand-400 transition-colors group"
>
<span className="tracking-wide text-xs uppercase text-slate-400 dark:text-slate-500 group-hover:text-brand-500 transition-colors">{title}</span>
{open[key] ? <ChevronDown size={14} className="text-slate-400 dark:text-slate-500" /> : <ChevronRight size={14} className="text-slate-400 dark:text-slate-500" />}
</button>
<div className={`mt-2 space-y-1 overflow-hidden transition-all duration-500 ${open[key] ? 'max-h-[800px] opacity-100' : 'max-h-0 opacity-0'}`}>
{topics.map(topic => {
const isActive = activeTopic?.uniqueId === topic.uniqueId;
const Icon = topicIcons[topic.id] || Layers;
return (
<button
key={topic.uniqueId}
onClick={() => setActiveTopic(topic)}
className={`w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-sm transition-all duration-200 group ${
isActive
? 'text-brand-700 dark:text-brand-300 bg-brand-50 dark:bg-brand-500/10 shadow-sm font-medium'
: 'text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-100 hover:bg-slate-100/50 dark:hover:bg-white/5'
}`}
>
<Icon size={16} className={`${isActive ? 'text-brand-500' : 'text-slate-400 dark:text-slate-500 group-hover:text-slate-500 dark:group-hover:text-slate-400'} transition-colors`} />
{topic.name}
</button>
);
})}
</div>
</div>
);
return (
<div className={`w-[280px] glass h-screen fixed top-0 left-0 flex flex-col z-40 transition-transform duration-300 lg:translate-x-0 ${drawerOpen ? 'translate-x-0' : '-translate-x-full'}`}>
{/* Brand Header */}
<div className="p-6 border-b border-slate-100/50 dark:border-white/5">
<div className="flex items-center justify-between mb-6">
<div className="flex items-center gap-3 text-slate-900 dark:text-slate-100 font-bold text-xl">
<div className="w-8 h-8 rounded-lg bg-gradient-to-br from-brand-500 to-indigo-600 flex items-center justify-center shadow-glow">
<Layers className="text-white w-4 h-4" />
</div>
<span className="tracking-tight">NearleDaily</span>
</div>
{/* Close button (mobile drawer only) */}
<button
onClick={onClose}
aria-label="Close navigation menu"
className="lg:hidden w-8 h-8 -mr-1 flex items-center justify-center rounded-lg text-slate-500 dark:text-slate-400 hover:bg-slate-100/60 dark:hover:bg-white/5 transition-colors"
>
<X size={18} />
</button>
</div>
<div className="relative group">
<Search className="w-4 h-4 absolute left-3 top-3 text-slate-400 group-focus-within:text-brand-500 transition-colors" />
<input
type="text"
className="w-full pl-9 pr-3 py-2.5 bg-slate-50/50 dark:bg-white/5 border border-slate-200/60 dark:border-white/10 rounded-xl text-sm text-slate-700 dark:text-slate-200 focus:outline-none focus:ring-2 focus:ring-brand-500/20 focus:border-brand-500 focus:bg-white dark:focus:bg-white/10 transition-all placeholder:text-slate-400 dark:placeholder:text-slate-500"
placeholder="Search documentation..."
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
/>
</div>
</div>
<div className="flex-1 overflow-y-auto py-6 px-4 scrollbar-hide">
<nav className="space-y-6">
{/* Getting Started */}
<div>
<button
onClick={() => toggle('general')}
className="w-full flex items-center justify-between px-2 py-1.5 text-slate-800 dark:text-slate-200 font-semibold text-sm hover:text-brand-600 dark:hover:text-brand-400 transition-colors group"
>
<span className="tracking-wide text-xs uppercase text-slate-400 dark:text-slate-500 group-hover:text-brand-500 transition-colors">Getting Started</span>
{open.general ? <ChevronDown size={14} className="text-slate-400 dark:text-slate-500" /> : <ChevronRight size={14} className="text-slate-400 dark:text-slate-500" />}
</button>
<div className={`mt-2 space-y-1 overflow-hidden transition-all duration-300 ${open.general ? 'max-h-40 opacity-100' : 'max-h-0 opacity-0'}`}>
<button
onClick={() => setActiveTopic(null)}
className={`w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-sm transition-all duration-200 ${
!activeTopic
? 'text-brand-700 dark:text-brand-300 bg-brand-50 dark:bg-brand-500/10 shadow-sm font-medium'
: 'text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-100 hover:bg-slate-100/50 dark:hover:bg-white/5'
}`}
>
<Terminal size={16} className={!activeTopic ? 'text-brand-500' : 'text-slate-400 dark:text-slate-500'} />
Introduction
</button>
</div>
</div>
{graphqlTopics.length > 0 && renderGroup(graphqlTopics, 'GraphQL', 'graphql')}
{restTopics.length > 0 && renderGroup(restTopics, 'REST API', 'rest')}
</nav>
</div>
</div>
);
}

View File

@@ -0,0 +1,21 @@
import React from 'react';
import { Sun, Moon } from 'lucide-react';
export default function ThemeToggle({ dark, setDark }) {
return (
<button
onClick={() => setDark(d => !d)}
aria-label={dark ? 'Switch to light theme' : 'Switch to dark theme'}
title={dark ? 'Light mode' : 'Dark mode'}
className="fixed top-3.5 right-16 lg:top-4 lg:right-4 z-50 w-11 h-11 rounded-full flex items-center justify-center
glass shadow-glass border border-slate-200/60 dark:border-white/10
text-slate-600 dark:text-slate-300 hover:text-brand-500 dark:hover:text-brand-400
hover:shadow-glow hover:-translate-y-0.5 active:translate-y-0
transition-all duration-300"
>
{dark
? <Sun size={18} className="transition-transform duration-300" />
: <Moon size={18} className="transition-transform duration-300" />}
</button>
);
}

1177
src/data/apiData.js Normal file

File diff suppressed because it is too large Load Diff

177
src/data/restTopics.js Normal file
View File

@@ -0,0 +1,177 @@
export const REST_BASE_URL = 'https://fiesta.nearle.app';
export const restTopics = [
{
"id": "utils",
"name": "Utils",
"description": "Shared lookup endpoints: app categories, subcategories, locations, app types, configs.",
"endpoints": [
{ "name": "Fetch application categories by tag (Web)", "method": "GET", "url": "/live/api/v1/web/utils/getapptypes?tag=customer", "description": "Fetch application categories by tag (Web)" },
{ "name": "Resolve subcategories (Web)", "method": "GET", "url": "/live/api/v1/web/utils/getsubcategories?moduleid=1&categoryid=2", "description": "Resolve subcategories (Web)" },
{ "name": "Fetch system active geofence details (Web)", "method": "GET", "url": "/live/api/v1/web/utils/getapplocations?applocationid=1", "description": "Fetch system active geofence details (Web)" },
{ "name": "Fetch global system categories configurations (Web)", "method": "GET", "url": "/live/api/v1/web/utils/getappcategories", "description": "Fetch global system categories configurations (Web)" },
{ "name": "Get mobile geofence configuration details (Mobile)", "method": "GET", "url": "/live/api/v1/mob/utils/getapplocationconfig?applocationid=1", "description": "Get mobile geofence configuration details (Mobile)" },
{ "name": "Get mobile active geofence details (Mobile)", "method": "GET", "url": "/live/api/v1/mob/utils/getapplocations?applocationid=1", "description": "Get mobile active geofence details (Mobile)" },
{ "name": "Fetch mobile app types by tag (Mobile)", "method": "GET", "url": "/live/api/v1/mob/utils/getapptypes?tag=rider", "description": "Fetch mobile app types by tag (Mobile)" },
{ "name": "Fetch global payment & geofence configs (Mobile)", "method": "GET", "url": "/live/api/v1/mob/utils/getappconfig?configid=1", "description": "Fetch global payment & geofence configs (Mobile)" },
{ "name": "Get mobile category subcategories list (Mobile)", "method": "GET", "url": "/live/api/v1/mob/utils/getsubcategories?moduleid=1&categoryid=2", "description": "Get mobile category subcategories list (Mobile)" },
{ "name": "Fetch mobile app categories configurations (Mobile)", "method": "GET", "url": "/live/api/v1/mob/utils/getappcategories", "description": "Fetch mobile app categories configurations (Mobile)" }
]
},
{
"id": "users",
"name": "Users",
"description": "Manage users, authentication, and roles across the platform.",
"endpoints": [
{ "name": "Get all users (Web)", "method": "GET", "url": "/live/api/v1/web/users/getallusers?roleid=2&tenantid=8&pageno=1&pagesize=10&keyword=john", "description": "Get all users (Web)" },
{ "name": "Get a specific user profile by ID (Web)", "method": "GET", "url": "/live/api/v1/web/users/getusers?userid=12", "description": "Get a specific user profile by ID (Web)" },
{ "name": "Get a specific user profile by ID (Mobile)", "method": "GET", "url": "/live/api/v1/mob/users/getusers?userid=15", "description": "Get a specific user profile by ID (Mobile)" },
{ "name": "Operator/User orders board (Web)", "method": "GET", "url": "/live/api/v1/web/orders/user/getorders?appuserid=12&status=processing&pageno=1&pagesize=10", "description": "Operator/User orders board (Web)" },
{ "name": "Tenant Web Panel Login", "method": "POST", "url": "/live/api/v1/web/users/tenant/weblogin", "description": "Tenant Web Panel Login", "body": { "authname": "merchant_admin_01", "password": "PasswordSecurityHash99!" } },
{ "name": "General Application Login", "method": "POST", "url": "/live/api/v1/web/users/applogin", "description": "General Application Login", "body": { "authname": "system_operator", "password": "OperatorSafePasswordSecret", "deviceid": "device_uuid_8828b", "devicetype": "android" } },
{ "name": "Register New Web Staff Account", "method": "POST", "url": "/live/api/v1/web/users/create", "description": "Register New Web Staff Account", "body": { "authname": "tenant_staff_steve", "firstname": "Steve", "lastname": "Rogers", "password": "SteveSecurePassword12", "email": "steve.rogers@merchant.com", "dialcode": "+61", "contactno": "412345678", "roleid": 3, "pin": 1234, "address": "100 Flinders St", "suburb": "Melbourne", "city": "Melbourne", "state": "VIC", "postcode": "3000", "tenantid": 8, "locationid": 2, "applocationid": 1, "status": "active" } },
{ "name": "Update Web Staff User Details", "method": "PUT", "url": "/live/api/v1/web/users/update", "description": "Update Web Staff User Details", "body": { "userid": 15, "firstname": "Steve", "lastname": "Captain", "email": "steve.captain@merchant.com", "contactno": "412345678", "address": "200 Flinders St", "suburb": "Melbourne", "city": "Melbourne", "state": "VIC", "postcode": "3000", "status": "active" } },
{ "name": "Rider/Merchant Mobile App Login", "method": "POST", "url": "/live/api/v1/mob/users/tenant/login", "description": "Rider/Merchant Mobile App Login", "body": { "authname": "rider_john_01", "password": "RiderSecretKey" } },
{ "name": "Create Mobile Staff User", "method": "POST", "url": "/live/api/v1/mob/users/create", "description": "Create Mobile Staff User", "body": { "authname": "tenant_staff_steve", "firstname": "Steve", "lastname": "Rogers", "password": "SteveSecurePassword12", "email": "steve.rogers@merchant.com", "dialcode": "+61", "contactno": "412345678", "roleid": 3, "pin": 1234, "tenantid": 8, "locationid": 2, "applocationid": 1, "status": "active" } },
{ "name": "Update Mobile Staff Details", "method": "PUT", "url": "/live/api/v1/mob/users/update", "description": "Update Mobile Staff Details", "body": { "userid": 15, "firstname": "Steve", "lastname": "Captain", "email": "steve.captain@merchant.com", "contactno": "412345678", "status": "active" } }
]
},
{
"id": "partners",
"name": "Partners",
"description": "Partners, riders, shifts, locations, and log sheets.",
"endpoints": [
{ "name": "Partner fleet orders board (Web)", "method": "GET", "url": "/live/api/v1/web/orders/partner/getorders?partnerid=1&status=processing&pageno=1&pagesize=10", "description": "Partner fleet orders board (Web)" },
{ "name": "Get active riders (Web)", "method": "GET", "url": "/live/api/v1/web/partners/getriders?partnerid=1&applocationid=1&userid=12&tenantid=8", "description": "Get active riders (Web)" },
{ "name": "Get partner profiles (Web)", "method": "GET", "url": "/live/api/v1/web/partners/getpartners?partnerid=1&applocationid=1&userid=12", "description": "Get partner profiles (Web)" },
{ "name": "Get rider shifts (Web)", "method": "GET", "url": "/live/api/v1/web/partners/getridershifts?applocationid=1", "description": "Get rider shifts (Web)" },
{ "name": "Get location configurations (Web)", "method": "GET", "url": "/live/api/v1/web/partners/getlocations?userid=12&configid=1", "description": "Get location configurations (Web)" },
{ "name": "Get rider log sheet (Web)", "method": "GET", "url": "/live/api/v1/web/partners/getriderlogs?partnerid=1&applocationid=1&fromdate=2026-05-20&todate=2026-05-20", "description": "Get rider log sheet (Web)" },
{ "name": "Get partner profiles (Mobile)", "method": "GET", "url": "/live/api/v1/mob/partners/getpartners?partnerid=1&applocationid=1&userid=12", "description": "Get partner profiles (Mobile)" },
{ "name": "Get rider log sheet (Mobile)", "method": "GET", "url": "/live/api/v1/mob/partners/getriderlogs?partnerid=1&applocationid=1&fromdate=2026-05-20&todate=2026-05-20", "description": "Get rider log sheet (Mobile)" },
{ "name": "Get rider operational info (Mobile)", "method": "GET", "url": "/live/api/v1/mob/partners/getriderinfo?userid=15", "description": "Get rider operational info (Mobile)" },
{ "name": "Get active riders list (Mobile)", "method": "GET", "url": "/live/api/v1/mob/partners/getriders?partnerid=1&applocationid=1&userid=15&tenantid=8", "description": "Get active riders list (Mobile)" }
]
},
{
"id": "tenants",
"name": "Tenants",
"description": "Tenant accounts, locations, customers, pricing, onboarding.",
"endpoints": [
{ "name": "Tenant orders board (Web)", "method": "GET", "url": "/live/api/v1/web/orders/tenant/getorders?tenantid=8&locationid=2&status=processing&pageno=1&pagesize=10", "description": "Tenant orders board (Web)" },
{ "name": "Get specific tenant store orders (Mobile)", "method": "GET", "url": "/live/api/v1/mob/orders/tenant/getorders?tenantid=8&locationid=2&pageno=1&pagesize=10", "description": "Get specific tenant store orders (Mobile)" },
{ "name": "Search registered tenants (Web)", "method": "GET", "url": "/live/api/v1/web/tenants/search?status=Active&keyword=Fresh", "description": "Search registered tenants (Web)" },
{ "name": "Search tenants by keyword (Web)", "method": "GET", "url": "/live/api/v1/web/tenants/searchbykeyword?keyword=daily", "description": "Search tenants by keyword (Web)" },
{ "name": "Get all active tenants catalog (Web)", "method": "GET", "url": "/live/api/v1/web/tenants/getalltenants?applocationid=1&status=Active&pageno=1&pagesize=10", "description": "Get all active tenants catalog (Web)" },
{ "name": "Get outlet locations assigned to a tenant (Web)", "method": "GET", "url": "/live/api/v1/web/tenants/gettenantlocations?tenantid=8", "description": "Get outlet locations assigned to a tenant (Web)" },
{ "name": "Retrieve delivery time slots config (Mobile)", "method": "GET", "url": "/live/api/v1/mob/tenants/gettenantslot", "description": "Retrieve delivery time slots config (Mobile)" },
{ "name": "Search tenants by keyword (Mobile)", "method": "GET", "url": "/live/api/v1/mob/tenants/searchbykeyword?keyword=grocery", "description": "Search tenants by keyword (Mobile)" },
{ "name": "Retrieve tenants associated with a customer (Mobile)", "method": "GET", "url": "/live/api/v1/mob/tenants/getcustomertenants?customerid=4082&tenant=0", "description": "Retrieve tenants associated with a customer (Mobile)" },
{ "name": "Get outlet locations linked to a tenant (Mobile)", "method": "GET", "url": "/live/api/v1/mob/tenants/gettenantlocations?tenantid=8", "description": "Get outlet locations linked to a tenant (Mobile)" },
{ "name": "Get logistics pricing slabs for a tenant (Mobile)", "method": "GET", "url": "/live/api/v1/mob/tenants/gettenantpricing?tenantid=8&applocationid=1", "description": "Get logistics pricing slabs for a tenant (Mobile)" },
{ "name": "Get staff members under a tenant store (Mobile)", "method": "GET", "url": "/live/api/v1/mob/tenants/getstaffs?tenantid=8", "description": "Get staff members under a tenant store (Mobile)" },
{ "name": "Get tenant detailed profile info (Mobile)", "method": "GET", "url": "/live/api/v1/mob/tenants/gettenantinfo?tenantid=8&locationid=2", "description": "Get tenant detailed profile info (Mobile)" },
{ "name": "Link Customer Profile to Tenant Store", "method": "POST", "url": "/live/api/v1/web/tenants/createtenantcustomer", "description": "Link Customer Profile to Tenant Store", "body": { "moduleid": 1, "tenantid": 8, "locationid": 2, "customerid": 4082, "customerlocationid": 554, "status": 1 } },
{ "name": "Create New Geofenced Store Location", "method": "POST", "url": "/live/api/v1/web/tenants/createlocation", "description": "Create New Geofenced Store Location", "body": { "tenantid": 8, "applocationid": 1, "moduleid": 1, "locationname": "Hawthorn Daily Fresh Store", "email": "hawthorn.store@merchant.com", "contactno": "399443322", "latitude": "-37.8222", "longitude": "145.0384", "address": "12 Glenferrie Rd", "suburb": "Hawthorn", "city": "Melbourne", "state": "VIC", "postcode": "3122", "opentime": "07:00:00", "closetime": "22:00:00", "partnerid": 1, "deliveryradius": 5000, "deliverymins": 30, "cancelsecs": 60, "status": "Active" } },
{ "name": "Update Store Location Configurations", "method": "PUT", "url": "/live/api/v1/web/tenants/updatelocation", "description": "Update Store Location Configurations", "body": { "locationid": 2, "tenantid": 8, "applocationid": 1, "locationname": "Richmond Daily Fresh Store", "email": "richmond.store@merchant.com", "contactno": "399887766", "latitude": "-37.8212", "longitude": "144.9984", "address": "Shop 4, 100 Church St", "suburb": "Richmond", "city": "Melbourne", "state": "VIC", "postcode": "3121", "opentime": "07:00:00", "closetime": "22:00:00", "deliveryradius": 8000, "deliverymins": 45, "cancelsecs": 120, "status": "Active" } },
{ "name": "Onboard New Tenant & Admin Profile", "method": "POST", "url": "/live/api/v1/mob/tenants/createtenantuser", "description": "Onboard New Tenant & Admin Profile (Joint Creation)", "body": { "tenantname": "Fresh Organic Greens", "configid": 1, "partnerid": 1, "moduleid": 1, "tenanttype": "Enterprise", "firstname": "Arthur", "primaryemail": "arthur@organicgreens.com", "primarycontact": "488999000", "categoryid": 2, "subcategoryid": 12, "address": "400 Chapel St", "suburb": "South Yarra", "city": "Melbourne", "state": "VIC", "postcode": "3141", "applocationid": 1, "approved": 1, "status": "Active" } }
]
},
{
"id": "customers",
"name": "Customers",
"description": "Customer accounts, addresses, support requests, and search.",
"endpoints": [
{ "name": "Fetch customer profile by ID or Contact (Mobile)", "method": "GET", "url": "/live/api/v1/mob/customers/getbyid?customerid=4082&contactno=9876543210", "description": "Fetch customer profile by ID or Contact (Mobile)" },
{ "name": "Get customer saved address locations (Mobile)", "method": "GET", "url": "/live/api/v1/mob/customers/getcustomerlocation?customerid=4082", "description": "Get customer saved address locations (Mobile)" },
{ "name": "Get customer logged support requests (Mobile)", "method": "GET", "url": "/live/api/v1/mob/customers/getcustomerrequests?customerid=4082&pageno=1&pagesize=10", "description": "Get customer logged support requests (Mobile)" },
{ "name": "Search customer names under a tenant (Mobile)", "method": "GET", "url": "/live/api/v1/mob/customers/search?keyword=Jane&tenantid=8", "description": "Search customer names under a tenant (Mobile)" },
{ "name": "Retrieve customers linked to a tenant location (Mobile)", "method": "GET", "url": "/live/api/v1/mob/customers/gettenantcustomers?tenantid=8&locationid=2&pageno=1&pagesize=10", "description": "Retrieve customers linked to a tenant location (Mobile)" },
{ "name": "Retrieve merchant customers list (Web)", "method": "GET", "url": "/live/api/v1/web/customers/gettenantcustomers?tenantid=8&locationid=2&pageno=1&pagesize=10&keyword=jane", "description": "Retrieve merchant customers list (Web)" },
{ "name": "Individual consumer invoice histories (Web)", "method": "GET", "url": "/live/api/v1/web/orders/customer/getorders?customerid=4082&status=delivered&pageno=1&pagesize=10", "description": "Individual consumer invoice histories (Web)" },
{ "name": "Passwordless OTP Login (via Phone)", "method": "POST", "url": "/live/api/v1/mob/customers/login", "description": "Passwordless OTP Login (via Phone)", "body": { "contactno": "0499888777" } },
{ "name": "Register Customer Account", "method": "POST", "url": "/live/api/v1/mob/customers/create", "description": "Register Customer Account", "body": { "firstname": "Jane", "lastname": "Smith", "gender": "Female", "dob": "1994-11-20", "dialcode": "+61", "contactno": "499888777", "email": "jane.smith@gmail.com", "deviceid": "uuid_7728b991a", "devicetype": "ios", "authmode": 1, "address": "456 Oak Avenue", "suburb": "Richmond", "city": "Melbourne", "state": "VIC", "postcode": "3121", "latitude": "-37.8212", "longitude": "144.9984", "applocationid": 1, "status": 1 } },
{ "name": "Save New Geofenced Location Address", "method": "POST", "url": "/live/api/v1/mob/customers/createlocations", "description": "Save New Geofenced Location Address", "body": { "customerid": 4082, "address": "123 High Street", "suburb": "Prahran", "city": "Melbourne", "state": "VIC", "postcode": "3181", "latitude": "-37.8502", "longitude": "144.9924", "primaryaddress": 1, "status": 1 } },
{ "name": "Log Customer Support Ticket Request", "method": "POST", "url": "/live/api/v1/mob/customers/createcustomerrequest", "description": "Log Customer Support Ticket Request", "body": { "customerid": 4082, "tenantid": 8, "apptypeid": 1, "locationid": 2, "subject": "Delay in Morning Milk Delivery", "remarks": "Order scheduled for 7:00 AM hasn't arrived.", "status": 1 } },
{ "name": "Update Customer Profile Details", "method": "PUT", "url": "/live/api/v1/mob/customers/update", "description": "Update Customer Profile Details", "body": { "customerid": 4082, "firstname": "Jane", "lastname": "Miller", "email": "jane.miller@gmail.com", "contactno": "499888777", "status": 1 } }
]
},
{
"id": "deliveries",
"name": "Deliveries",
"description": "Delivery dispatch, queues, summaries, and rider status tracking.",
"endpoints": [
{ "name": "Get deliveries performance summaries (Web)", "method": "GET", "url": "/live/api/v1/web/deliveries/deliverysummary?tenantid=8&partnerid=1&userid=12&applocationid=1&locationid=2&fromdate=2026-05-20&todate=2026-05-20", "description": "Get deliveries performance summaries (Web)" },
{ "name": "Get daily delivery insights (Web)", "method": "GET", "url": "/live/api/v1/web/deliveries/getdeliveryinsight?tenantid=8", "description": "Get daily delivery insights (Web)" },
{ "name": "Get location deliveries summary (Web)", "method": "GET", "url": "/live/api/v1/web/deliveries/getlocationsummary?tenantid=8", "description": "Get location deliveries summary (Web)" },
{ "name": "Get deliveries financial report summary (Web)", "method": "GET", "url": "/live/api/v1/web/deliveries/getreportsummary?tenantid=8&partnerid=1&userid=12&applocationid=1&fromdate=2026-05-01&todate=2026-05-20", "description": "Get deliveries financial report summary (Web)" },
{ "name": "Get fleet rider summary metrics (Web)", "method": "GET", "url": "/live/api/v1/web/deliveries/getridersummary?applocationid=1&partnerid=1&tenantid=8&fromdate=2026-05-20&todate=2026-05-20", "description": "Get fleet rider summary metrics (Web)" },
{ "name": "Get master deliveries board (Web)", "method": "GET", "url": "/live/api/v1/web/deliveries/getdeliveries?tenantid=8&fromdate=2026-05-20&todate=2026-05-20", "description": "Get master deliveries board (Web)" },
{ "name": "Get mobile dispatch summaries (Mobile)", "method": "GET", "url": "/live/api/v1/mob/deliveries/deliverysummary?userid=15&fromdate=2026-05-20&todate=2026-05-20", "description": "Get mobile dispatch summaries (Mobile)" },
{ "name": "Get mobile deliveries board (Mobile)", "method": "GET", "url": "/live/api/v1/mob/deliveries/getdeliveries?userid=15&status=assigned", "description": "Get mobile deliveries board (Mobile)" },
{ "name": "Fetch rider active shift deliveries queue (Mobile)", "method": "GET", "url": "/live/api/v1/mob/deliveries/getdeliveryqueues?userid=15&fromdate=2026-05-20&todate=2026-05-20", "description": "Fetch rider active shift deliveries queue (Mobile)" },
{ "name": "Initialize Logistics Delivery Dispatch (Assign Rider)", "method": "POST", "url": "/live/api/v1/web/deliveries/createdeliveries", "description": "Initialize Logistics Delivery Dispatch", "body": [{ "orderheaderid": 2100, "applocationid": 1, "partnerid": 1, "tenantid": 8, "moduleid": 1, "locationid": 2, "userid": 15, "orderid": "ORD-19028-4", "deliverydate": "2026-05-20", "orderstatus": "assigned", "assigntime": "2026-05-20 12:10:00", "itemcount": 2, "orderamount": 12.58, "customerid": 4082, "pickupcustomer": "Central Merchant Warehouse", "pickupcontactno": "987654321", "pickuplocationid": 2, "pickupaddress": "Shop 4, Central Plaza, Melbourne", "pickuplat": "-37.8136", "pickuplon": "144.9631", "deliverycustomerid": 4082, "deliverylocationid": 554, "deliverycustomer": "Jane Smith", "deliverycontactno": "499888777", "deliveryaddress": "456 Oak Avenue, Richmond, VIC, 3121", "droplat": "-37.8212", "droplon": "144.9984", "deliverycharges": 3, "deliveryamt": 15.58, "deliverytype": "standard", "paymenttype": 1 }] },
{ "name": "Update Rider Pickup Status", "method": "PUT", "url": "/live/api/v1/web/deliveries/updatedelivery", "description": "Update Rider Pickup Status", "body": { "deliveryid": 8871, "orderheaderid": 2100, "userid": 15, "orderstatus": "picked", "pickuptime": "2026-05-20 12:20:00", "riderslat": "-37.8140", "riderslon": "144.9640" } },
{ "name": "Rider Update Dispatch Status (Delivered)", "method": "PUT", "url": "/live/api/v1/mob/deliveries/updatedelivery", "description": "Rider Update Dispatch Status (Delivered & GPS Tracking)", "body": { "deliveryid": 8871, "orderheaderid": 2100, "userid": 15, "orderstatus": "delivered", "deliverytime": "2026-05-20 12:45:00", "riderslat": "-37.8210", "riderslon": "144.9980", "actualkms": "4.2", "feedback": "Handed over safely.", "smsdelivery": 1 } }
]
},
{
"id": "orders",
"name": "Orders",
"description": "Order boards, details, summaries, and status management.",
"endpoints": [
{ "name": "Filtered dynamic orders board (Web)", "method": "GET", "url": "/live/api/v1/web/orders/getorders?tenantid=8&locationid=2&status=processing&pageno=1&pagesize=10", "description": "Filtered dynamic orders board (Web)" },
{ "name": "System Admin orders board (Web)", "method": "GET", "url": "/live/api/v1/web/orders/admin/getorders?applocationid=1&status=processing&pageno=1&pagesize=10", "description": "System Admin orders board (Web)" },
{ "name": "Get order dashboard stats summary (Web)", "method": "GET", "url": "/live/api/v1/web/orders/getordersummary?tenantid=8&fromdate=2026-05-01&todate=2026-05-20", "description": "Get order dashboard stats summary (Web)" },
{ "name": "Get location orders summary (Web)", "method": "GET", "url": "/live/api/v1/web/orders/getlocationsummary?tenantid=8", "description": "Get location orders summary (Web)" },
{ "name": "Get annual orders insights analytics (Web)", "method": "GET", "url": "/live/api/v1/web/orders/getorderinsight?tenantid=8", "description": "Get annual orders insights analytics (Web)" },
{ "name": "Get order detailed lines (Web)", "method": "GET", "url": "/live/api/v1/web/orders/getorderdetails?orderheaderid=2099", "description": "Get order detailed lines (Web)" },
{ "name": "Get customer order history (Mobile)", "method": "GET", "url": "/live/api/v1/mob/orders/getcustomerorders?customerid=4082&pageno=1&pagesize=10", "description": "Get customer order history (Mobile)" },
{ "name": "Get mobile order detailed lines (Mobile)", "method": "GET", "url": "/live/api/v1/mob/orders/getorderdetails?orderheaderid=2099", "description": "Get mobile order detailed lines (Mobile)" },
{ "name": "Create New Web Order", "method": "POST", "url": "/live/api/v1/web/orders/createorder", "description": "Create New Web Order (Flat JSON Format)", "body": { "tenantid": 8, "locationid": 2, "applocationid": 1, "moduleid": 1, "customerid": 4082, "orderstatus": "pending", "deliverytype": "standard", "deliverytime": "2026-05-20 18:00:00", "pickupaddress": "Shop 4, Central Plaza, Melbourne", "pickuplat": "-37.8136", "pickuplong": "144.9631", "pickupcustomer": "Central Plaza Merchant", "pickupcontactno": "399887766", "deliveryaddress": "Apt 4B, Sunset Boulevard, Richmond", "deliverylat": "-37.8212", "deliverylong": "144.9984", "orderamount": 11.48, "taxamount": 1.1, "ordervalue": 12.58, "itemcount": 2, "paymenttype": 1, "paymentstatus": 0, "deliverycharge": 3, "items": [{ "productid": 105, "productname": "Organic Whole Milk 1L", "orderqty": 2, "price": 3.99, "taxpercentage": 10, "taxamount": 0.8, "productsumprice": 7.98 }] } },
{ "name": "Update Order Status & Financial Flag", "method": "PUT", "url": "/live/api/v1/web/orders/updateorder", "description": "Update Order Status & Financial Flag", "body": { "orderheaderid": 2099, "orderstatus": "ready", "paymentstatus": 1, "remarks": "Order packed and waiting for rider assignment." } },
{ "name": "Create Mobile Order", "method": "POST", "url": "/live/api/v1/mob/orders/createorder", "description": "Create Mobile Order (Wrapped JSON Format)", "body": { "orders": { "tenantid": 8, "locationid": 2, "applocationid": 1, "moduleid": 1, "customerid": 4082, "orderstatus": "pending", "deliverytype": "standard", "deliverytime": "2026-05-20 18:00:00", "pickupaddress": "Shop 4, Central Plaza, Melbourne", "orderamount": 11.48, "taxamount": 1.1, "ordervalue": 12.58, "itemcount": 2, "paymenttype": 1, "paymentstatus": 0, "deliverycharge": 3, "items": [{ "productid": 105, "productname": "Organic Whole Milk 1L", "orderqty": 2, "price": 3.99, "taxpercentage": 10, "taxamount": 0.8, "productsumprice": 7.98 }] } } },
{ "name": "Mobile Update Order Status", "method": "PUT", "url": "/live/api/v1/mob/orders/updateorder", "description": "Mobile Update Order Status", "body": { "orderheaderid": 2099, "orderstatus": "ready", "paymentstatus": 1, "remarks": "Order packed and waiting for rider assignment." } }
]
},
{
"id": "products",
"name": "Products",
"description": "Product catalog, stock management, variants, and outlet inventory.",
"endpoints": [
{ "name": "Get product subcategories (Web)", "method": "GET", "url": "/live/api/v1/web/products/getproductsubcategories?categoryid=2&tenantid=8", "description": "Get product subcategories (Web)" },
{ "name": "Get products stock counts (Web)", "method": "GET", "url": "/live/api/v1/web/products/getproductscount?tenantid=8&categoryid=2&subcategoryid=12&approve=1", "description": "Get products stock counts (Web)" },
{ "name": "Get all global categories (Web)", "method": "GET", "url": "/live/api/v1/web/products/getproductcategories", "description": "Get all global categories (Web)" },
{ "name": "Get specific product variants (Web)", "method": "GET", "url": "/live/api/v1/web/products/getproductvariants?tenantid=8&subcategoryid=12", "description": "Get specific product variants (Web)" },
{ "name": "Get master catalog listings (Web)", "method": "GET", "url": "/live/api/v1/web/products/getcatalougeproducts?tenantid=8&locationid=2&subcategoryid=12&keyword=&pageno=1&pagesize=10", "description": "Get master catalog listings (Web)" },
{ "name": "Get live stocks catalog (Web)", "method": "GET", "url": "/live/api/v1/web/products/getproductstocks?tenantid=8&locationid=2", "description": "Get live stocks catalog (Web)" },
{ "name": "Get dynamic stock statement ledger (Web)", "method": "GET", "url": "/live/api/v1/web/products/getstockstatement?tenantid=8&locationid=2&subcategoryid=12&pageno=1&pagesize=10&keyword=", "description": "Get dynamic stock statement ledger (Web)" },
{ "name": "Get outlet geofenced inventory (Web)", "method": "GET", "url": "/live/api/v1/web/products/getlocationproducts?tenantid=8&locationid=2&subcategoryid=12&pageno=1&pagesize=10", "description": "Get outlet geofenced inventory (Web)" },
{ "name": "Master products search board (Web)", "method": "GET", "url": "/live/api/v1/web/products/getallproducts?tenantid=8&locationid=2&keyword=milk&pageno=1&pagesize=10", "description": "Master products search board (Web)" },
{ "name": "Get product details by variant ID (Mobile)", "method": "GET", "url": "/live/api/v1/mob/products/getproductbyvariant?tenantid=8&variantid=4", "description": "Get product details by variant ID (Mobile)" },
{ "name": "Get product subcategories (Mobile)", "method": "GET", "url": "/live/api/v1/mob/products/getproductsubcategories?categoryid=2&tenantid=8", "description": "Get product subcategories (Mobile)" },
{ "name": "Search product catalog (Mobile)", "method": "GET", "url": "/live/api/v1/mob/products/getallproducts?keyword=milk&pageno=1&pagesize=10", "description": "Search product catalog (Mobile)" },
{ "name": "Get mobile geofenced outlet products (Mobile)", "method": "GET", "url": "/live/api/v1/mob/products/getlocationproducts?tenantid=8&locationid=2&pageno=1&pagesize=20", "description": "Get mobile geofenced outlet products (Mobile)" },
{ "name": "Add Multi-Product Stock Entry", "method": "POST", "url": "/live/api/v1/web/products/createproductstock", "description": "Add Multi-Product Stock Entry", "body": [{ "tenantid": 8, "locationid": 2, "productid": 105, "quantity": 150, "stocktype": "credit", "status": "active" }, { "tenantid": 8, "locationid": 2, "productid": 109, "quantity": 80, "stocktype": "credit", "status": "active" }] },
{ "name": "Create Master Product Catalog Item", "method": "POST", "url": "/live/api/v1/web/products/create", "description": "Create Master Product Catalog Item", "body": { "applocationid": 1, "tenantid": 8, "categoryid": 2, "subcategoryid": 12, "productname": "Fresh Cow Milk 1L", "productunit": "Litre", "unitvalue": "1", "productcost": 1.8, "retailprice": 3.5, "taxpercent": 5, "productstock": 100, "productstatus": "available", "approve": 1 } },
{ "name": "Update Master Product Details", "method": "PUT", "url": "/live/api/v1/web/products/update", "description": "Update Master Product Details", "body": { "productid": 105, "productname": "Organic Farm Cow Milk 1L", "productcost": 1.95, "retailprice": 3.75, "productstock": 120, "productstatus": "available" } },
{ "name": "Purge Master Product Catalog Entry", "method": "DELETE", "url": "/live/api/v1/web/products/delete?productid=105", "description": "Purge Master Product Catalog Entry" }
]
},
{
"id": "invoice",
"name": "Invoice",
"description": "Invoice insights and billing analytics.",
"endpoints": [
{ "name": "Get invoice insights for a tenant", "method": "GET", "url": "/live/api/v1/web/invoice/getinvoiceinsight?tenantid=8", "description": "Retrieve invoice insights and statistics for a tenant." }
]
},
{
"id": "payments",
"name": "Payments",
"description": "Payment requests and settlement records.",
"endpoints": [
{ "name": "Get payment requests for a partner", "method": "GET", "url": "/live/api/v1/web/payments/requests/getpaymentrequest?partnerid=44&status=1", "description": "List payment requests for a partner by status." }
]
}
];

71
src/index.css Normal file
View File

@@ -0,0 +1,71 @@
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
body {
@apply bg-slate-50 text-slate-800 font-sans antialiased selection:bg-brand-500/30 selection:text-brand-900;
}
html.dark body {
@apply bg-dark-900 text-slate-300 selection:bg-brand-500/30 selection:text-brand-100;
}
}
@layer utilities {
.glass {
@apply bg-white/70 backdrop-blur-md border border-white/40 shadow-glass;
}
html.dark .glass {
@apply bg-dark-800/80 border-white/5;
}
.dark-glass {
@apply bg-dark-900/90 backdrop-blur-xl border border-white/5;
}
.text-gradient {
@apply bg-clip-text text-transparent bg-gradient-to-r from-brand-600 to-indigo-600;
}
}
/* Stunning custom scrollbar */
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
@apply bg-slate-200 rounded-full hover:bg-slate-300 transition-colors;
}
.dark-pane ::-webkit-scrollbar-thumb {
@apply bg-slate-700 hover:bg-slate-600;
}
html.dark ::-webkit-scrollbar-thumb {
@apply bg-dark-600 hover:bg-slate-600;
}
/* Background Pattern */
.bg-grid-pattern {
background-image: linear-gradient(to right, #f1f5f9 1px, transparent 1px),
linear-gradient(to bottom, #f1f5f9 1px, transparent 1px);
background-size: 40px 40px;
}
html.dark .bg-grid-pattern {
background-image: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}
/* Hide scrollbar utility (used in sidebar / panes) */
.scrollbar-hide {
-ms-overflow-style: none;
scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
display: none;
}

26
src/lib/highlight.js Normal file
View File

@@ -0,0 +1,26 @@
const TOKEN = /("(?:\\u[a-fA-F0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?(?:[eE][+\-]?\d+)?)/g
function escapeHtml(s) {
return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
}
export function highlightJSON(value) {
let text
try {
text = JSON.stringify(value, null, 2)
} catch {
text = String(value)
}
if (typeof text !== 'string') text = String(text)
return escapeHtml(text).replace(TOKEN, (match) => {
let cls = 'text-amber-300'
if (/^"/.test(match)) {
cls = /:$/.test(match) ? 'text-sky-300' : 'text-emerald-300'
} else if (match === 'true' || match === 'false') {
cls = 'text-violet-300'
} else if (match === 'null') {
cls = 'text-rose-300'
}
return `<span class="${cls}">${match}</span>`
})
}

6
src/lib/utils.js Normal file
View File

@@ -0,0 +1,6 @@
import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs) {
return twMerge(clsx(inputs));
}

10
src/main.jsx Normal file
View File

@@ -0,0 +1,10 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App.jsx'
createRoot(document.getElementById('root')).render(
<StrictMode>
<App />
</StrictMode>,
)

59
tailwind.config.js Normal file
View File

@@ -0,0 +1,59 @@
/** @type {import('tailwindcss').Config} */
export default {
darkMode: 'class',
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {
fontFamily: {
sans: ['Inter', 'system-ui', 'sans-serif'],
mono: ['Fira Code', 'monospace'],
},
colors: {
brand: {
50: '#f0f9ff',
100: '#e0f2fe',
200: '#bae6fd',
300: '#7dd3fc',
400: '#38bdf8',
500: '#0ea5e9',
600: '#0284c7',
700: '#0369a1',
800: '#075985',
900: '#0c4a6e',
950: '#082f49',
},
dark: {
900: '#0A0A0B',
800: '#141415',
700: '#1C1C1F',
600: '#27272A',
}
},
boxShadow: {
'glow': '0 0 20px rgba(14, 165, 233, 0.15)',
'glass': '0 4px 30px rgba(0, 0, 0, 0.05)',
'code': '0 20px 40px -10px rgba(0,0,0,0.4)',
},
animation: {
'blob': 'blob 7s infinite',
'fade-in-up': 'fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards',
},
keyframes: {
blob: {
'0%': { transform: 'translate(0px, 0px) scale(1)' },
'33%': { transform: 'translate(30px, -50px) scale(1.1)' },
'66%': { transform: 'translate(-20px, 20px) scale(0.9)' },
'100%': { transform: 'translate(0px, 0px) scale(1)' },
},
fadeInUp: {
'0%': { opacity: '0', transform: 'translateY(20px)' },
'100%': { opacity: '1', transform: 'translateY(0)' },
}
}
},
},
plugins: [],
}

39
test_portal.py Normal file
View File

@@ -0,0 +1,39 @@
import urllib.request
import urllib.error
import time
URL = "https://developer.nearledaily.com/"
def test_portal():
print(f"Testing connectivity to {URL}...\n")
try:
start_time = time.time()
# Send a standard GET request with a user-agent
req = urllib.request.Request(URL, headers={'User-Agent': 'Mozilla/5.0'})
with urllib.request.urlopen(req) as response:
status_code = response.getcode()
html = response.read().decode('utf-8')
duration = round((time.time() - start_time) * 1000, 2)
if status_code == 200:
print(f"[SUCCESS] Server responded with HTTP 200 OK in {duration}ms!")
# Check for specific title tags or branding we added
if "NearleDaily API" in html or "nearledaily-docs" in html.lower() or "nearledaily" in html.lower():
print("[SUCCESS] Found NearleDaily branding in the page HTML. The app is serving the correct files!")
else:
print("[WARNING] Server responded with 200 OK, but couldn't find the expected React app HTML.")
else:
print(f"[ERROR] Server responded with unexpected status code: {status_code}")
except urllib.error.HTTPError as e:
print(f"[HTTP ERROR] The server responded, but returned an error status code: {e.code}")
except urllib.error.URLError as e:
print(f"[NETWORK ERROR] Failed to reach the server. Reason: {e.reason}")
print("Hint: If you just changed the DNS or Coolify port, wait a minute for it to apply/propagate.")
except Exception as e:
print(f"[UNEXPECTED ERROR] {str(e)}")
if __name__ == "__main__":
test_portal()

7
vite.config.js Normal file
View File

@@ -0,0 +1,7 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
})