{"id":28751073,"url":"https://github.com/dobschal/express-cms","last_synced_at":"2026-01-31T18:31:59.543Z","repository":{"id":298870536,"uuid":"1001412268","full_name":"dobschal/express-cms","owner":"dobschal","description":"Simple CMS implementation for ExpressJS","archived":false,"fork":false,"pushed_at":"2025-09-01T17:41:41.000Z","size":120,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-21T16:45:10.257Z","etag":null,"topics":["cms","express","expressjs","javascript"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dobschal.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-06-13T10:35:16.000Z","updated_at":"2025-09-01T17:41:26.000Z","dependencies_parsed_at":"2025-06-13T10:52:29.594Z","dependency_job_id":null,"html_url":"https://github.com/dobschal/express-cms","commit_stats":null,"previous_names":["dobschal/express-cms"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/dobschal/express-cms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobschal%2Fexpress-cms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobschal%2Fexpress-cms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobschal%2Fexpress-cms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobschal%2Fexpress-cms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dobschal","download_url":"https://codeload.github.com/dobschal/express-cms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobschal%2Fexpress-cms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28949383,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T18:30:42.805Z","status":"ssl_error","status_checked_at":"2026-01-31T18:30:19.593Z","response_time":128,"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","express","expressjs","javascript"],"created_at":"2025-06-16T22:08:42.942Z","updated_at":"2026-01-31T18:31:59.538Z","avatar_url":"https://github.com/dobschal.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧘‍♂️ Express CMS\n👉 A simple CMS implementation for ExpressJS. It provides an admin UI to manage content.\nAll content is stored in JSON files on the server and can be accessed easily.\nThis CMS is designed to be simple and easy to use, making it a great choice for small projects or prototypes.\n\n[![NPM](https://img.shields.io/npm/v/@dobschal/express-cms)](https://www.npmjs.com/package/@dobschal/express-cms)\n\n## Get Started\n\n### Installation\n\n```bash\nnpm install --save @dobschal/express-cms\n```\n\n### Usage\n\nImport and run the cms setup function with a configuration object that defines your models:\n```javascript\nimport express from 'express';\nimport cms from '@dobschal/express-cms';\n\nconst app = express()\ncms(app, {\n    models: {\n        concerts: {\n            title: \"text\",\n            date: \"date\",\n            __public: true // this will make the data publicly accessible\n        }        \n    }\n});\napp.listen(3000, () =\u003e console.log(\"Server running on http://localhost:3000\"));\n```\n\n### Open Admin UI\nOpen your browser and navigate to `http://localhost:3000/express-cms` to access the CMS interface.\n\n## Retrieve Data\n\nThere are two ways to retrieve data from the CMS. From the client side you can fetch the JSON files directly if the model is marked as public. From the server side you can read the data and use it e.g. to server side render it.\n\n### Server Side\nYou can access the data from the server side by importing the `readData` function from the CMS module. This function returns an array of items of the specified model.\nIf you pass the `id` parameter, it will return a single item with that id.\n\n**Read all items:**\n```javascript\nimport { readData } from '@dobschal/express-cms';\n// ...\n\napp.get('/concerts', async (req, res) =\u003e {\n    const concerts = await readData('concerts');\n    return res.send(concerts); // or render view\n});\n```\n\n**Read a single item by ID:**\n```javascript\nimport { readData } from '@dobschal/express-cms';\n// ...\n\napp.get('/concerts/:id', async (req, res) =\u003e {\n    const concert = await readData('concerts', req.params.id);\n    return res.send(concert); // or render view\n});\n```\n\n### Marking Models as Public\nTo make a model publicly accessible, you can set the `public` property to `true` in the model configuration. This will allow the data to be served as JSON files.\n```javascript\ncms(app, {\n    models: {\n        concerts: {\n            title: \"text\",\n            date: \"date\",\n            __public: true // This model is publicly accessible\n        }        \n    }\n});\n```\n\nWhen a model is marked as public, the CMS will automatically create a JSON file for it under `/express-cms/data/{modelName}.json`.\n\n### Client Side\nThe JSON files are public available under `/express-cms/data/{modelName}.json`. You can fetch them using the Fetch API or any HTTP client.\n```javascript\nfetch('/express-cms/data/concerts.json')\n    .then(response =\u003e response.json())\n    .then(data =\u003e {\n        console.log(data); // Array of concert objects\n    });\n```\n\n## Model Types\nModels must be flat objects with the following property types:\n- `text`: A simple text field.\n-  longtext: A long text field, which can be used for larger text content.\n- `date`: A date field, which can be used to store dates.\n- `number`: A number field, which can be used to store numeric values.\n- `boolean`: A boolean field, which can be used to store true/false values.\n- `file`: A file field, which can be used to upload files.\n- `image`: An image field, which can be used to upload images. This automatically creates a 300x300 thumbnail.\n\nExample:\n```javascript\ncms(app, {\n    models: {\n        concerts: {\n            title: \"text\",\n            date: \"date\",\n            price: \"number\",\n            bill: \"file\",\n            isSoldOut: \"boolean\",\n            poster: \"image\"\n        }        \n    }\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdobschal%2Fexpress-cms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdobschal%2Fexpress-cms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdobschal%2Fexpress-cms/lists"}