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:
consultoria-as
2026-02-22 03:30:26 +00:00
parent 1ae432a266
commit 8800cc8934
18 changed files with 19077 additions and 0 deletions

12
apps/cms/.env.example Normal file
View 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
View 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
View 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"),
},
},
});

View 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),
},
},
});

View 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",
];

View File

@@ -0,0 +1,9 @@
export default () => ({
i18n: {
enabled: true,
config: {
defaultLocale: "es",
locales: ["es", "en"],
},
},
});

View 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"),
},
});

View File

28
apps/cms/package.json Normal file
View 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
View File

View File

@@ -0,0 +1,3 @@
# To prevent search engines from seeing the site altogether, uncomment the next two lines:
# User-Agent: *
# Disallow: /

View File

@@ -0,0 +1,6 @@
export default {
config: {
locales: ["es", "en"],
},
bootstrap() {},
};

View File

View File

20
apps/cms/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 } */) {},
};

19
apps/cms/tsconfig.json Normal file
View 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/"
]
}

View File