Just a blog - a simple web blog using NextJS and Strapi.
System requires:
"node": ">=16.8.x <=18.x.x"
Version: 4.3.0 with Typescript.
$ npm i
Create new file ./strapi/.env
and copy all content in ./strapi/.env.sample
, then run:
$ npm run develop
Strapi listens on port 1337
as default.
Category
{
"title": {
"type": "string"
},
"slug": {
"type": "uid",
"targetField": "title"
},
"color": {
"type": "string"
},
"posts": {
"type": "relation",
"relation": "manyToMany",
"target": "api::post.post",
"inversedBy": "categories"
}
}
User
{
"name": {
"type": "string"
},
"slug": {
"type": "uid",
"targetField": "title"
},
"color": {
"type": "string"
},
"posts": {
"type": "relation",
"relation": "oneToMany",
"target": "api::post.post",
"inversedBy": "posts"
}
}
Post
{
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"slug": {
"type": "uid",
"targetField": "title"
},
"content": {
"type": "text"
},
"cover": {
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": [
"images",
"files",
"videos",
"audios"
]
},
"author": {
"type": "relation",
"relation": "manyToOne",
"target": "plugin::users-permissions.user",
"inversedBy": "posts"
},
"categories": {
"type": "relation",
"relation": "manyToMany",
"target": "api::category.category",
"inversedBy": "posts"
}
}
# Get all posts
curl --request GET \
--url 'http://localhost:1337/api/posts?populate=*' \
--header 'Content-Type: application/json'
Strapi Admin panel Here. Account/Password: [email protected] / 12wqasxZ
Version: 13.1.6 with appDir
experimental feature.
$ npm i
$ npm run dev
NextJS dev-server listens on port 3000
as default.