feat: scaffold Strapi 5 CMS with PostgreSQL and i18n config
Add Strapi 5 headless CMS application at apps/cms/ with: - PostgreSQL database configuration (afterlife database) - i18n plugin enabled with Spanish (default) and English locales - TypeScript configuration - Standard Strapi middleware stack - Environment variable template (.env.example) - Admin panel locale support for es/en Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
12
apps/cms/.env.example
Normal file
12
apps/cms/.env.example
Normal file
@@ -0,0 +1,12 @@
|
||||
HOST=0.0.0.0
|
||||
PORT=1337
|
||||
APP_KEYS=tobemodified1,tobemodified2,tobemodified3,tobemodified4
|
||||
API_TOKEN_SALT=tobemodified
|
||||
ADMIN_JWT_SECRET=tobemodified
|
||||
TRANSFER_TOKEN_SALT=tobemodified
|
||||
JWT_SECRET=tobemodified
|
||||
DATABASE_HOST=127.0.0.1
|
||||
DATABASE_PORT=5432
|
||||
DATABASE_NAME=afterlife
|
||||
DATABASE_USERNAME=afterlife
|
||||
DATABASE_PASSWORD=afterlife
|
||||
98
apps/cms/.gitignore
vendored
Normal file
98
apps/cms/.gitignore
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
############################
|
||||
# OS X
|
||||
############################
|
||||
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
Icon
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
._*
|
||||
|
||||
############################
|
||||
# Linux
|
||||
############################
|
||||
|
||||
*~
|
||||
|
||||
############################
|
||||
# Windows
|
||||
############################
|
||||
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
Desktop.ini
|
||||
$RECYCLE.BIN/
|
||||
*.cab
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
############################
|
||||
# Packages
|
||||
############################
|
||||
|
||||
*.7z
|
||||
*.csv
|
||||
*.dat
|
||||
*.dmg
|
||||
*.gz
|
||||
*.iso
|
||||
*.jar
|
||||
*.rar
|
||||
*.tar
|
||||
*.zip
|
||||
*.log
|
||||
*.sql
|
||||
*.sqlite
|
||||
|
||||
############################
|
||||
# Logs and databases
|
||||
############################
|
||||
|
||||
.tmp
|
||||
*.log
|
||||
*.sql
|
||||
*.sqlite
|
||||
|
||||
############################
|
||||
# Misc.
|
||||
############################
|
||||
|
||||
*#
|
||||
ssl
|
||||
.idea
|
||||
nbproject
|
||||
|
||||
############################
|
||||
# Node.js
|
||||
############################
|
||||
|
||||
lib-cov
|
||||
lcov.info
|
||||
pids
|
||||
logs
|
||||
results
|
||||
node_modules
|
||||
.node_history
|
||||
|
||||
############################
|
||||
# Tests
|
||||
############################
|
||||
|
||||
testApp
|
||||
coverage
|
||||
|
||||
############################
|
||||
# Strapi
|
||||
############################
|
||||
|
||||
.env
|
||||
license.txt
|
||||
exports/
|
||||
*.cache
|
||||
dist/
|
||||
build/
|
||||
.strapi/
|
||||
.strapi-updater.json
|
||||
13
apps/cms/config/admin.ts
Normal file
13
apps/cms/config/admin.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export default ({ env }) => ({
|
||||
auth: {
|
||||
secret: env("ADMIN_JWT_SECRET"),
|
||||
},
|
||||
apiToken: {
|
||||
salt: env("API_TOKEN_SALT"),
|
||||
},
|
||||
transfer: {
|
||||
token: {
|
||||
salt: env("TRANSFER_TOKEN_SALT"),
|
||||
},
|
||||
},
|
||||
});
|
||||
13
apps/cms/config/database.ts
Normal file
13
apps/cms/config/database.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export default ({ env }) => ({
|
||||
connection: {
|
||||
client: "postgres",
|
||||
connection: {
|
||||
host: env("DATABASE_HOST", "127.0.0.1"),
|
||||
port: env.int("DATABASE_PORT", 5432),
|
||||
database: env("DATABASE_NAME", "afterlife"),
|
||||
user: env("DATABASE_USERNAME", "afterlife"),
|
||||
password: env("DATABASE_PASSWORD", "afterlife"),
|
||||
ssl: env.bool("DATABASE_SSL", false),
|
||||
},
|
||||
},
|
||||
});
|
||||
12
apps/cms/config/middlewares.ts
Normal file
12
apps/cms/config/middlewares.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export default [
|
||||
"strapi::logger",
|
||||
"strapi::errors",
|
||||
"strapi::security",
|
||||
"strapi::cors",
|
||||
"strapi::poweredBy",
|
||||
"strapi::query",
|
||||
"strapi::body",
|
||||
"strapi::session",
|
||||
"strapi::favicon",
|
||||
"strapi::public",
|
||||
];
|
||||
9
apps/cms/config/plugins.ts
Normal file
9
apps/cms/config/plugins.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export default () => ({
|
||||
i18n: {
|
||||
enabled: true,
|
||||
config: {
|
||||
defaultLocale: "es",
|
||||
locales: ["es", "en"],
|
||||
},
|
||||
},
|
||||
});
|
||||
7
apps/cms/config/server.ts
Normal file
7
apps/cms/config/server.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export default ({ env }) => ({
|
||||
host: env("HOST", "0.0.0.0"),
|
||||
port: env.int("PORT", 1337),
|
||||
app: {
|
||||
keys: env.array("APP_KEYS"),
|
||||
},
|
||||
});
|
||||
0
apps/cms/database/migrations/.gitkeep
Normal file
0
apps/cms/database/migrations/.gitkeep
Normal file
28
apps/cms/package.json
Normal file
28
apps/cms/package.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "@afterlife/cms",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"description": "Strapi 5 CMS for Project Afterlife",
|
||||
"scripts": {
|
||||
"develop": "strapi develop",
|
||||
"start": "strapi start",
|
||||
"build": "strapi build",
|
||||
"strapi": "strapi",
|
||||
"deploy": "strapi deploy"
|
||||
},
|
||||
"dependencies": {
|
||||
"@strapi/strapi": "^5.36.0",
|
||||
"@strapi/plugin-cloud": "^5.36.0",
|
||||
"@strapi/plugin-users-permissions": "^5.36.0",
|
||||
"pg": "^8.13.0",
|
||||
"better-sqlite3": "^11.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0 <=24.x.x",
|
||||
"npm": ">=6.0.0"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
0
apps/cms/public/.gitkeep
Normal file
0
apps/cms/public/.gitkeep
Normal file
3
apps/cms/public/robots.txt
Normal file
3
apps/cms/public/robots.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
# To prevent search engines from seeing the site altogether, uncomment the next two lines:
|
||||
# User-Agent: *
|
||||
# Disallow: /
|
||||
6
apps/cms/src/admin/app.ts
Normal file
6
apps/cms/src/admin/app.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export default {
|
||||
config: {
|
||||
locales: ["es", "en"],
|
||||
},
|
||||
bootstrap() {},
|
||||
};
|
||||
0
apps/cms/src/api/.gitkeep
Normal file
0
apps/cms/src/api/.gitkeep
Normal file
0
apps/cms/src/extensions/.gitkeep
Normal file
0
apps/cms/src/extensions/.gitkeep
Normal file
20
apps/cms/src/index.ts
Normal file
20
apps/cms/src/index.ts
Normal 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 } */) {},
|
||||
};
|
||||
19
apps/cms/tsconfig.json
Normal file
19
apps/cms/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"extends": "@strapi/typescript-utils/tsconfigs/server",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"rootDir": "."
|
||||
},
|
||||
"include": [
|
||||
"./",
|
||||
"src/**/*.ts",
|
||||
"src/**/*.js"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules/",
|
||||
"build/",
|
||||
"dist/",
|
||||
".cache/",
|
||||
".tmp/"
|
||||
]
|
||||
}
|
||||
0
apps/cms/types/generated/.gitkeep
Normal file
0
apps/cms/types/generated/.gitkeep
Normal file
18837
package-lock.json
generated
18837
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user