- Install docker and node
sudo apt update
sudo apt install docker.io docker-compose nodejs npm git- Copy repo
git clone https://github.com/Daynlight/CMS- Run container
docker compose up- Login to Directus
http://127.0.0.1:8055.
user: admin@admin.com
password: admin
- Shutdown container
docker compose downheadless cms/backend: http://127.0.0.1:8055
frontend: http://127.0.0.1:4000
/- default user article page./access- all articles accessed with token./refresh- refresh cached articles (webhook).
- Frontend is build with
expressandaxios. - Backend is headless cms (Directus).
- Frontend and Backend are created via
docker. - Backend have database
postgresqlsave in./data. - It have two types of content [
Articles,Authors]. ArticlesandAuthorsare related many to one.editor@editor.comis server editor that can edit articles and authors.- editor can't set status equal to published.
publisher@publisher.comis server publisher that can only set status of article to published.- Article can have 3 states [
draft,review,published]. - Frontend can get
publishedcontent from backend viahttp://directus:8055/items/articles. - Front can access all content by using token for Authenticated user.
- Authenticated user don't have password and login it provides only token to fetch all data.
- When Article change status to
publishedit sends api request to frontend to refresh articles. - If someone opens frontend and there is no article than it fetches data from backend.
- Articles are automatically updated every minute.
- headless cms is just user friendly backend.