Skip to content

Commit d045de5

Browse files
committed
Update project tracker example and API reference UI
Added development and contributing instructions to README. Changed project tracker example to use 'objectql serve' for starting the API server and moved the seed script to a separate file. Updated the API reference UI in the CLI serve command to use Scalar instead of Swagger UI.
1 parent bcb22ee commit d045de5

File tree

4 files changed

+58
-23
lines changed

4 files changed

+58
-23
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,44 @@ For a complete status report on ObjectQL's implementation against the documented
260260

261261
---
262262

263+
## 🛠️ Development & Contributing
264+
265+
If you fork or clone the repository to contribute or run examples from source:
266+
267+
1. **Setup Workspace**
268+
```bash
269+
git clone https://github.com/objectql/objectql.git
270+
cd objectql
271+
npm install -g pnpm
272+
pnpm install
273+
```
274+
275+
2. **Build Packages**
276+
You must build the core libraries before running examples, as they rely on local workspace builds.
277+
```bash
278+
pnpm build
279+
```
280+
281+
3. **Run Examples**
282+
283+
These examples run as **scripts** to demonstrate the ObjectQL Core Engine capabilities (Validation, CRUD, Logic Hooks). They use an in-memory SQLite database.
284+
285+
**Starter (Project Tracker):**
286+
```bash
287+
# Starts the API Server (http://localhost:3000)
288+
pnpm --filter @objectql/example-project-tracker start
289+
290+
# Note: Sample data (projects.data.yml) is automatically loaded on startup
291+
```
292+
293+
**Enterprise ERP:**
294+
```bash
295+
pnpm --filter @objectql/example-enterprise-erp start
296+
# Output: Plugin initialization, Employee creation logs, Audit trails
297+
```
298+
299+
---
300+
263301
## ⚖️ License
264302

265303
ObjectQL is open-source software licensed under the [MIT License](https://www.google.com/search?q=LICENSE).

examples/showcase/project-tracker/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"dist"
2525
],
2626
"scripts": {
27-
"start": "ts-node src/index.ts",
27+
"start": "objectql serve --dir src",
28+
"seed": "ts-node src/seed.ts",
2829
"codegen": "objectql generate -s src -o src/types",
2930
"build": "npm run codegen && tsc && rsync -a --include '*/' --include '*.yml' --exclude '*' src/ dist/",
3031
"repl": "objectql repl",
File renamed without changes.

packages/tools/cli/src/commands/serve.ts

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,24 @@ import chalk from 'chalk';
99

1010
const CONSOLE_HTML = `
1111
<!DOCTYPE html>
12-
<html lang="en">
13-
<head>
14-
<meta charset="utf-8" />
15-
<meta name="viewport" content="width=device-width, initial-scale=1" />
16-
<title>ObjectQL Swagger UI</title>
17-
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5.11.0/swagger-ui.css" />
18-
<style>
19-
body { margin: 0; padding: 0; }
20-
</style>
21-
</head>
22-
<body>
23-
<div id="swagger-ui"></div>
24-
<script src="https://unpkg.com/swagger-ui-dist@5.11.0/swagger-ui-bundle.js" crossorigin></script>
25-
<script>
26-
window.onload = () => {
27-
window.ui = SwaggerUIBundle({
28-
url: '/openapi.json',
29-
dom_id: '#swagger-ui',
30-
});
31-
};
32-
</script>
33-
</body>
12+
<html>
13+
<head>
14+
<title>ObjectQL API Reference (Scalar)</title>
15+
<meta charset="utf-8" />
16+
<meta name="viewport" content="width=device-width, initial-scale=1" />
17+
<style>
18+
body { margin: 0; }
19+
</style>
20+
</head>
21+
<body>
22+
<script
23+
id="api-reference"
24+
data-url="/openapi.json"
25+
data-proxy-url="https://proxy.scalar.com"
26+
data-configuration='{"theme": "deepSpace"}'
27+
></script>
28+
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
29+
</body>
3430
</html>
3531
`;
3632

0 commit comments

Comments
 (0)