Skip to content

Commit f681d1d

Browse files
committed
wip
1 parent b77c742 commit f681d1d

125 files changed

Lines changed: 11900 additions & 2939 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@
6363
"**/test-dist": true,
6464
"**/.output": true,
6565
"**/.data": true,
66+
"apps/docs": true,
67+
"apps/learn": true,
68+
"apps/netlogo": true,
69+
"apps/nettango": true
6670
},
6771

6872
"cSpell.words": ["autogen", "iconify", "netlogo", "Nuxt", "Pathnames", "reka", "vueuse"]

AGENTS.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# AGENTS.md
2+
3+
This file guides Codex (Codex.ai/code) when working with code in this repository. This is a monorepo with multiple applications, so the instructions here are meant to help Codex understand the structure and conventions of the codebase. Each application or package may have its own AGENTS.md file with more specific instructions.
4+
5+
Package Manager: Yarn
6+
Repo Manager: Turborepo
7+
Node Version: 24.x (LTS)
8+
9+
## Comments
10+
- Avoid unnecessary comments. Always write code that is self-explanatory.
11+
- Avoid decorative comments that do not add value. If a comment is needed, ensure it provides meaningful context or explanations that cannot be easily inferred from the code itself.
12+
13+
## Dev Servers
14+
- Do not start dev servers
15+
16+
## Updating files
17+
- If you make a critical decision, add it to .Codex/DECISIONS.md

apps/modeling-commons-backend/.env.example

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ POSTGRES_DB=test
77
POSTGRES_URL=127.0.0.1:5432
88
DATABASE_URL=postgresql://admin:test@127.0.0.1:5432/test
99

10+
REDIS_HOST=127.0.0.1
11+
REDIS_PORT=6379
12+
REDIS_URL=redis://127.0.0.1:6379
13+
14+
RUSTFS_ENDPOINT=http://127.0.0.1:41090
15+
RUSTFS_CONSOLE_URL=http://127.0.0.1:9001
16+
RUSTFS_ACCESS_KEY=rustfsadmin
17+
RUSTFS_SECRET_KEY=rustfsadmin
18+
RUSTFS_REGION=us-east-1
19+
RUSTFS_BUCKET=modeling-commons
20+
21+
GALAPAGOS_ENDPOINT=http://localhost:9000
22+
NETLOGO_SERVICES_ENDPOINT=http://localhost:51090
23+
1024
PRODUCT_NAME="Modeling Commons"
1125
PRODUCT_DESCRIPTION="A platform for sharing and discovering NetLogo models."
1226
PRODUCT_KEYWORDS="netlogo,modeling,commons,simulation,agent-based,platform,constructionism,education,science,open-source"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Modeling Commons Backend
2+
3+
## Development Setup
4+
1. Install Helio (see [Helio README](../../README.md)).
5+
2. Install [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/).
6+
3. Run docker services (see below) or set up the required services locally and update the `.env` file with the appropriate connection information.
7+
4. Start the development server
8+
9+
```bash
10+
yarn run app
11+
```
12+
13+
### Docker
14+
Docker compose is used to run the required services for development. To start the services, run:
15+
```bash
16+
docker compose -f docker-compose.dev.yml up
17+
```
18+
19+
or with optional services
20+
```bash
21+
docker compose -f docker-compose.dev.yml [--profile <profile-name>] up
22+
```
23+
24+
Available profiles are found in the `docker-compose.dev.yml` file. By default, only the required services are started. For example, to start the cache and lambda services, run:
25+
```bash
26+
docker compose -f docker-compose.dev.yml --profile cache --profile lambda up
27+
```
28+
29+
#### Services
30+
| Service | Description | Optional | Notes | Requires Authentication |
31+
|---------|-------------|----------|-------|-------------------------|
32+
| PostgreSQL | Relational Database | No | | No |
33+
| RustFS | Object Storage | No | | No |
34+
| Redis | In-memory Cache | Yes | | No |
35+
| Galapagos | NetLogo Web Instance | Yes | Frontend .nlogox files runtime | Yes |
36+
| `netlogo-services` | NetLogo Desktop Lambda Functions | Yes | Used to generate thumbnails | Yes |
37+
38+
To authenticate Docker, use the following command
39+
```bash
40+
gh auth refresh -h github.com -s read:packages
41+
gh auth token | docker login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdin
42+
```

apps/modeling-commons-backend/client/rest.d.ts

Lines changed: 82 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export interface paths {
117117
sizeBytes: number;
118118
/** Format: date-time */
119119
createdAt: string;
120+
downloadUrl: string;
120121
};
121122
};
122123
};
@@ -139,7 +140,9 @@ export interface paths {
139140
};
140141
get: {
141142
parameters: {
142-
query?: never;
143+
query?: {
144+
token?: string;
145+
};
143146
header?: never;
144147
path: {
145148
id: string;
@@ -179,7 +182,6 @@ export interface paths {
179182
limit?: number;
180183
/** @description Page number */
181184
page?: number;
182-
visibility?: "public" | "private" | "unlisted";
183185
tag?: string;
184186
authorId?: string;
185187
parentModelId?: string;
@@ -235,9 +237,9 @@ export interface paths {
235237
*/
236238
updatedAt: string;
237239
}) & {
238-
latestVersionId: string | null;
240+
latestVersionNumber: number | null;
239241
parentModelId: string | null;
240-
parentVersionId: string | null;
242+
parentVersionNumber: number | null;
241243
/** @description public | private | unlisted */
242244
visibility: string;
243245
isEndorsed: boolean;
@@ -265,8 +267,7 @@ export interface paths {
265267
visibility?: "public" | "private" | "unlisted";
266268
/** Format: uuid */
267269
parentModelId?: string;
268-
/** Format: uuid */
269-
parentVersionId?: string;
270+
parentVersionNumber?: number;
270271
};
271272
};
272273
};
@@ -338,9 +339,9 @@ export interface paths {
338339
*/
339340
updatedAt: string;
340341
}) & {
341-
latestVersionId: string | null;
342+
latestVersionNumber: number | null;
342343
parentModelId: string | null;
343-
parentVersionId: string | null;
344+
parentVersionNumber: number | null;
344345
/** @description public | private | unlisted */
345346
visibility: string;
346347
isEndorsed: boolean;
@@ -416,7 +417,6 @@ export interface paths {
416417
limit?: number;
417418
/** @description Page number */
418419
page?: number;
419-
visibility?: "public" | "private" | "unlisted";
420420
tag?: string;
421421
authorId?: string;
422422
parentModelId?: string;
@@ -474,9 +474,9 @@ export interface paths {
474474
*/
475475
updatedAt: string;
476476
}) & {
477-
latestVersionId: string | null;
477+
latestVersionNumber: number | null;
478478
parentModelId: string | null;
479-
parentVersionId: string | null;
479+
parentVersionNumber: number | null;
480480
/** @description public | private | unlisted */
481481
visibility: string;
482482
isEndorsed: boolean;
@@ -504,7 +504,7 @@ export interface paths {
504504
get: {
505505
parameters: {
506506
query?: {
507-
taggedVersionId?: string;
507+
taggedVersionNumber?: number;
508508
};
509509
header?: never;
510510
path: {
@@ -530,15 +530,15 @@ export interface paths {
530530
} & {
531531
/** Format: uuid */
532532
modelId: string;
533-
/** Format: uuid */
534-
taggedVersionId: string;
533+
taggedVersionNumber: number;
535534
/** Format: uuid */
536535
fileId: string;
537536
filename: string;
538537
contentType: string;
539538
sizeBytes: number;
540539
/** Format: date-time */
541540
createdAt: string;
541+
downloadUrl: string;
542542
})[];
543543
};
544544
};
@@ -573,15 +573,15 @@ export interface paths {
573573
} & {
574574
/** Format: uuid */
575575
modelId: string;
576-
/** Format: uuid */
577-
taggedVersionId: string;
576+
taggedVersionNumber: number;
578577
/** Format: uuid */
579578
fileId: string;
580579
filename: string;
581580
contentType: string;
582581
sizeBytes: number;
583582
/** Format: date-time */
584583
createdAt: string;
584+
downloadUrl: string;
585585
};
586586
};
587587
};
@@ -1056,14 +1056,7 @@ export interface paths {
10561056
page: number;
10571057
data: unknown[];
10581058
} & {
1059-
data: ({
1060-
/**
1061-
* Format: uuid
1062-
* @description Entity's id
1063-
* @example 2cdc8ab1-6d50-49cc-ba14-54e4ac7ec231
1064-
*/
1065-
id: string;
1066-
} & {
1059+
data: {
10671060
/** Format: uuid */
10681061
modelId: string;
10691062
versionNumber: number;
@@ -1076,7 +1069,7 @@ export interface paths {
10761069
/** Format: date-time */
10771070
createdAt: string;
10781071
isFinalized: boolean;
1079-
})[];
1072+
}[];
10801073
};
10811074
};
10821075
};
@@ -1108,12 +1101,7 @@ export interface paths {
11081101
};
11091102
content: {
11101103
"application/json": {
1111-
/**
1112-
* Format: uuid
1113-
* @description Entity's id
1114-
* @example 2cdc8ab1-6d50-49cc-ba14-54e4ac7ec231
1115-
*/
1116-
id: string;
1104+
versionNumber: number;
11171105
};
11181106
};
11191107
};
@@ -1193,13 +1181,6 @@ export interface paths {
11931181
};
11941182
content: {
11951183
"application/json": {
1196-
/**
1197-
* Format: uuid
1198-
* @description Entity's id
1199-
* @example 2cdc8ab1-6d50-49cc-ba14-54e4ac7ec231
1200-
*/
1201-
id: string;
1202-
} & {
12031184
/** Format: uuid */
12041185
modelId: string;
12051186
versionNumber: number;
@@ -1225,6 +1206,44 @@ export interface paths {
12251206
patch?: never;
12261207
trace?: never;
12271208
};
1209+
"/api/v1/models/{id}/versions/{version}/preview-image": {
1210+
parameters: {
1211+
query?: never;
1212+
header?: never;
1213+
path?: never;
1214+
cookie?: never;
1215+
};
1216+
get: {
1217+
parameters: {
1218+
query?: never;
1219+
header?: never;
1220+
path: {
1221+
id: string;
1222+
version: number;
1223+
};
1224+
cookie?: never;
1225+
};
1226+
requestBody?: never;
1227+
responses: {
1228+
/** @description Default Response */
1229+
200: {
1230+
headers: {
1231+
[name: string]: unknown;
1232+
};
1233+
content: {
1234+
"application/json": string;
1235+
};
1236+
};
1237+
};
1238+
};
1239+
put?: never;
1240+
post?: never;
1241+
delete?: never;
1242+
options?: never;
1243+
head?: never;
1244+
patch?: never;
1245+
trace?: never;
1246+
};
12281247
"/api/v1/models/{id}/tags": {
12291248
parameters: {
12301249
query?: never;
@@ -1260,7 +1279,8 @@ export interface paths {
12601279
content: {
12611280
"application/json": {
12621281
/** Format: uuid */
1263-
modelVersionId: string;
1282+
modelId: string;
1283+
versionNumber: number;
12641284
/** Format: uuid */
12651285
tagId: string;
12661286
tagName: string;
@@ -1525,7 +1545,7 @@ export interface paths {
15251545
[name: string]: unknown;
15261546
};
15271547
content: {
1528-
"application/json": ({
1548+
"application/json": (({
15291549
/**
15301550
* Format: uuid
15311551
* @description Entity's id
@@ -1554,7 +1574,28 @@ export interface paths {
15541574
/** @description student | teacher | researcher | other */
15551575
userKind: string;
15561576
isProfilePublic: boolean;
1557-
};
1577+
}) | (({
1578+
/**
1579+
* Format: uuid
1580+
* @description Entity's id
1581+
* @example 2cdc8ab1-6d50-49cc-ba14-54e4ac7ec231
1582+
*/
1583+
id: string;
1584+
} & {
1585+
/**
1586+
* @description Entity creation date
1587+
* @example 2020-11-24T17:43:15.970Z
1588+
*/
1589+
createdAt: string;
1590+
/**
1591+
* @description Entity last update date
1592+
* @example 2020-11-24T17:43:15.970Z
1593+
*/
1594+
updatedAt: string;
1595+
}) & {
1596+
name: string | null;
1597+
isProfilePublic: boolean;
1598+
});
15581599
};
15591600
};
15601601
};

0 commit comments

Comments
 (0)