An api skeleton using mongodb for chubbyts-framework.
- node: 20
- @asteasolutions/zod-to-openapi: ^8.4.3
- @chubbyts/chubbyts-decode-encode: ^2.1.2
- @chubbyts/chubbyts-dic: ^2.0.3
- @chubbyts/chubbyts-dic-config: ^2.0.2
- @chubbyts/chubbyts-dic-types: ^2.0.2
- @chubbyts/chubbyts-framework: ^3.0.3
- @chubbyts/chubbyts-framework-router-path-to-regexp: ^3.0.2
- @chubbyts/chubbyts-http-error: ^3.1.3
- @chubbyts/chubbyts-log-types: ^3.0.3
- @chubbyts/chubbyts-mongodb: ^2.0.3
- @chubbyts/chubbyts-negotiation: ^4.0.3
- @chubbyts/chubbyts-pino-adapter: ^3.0.3
- @chubbyts/chubbyts-undici-api: ^1.2.1
- @chubbyts/chubbyts-undici-cors: ^1.0.1
- @chubbyts/chubbyts-undici-server: ^1.0.3
- @chubbyts/chubbyts-undici-server-node: ^1.0.4
- commander: ^14.0.3
- mongodb: ^7.1.0
- openapi3-ts: ^4.5.0
- pino: ^10.3.1
- uuid: ^13.0.0
- zod: ^4.3.6
Add the following environment variable to your system, for example within ~/.bashrc or ~/.zshrc:
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)Make sure all the mount points are given
touch ~/.bash_docker
touch ~/.bash_historytouch ~/.gitconfig
touch ~/.gitignoremkdir -p ~/.local/share/opencode
[ ! -f ~/.local/share/opencode/auth.json ] && echo '{}' > ~/.local/share/opencode/auth.jsontouch ~/.zsh_docker
touch ~/.zsh_historydocker-compose up -d
docker-compose exec node bashpnpm start- GET https://localhost/api/pets?sort[name]=asc
- POST https://localhost/api/pets
- GET https://localhost/api/pets/019c201f-6a83-7696-9899-50fbf7b2278d
- PUT https://localhost/api/pets/019c201f-6a83-7696-9899-50fbf7b2278d
- DELETE https://localhost/api/pets/019c201f-6a83-7696-9899-50fbf7b2278d
Commands is code that is meant to be executed on command line.
Handler alias Controller, or Controller actions to be more precise.
Models, entities, documents what ever fits your purpose the best.
Repositories get data from storages like databases, opensearch, redis or whereever your models are stored or cached.
Service factories are the glue code of the dependeny injection container.
curl -XPUT 'https://admin:t9V02zfj!NMj?LugFsOi@localhost:9200/_plugins/_ism/policies/logstash-policy' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"policy": {
"description": "Logstash",
"default_state": "hot",
"states": [
{
"name": "hot",
"actions": [],
"transitions": [
{
"state_name": "delete",
"conditions": {
"min_index_age": "14d"
}
}
]
},
{
"name": "delete",
"actions": [
{
"delete": {}
}
]
}
],
"ism_template": {
"index_patterns" : ["logstash-*"],
"priority": 100
}
}
}' \
--insecure2026 Dominik Zogg