{"id":23246433,"url":"https://github.com/marianmeres/jay","last_synced_at":"2026-04-18T00:31:18.346Z","repository":{"id":240672127,"uuid":"793141204","full_name":"marianmeres/jay","owner":"marianmeres","description":"The Naive, the JSON, the CMS.","archived":false,"fork":false,"pushed_at":"2024-06-05T15:22:21.000Z","size":3036,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-28T08:22:08.763Z","etag":null,"topics":["cms","db-less","image-resizer","image-server","json","rest-api","static-server"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marianmeres.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-28T14:46:18.000Z","updated_at":"2024-06-05T15:22:25.000Z","dependencies_parsed_at":"2024-06-03T13:28:52.222Z","dependency_job_id":"27e27307-211e-4d27-a7a1-2aeade5ed806","html_url":"https://github.com/marianmeres/jay","commit_stats":null,"previous_names":["marianmeres/jay"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/marianmeres/jay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marianmeres%2Fjay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marianmeres%2Fjay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marianmeres%2Fjay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marianmeres%2Fjay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marianmeres","download_url":"https://codeload.github.com/marianmeres/jay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marianmeres%2Fjay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31951224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cms","db-less","image-resizer","image-server","json","rest-api","static-server"],"created_at":"2024-12-19T07:14:57.830Z","updated_at":"2026-04-18T00:31:18.317Z","avatar_url":"https://github.com/marianmeres.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @marianmeres/jay\n\nThe Naive, the JSON, the CMS.\n\n## What is Jay?\n\nBefore we start, quick vocabulary context definition:\n\n- **model** - data structure described by schema (in the DB context a table structure),\n- **entity** - type of the model (in the DB context a table name). May be used interchangeably with the term \"document type\",\n- **document** - concrete \"instance\" of the model, persisted as a physical json file (in the DB context a row),\n- **data** - somewhat vague, but mostly means some or all documents,\n- **collection** - list of document instances (in the DB context a set of rows),\n- **asset** - a special case model, having both `data` (in whatever structure described by schema) and a physical raw representation as a file saved on disk, named by it's content hash.\n\nAll three words `model`, `entity` and `document` may and probably will be used inaccurately, but are roughly describing the same thing.\n\n### The \"no DB\" CMS\n\n_Jay_ is a generic CMS server -- it provides a REST interface for managing and serving any documents and assets. It features a basic CRUD authentication system and allows the access rights and document schemas to be defined using YAML definition files (regular JSON schemas under the hood), ensuring proper validation. These same YAML files can also define some props for the frontend admin UI.\n\nA single _Jay_ server instance can support multiple isolated projects, each independently configurable with ease.\n\nNotably, _Jay_ operates **without the need for a traditional database**.\n\n### The JSON\n\n_Jay_ is a json files writer -- all documents are serialized to the filesystem as well-formatted json files. Every document json file can be safely edited by hand if needed. It should also be noted, that the raw json files are not statically served but are always processed (to be able to respect schema and more...).\n\nAdditionally, asset source files are efficiently stored in a separate configured directory. Images are treated with special care out of the box.\n\n### The Naive\n\n_Jay_ is an honest yet a bit naive servant -- it maintains all documents in memory, with serialization to disk occurring only during write operations. This design choice results in high performance but limits scalability.\n\nFor managing a vast number of documents, or the need to spawn multiple server instances across multiple nodes, alternative solutions should be considered.\n\n## What is the use case?\n\nWhen you may not have access to a DB on the server but still need to reliably read/write some data... When you may want to bundle (and to version) your schemas and data in a git repo instead of worrying about DB backups and SQL migrations...\n\nWhen you simply need a tiny and easy-to-configure, yet still reliable REST API with GUI for whatever data driven needs.\n\n## The admin GUI\n\n_Jay_ comes bundled with it's brother _Joy_ -- a modern admin GUI, mounted on the `/admin/` path by default. This GUI is an ongoing work-in-progress (currently in an alpha stage) and is not open source.\n\n## Installation (quick start)\n\n1. `git clone https://github.com/marianmeres/jay.git`\n2. `cd jay`\n3. `npm install`\n4. `cp projects.config.example.json projects.config.json`\n5. `vim projects.config.json` (can be skipped if you want to play with the demo only)\n6. `cp .env.example .env`\n7. `vim .env` (optional if you're OK with the defaults)\n8. `npm run start`\n9. open `http://localhost:6100/admin/` in your browser, add the default server and click on the \"Demo project\". Use `admin@example.com` and `this-user-should-be-deleted` as credentials.\n\n## Creating a new project (todo: improve docs)\n\nThis is a little bumpy for now... The detailed explanation on how to prepare the schema files will be added later.\n\n1. Create 2 directories anywhere on your system. Make sure they are writable. For example:\n\n- `/home/foo/projects/bar/data/`, and\n- `/home/foo/projects/bar/public/uploads/` (it is currently required that the last segment is \"uploads\")\n\n2. Edit `projects.config.json` and add a new project:\n\n```json\n[\n\t// ...,\n\t{\n\t\t\"id\": \"my-project\",\n\t\t\"name\": \"My Project\",\n\t\t\"dataDir\": \"/home/foo/projects/bar/data/\",\n\t\t\"publicDir\": \"/home/foo/projects/bar/public/\"\n\t\t// note, that we're not adding the \"uploads\" segment above\n\t}\n]\n```\n\n3. Create any yaml definition files describing your models. Name of the yaml file will be the name of your entity. There are few entity names which are recognized by the system as a special cases (currently `_user` and `_asset`).\n   \u003cbr /\u003e\u003cbr /\u003e\n   For now, look into the `_cms-data-demo` folder for inspiration. At very minimum, copy the `_user.yaml` and `_user/[whatever-the-id-is].json` to your new project's data dir. Edit the user json file by hand to fit your needs, mainly the `__password` key with some bcrypt value. You may use `npm run pswhash [your-password]` as a helper here.\n\n4. Now, restart the server and refresh your admin GUI browser window to reload project configuration and select \"My Project\" from the projects list and you should be good to go.\n\n## The REST endpoints (todo: improve docs)\n\nMain collection and model endpoints. Whether they require HTTP authorized requests depends on the schema configuration.\n\n- `/{PROJECT_ID}/api/_cms/{ENTITY}` (`limit` and `offset` query params are supported)\n- `/{PROJECT_ID}/api/_cms/{ENTITY}/{DOCUMENT_ID}`\n\nAuth endpoint:\n\n- `/{PROJECT_ID}/api/auth`\n\nOther miscellaneous. You must use the HTTP baerer auth header (token can be acquired from the auth endpoint above):\n\n- `/{PROJECT_ID}/api/schema.json`\n- `/{PROJECT_ID}/api/upload`\n- `/{PROJECT_ID}/api/dump`\n- `/{PROJECT_ID}/api/readme`\n- `/{PROJECT_ID}/api/__refresh__`\n\n## Naming convention magic\n\nThere are few document props naming conventions which expose some handy features.\n\n- `_startsWithUnderscore` prop name is considered as a **read-only** and the REST endpoint will NEVER allow it to be overwritten by user-land data. Some of such props are also built-in into every document (`_created_at`, `_updated_at`, `_owner`).\n- `__startsWithDoubleUnderscore` prop name is considered as a **hidden** and will NEVER leave the server and will NEVER be overwritten by user-land data. Those props are simply filtered out for both incoming requests and outgoing responses. Typical example is a `__password` field of the `_user` model (leaving aside, that the actual `__password` value is a bcrypt hash, so even exposing it should not cause any harm).\n\nNote that you can always edit the fields by hand in the actual json files (server restart is required for those changes to take effect).\n\n---\n\n### What does the word \"Jay\" means?\n\nI had to ask our LLM friend. This is the answer.\n\nThe word \"jay\" has several meanings depending on the context:\n\n- Bird: A \"jay\" is a type of bird known for its vibrant plumage and loud calls. Jays belong to the family Corvidae, which also includes crows and magpies.\n\n- Slang Term: In North American slang, particularly in the past, a \"jay\" referred to an unsophisticated or naive person, often someone from a rural area who is unfamiliar with urban ways.\n\n- Letter J: In some contexts, \"jay\" simply refers to the letter \"J\" in the English alphabet.\n\n- Traffic Violation: The term \"jaywalking\" is derived from this word, referring to the act of crossing the street illegally or recklessly, often not at a designated crosswalk.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarianmeres%2Fjay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarianmeres%2Fjay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarianmeres%2Fjay/lists"}