add strapi

This commit is contained in:
Schneider Roland
2024-12-30 18:11:00 +01:00
parent fa80afd797
commit ed6e5089ec
75 changed files with 22076 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
import type { StrapiApp } from '@strapi/strapi/admin';
export default {
config: {
locales: [
// 'ar',
// 'fr',
// 'cs',
// 'de',
// 'dk',
// 'es',
// 'he',
// 'id',
// 'it',
// 'ja',
// 'ko',
// 'ms',
// 'nl',
// 'no',
// 'pl',
// 'pt-BR',
// 'pt',
// 'ru',
// 'sk',
// 'sv',
// 'th',
// 'tr',
// 'uk',
// 'vi',
// 'zh-Hans',
// 'zh',
],
},
bootstrap(app: StrapiApp) {
console.log(app);
},
};

View File

@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Bundler",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": ["../plugins/**/admin/src/**/*", "./"],
"exclude": ["node_modules/", "build/", "dist/", "**/*.test.ts"]
}

View File

@@ -0,0 +1,12 @@
import { mergeConfig, type UserConfig } from 'vite';
export default (config: UserConfig) => {
// Important: always return the modified config
return mergeConfig(config, {
resolve: {
alias: {
'@': '/src',
},
},
});
};

View File

View File

@@ -0,0 +1,33 @@
{
"kind": "singleType",
"collectionName": "abouts",
"info": {
"singularName": "about",
"pluralName": "abouts",
"displayName": "About",
"description": "Write about yourself and the content you create"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"description": {
"type": "blocks"
},
"image": {
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": [
"images",
"files",
"videos",
"audios"
]
}
}
}

View File

@@ -0,0 +1,7 @@
/**
* about controller
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreController('api::about.about');

View File

@@ -0,0 +1,7 @@
/**
* about router.
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::about.about');

View File

@@ -0,0 +1,7 @@
/**
* about service.
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::about.about');

View File

@@ -0,0 +1,49 @@
{
"kind": "collectionType",
"collectionName": "articles",
"info": {
"singularName": "article",
"pluralName": "articles",
"displayName": "Article",
"description": "Create your blog content"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"description": {
"type": "text",
"maxLength": 80
},
"slug": {
"type": "uid",
"targetField": "title"
},
"cover": {
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": ["images", "files", "videos"]
},
"author": {
"type": "relation",
"relation": "manyToOne",
"target": "api::author.author",
"inversedBy": "articles"
},
"category": {
"type": "relation",
"relation": "manyToOne",
"target": "api::category.category",
"inversedBy": "articles"
},
"blocks": {
"type": "dynamiczone",
"components": ["shared.media", "shared.quote", "shared.rich-text", "shared.slider"]
}
}
}

View File

@@ -0,0 +1,7 @@
/**
* article controller
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreController('api::article.article');

View File

@@ -0,0 +1,7 @@
/**
* article router.
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::article.article');

View File

@@ -0,0 +1,7 @@
/**
* article service.
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::article.article');

View File

@@ -0,0 +1,34 @@
{
"kind": "collectionType",
"collectionName": "authors",
"info": {
"singularName": "author",
"pluralName": "authors",
"displayName": "Author",
"description": "Create authors for your content"
},
"options": {
"draftAndPublish": false
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string"
},
"avatar": {
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": ["images", "files", "videos"]
},
"email": {
"type": "string"
},
"articles": {
"type": "relation",
"relation": "oneToMany",
"target": "api::article.article",
"mappedBy": "author"
}
}
}

View File

@@ -0,0 +1,7 @@
/**
* author controller
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreController('api::author.author');

View File

@@ -0,0 +1,7 @@
/**
* author router.
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::author.author');

View File

@@ -0,0 +1,7 @@
/**
* author service.
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::author.author');

View File

@@ -0,0 +1,18 @@
{
"kind": "collectionType",
"collectionName": "cars",
"info": {
"singularName": "car",
"pluralName": "cars",
"displayName": "car"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string"
}
}
}

View File

@@ -0,0 +1,7 @@
/**
* car controller
*/
import { factories } from '@strapi/strapi'
export default factories.createCoreController('api::car.car');

View File

@@ -0,0 +1,7 @@
/**
* car router
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::car.car');

View File

@@ -0,0 +1,7 @@
/**
* car service
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::car.car');

View File

@@ -0,0 +1,31 @@
{
"kind": "collectionType",
"collectionName": "categories",
"info": {
"singularName": "category",
"pluralName": "categories",
"displayName": "Category",
"description": "Organize your content into categories"
},
"options": {
"draftAndPublish": false
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string"
},
"slug": {
"type": "uid"
},
"articles": {
"type": "relation",
"relation": "oneToMany",
"target": "api::article.article",
"mappedBy": "category"
},
"description": {
"type": "text"
}
}
}

View File

@@ -0,0 +1,7 @@
/**
* category controller
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreController('api::category.category');

View File

@@ -0,0 +1,7 @@
/**
* category router.
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::category.category');

View File

@@ -0,0 +1,7 @@
/**
* category service.
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::category.category');

View File

@@ -0,0 +1,35 @@
{
"kind": "singleType",
"collectionName": "globals",
"info": {
"singularName": "global",
"pluralName": "globals",
"displayName": "Global",
"description": "Define global settings"
},
"options": {
"draftAndPublish": false
},
"pluginOptions": {},
"attributes": {
"siteName": {
"type": "string",
"required": true
},
"favicon": {
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": ["images", "files", "videos"]
},
"siteDescription": {
"type": "text",
"required": true
},
"defaultSeo": {
"type": "component",
"repeatable": false,
"component": "shared.seo"
}
}
}

View File

@@ -0,0 +1,7 @@
/**
* global controller
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreController('api::global.global');

View File

@@ -0,0 +1,7 @@
/**
* global router.
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::global.global');

View File

@@ -0,0 +1,7 @@
/**
* global service.
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::global.global');

View File

@@ -0,0 +1,24 @@
{
"kind": "singleType",
"collectionName": "people",
"info": {
"singularName": "person",
"pluralName": "people",
"displayName": "person"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string"
},
"firstname": {
"type": "string"
},
"lastname": {
"type": "string"
}
}
}

View File

@@ -0,0 +1,7 @@
/**
* person controller
*/
import { factories } from '@strapi/strapi'
export default factories.createCoreController('api::person.person');

View File

@@ -0,0 +1,7 @@
/**
* person router
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::person.person');

View File

@@ -0,0 +1,7 @@
/**
* person service
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::person.person');

View File

@@ -0,0 +1,15 @@
{
"collectionName": "components_shared_media",
"info": {
"displayName": "Media",
"icon": "file-video"
},
"options": {},
"attributes": {
"file": {
"allowedTypes": ["images", "files", "videos"],
"type": "media",
"multiple": false
}
}
}

View File

@@ -0,0 +1,13 @@
{
"collectionName": "components_shared_my_components",
"info": {
"displayName": "my component",
"icon": "alien"
},
"options": {},
"attributes": {
"testtext": {
"type": "string"
}
}
}

View File

@@ -0,0 +1,16 @@
{
"collectionName": "components_shared_quotes",
"info": {
"displayName": "Quote",
"icon": "indent"
},
"options": {},
"attributes": {
"title": {
"type": "string"
},
"body": {
"type": "text"
}
}
}

View File

@@ -0,0 +1,14 @@
{
"collectionName": "components_shared_rich_texts",
"info": {
"displayName": "Rich text",
"icon": "align-justify",
"description": ""
},
"options": {},
"attributes": {
"body": {
"type": "richtext"
}
}
}

View File

@@ -0,0 +1,26 @@
{
"collectionName": "components_shared_seos",
"info": {
"name": "Seo",
"icon": "allergies",
"displayName": "Seo",
"description": ""
},
"options": {},
"attributes": {
"metaTitle": {
"type": "string",
"required": true
},
"metaDescription": {
"type": "text",
"required": true
},
"shareImage": {
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": ["images"]
}
}
}

View File

@@ -0,0 +1,17 @@
{
"collectionName": "components_shared_sliders",
"info": {
"displayName": "Slider",
"icon": "address-book",
"description": ""
},
"options": {},
"attributes": {
"files": {
"type": "media",
"multiple": true,
"required": false,
"allowedTypes": ["images"]
}
}
}

View File

20
strapi-yoga/src/index.ts Normal file
View File

@@ -0,0 +1,20 @@
// import type { Core } from '@strapi/strapi';
export default {
/**
* An asynchronous register function that runs before
* your application is initialized.
*
* This gives you an opportunity to extend code.
*/
register(/* { strapi }: { strapi: Core.Strapi } */) {},
/**
* An asynchronous bootstrap function that runs before
* your application gets started.
*
* This gives you an opportunity to set up your data model,
* run jobs, or perform some special logic.
*/
bootstrap(/* { strapi }: { strapi: Core.Strapi } */) {},
};