chore: add project

develop
Näser 3 years ago
parent c0385e5774
commit fac17fbe23

@ -0,0 +1,16 @@
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[{package.json,*.yml}]
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false

@ -0,0 +1,6 @@
HOST=0.0.0.0
PORT=1337
APP_KEYS="toBeModified1,toBeModified2"
API_TOKEN_SALT=tobemodified
ADMIN_JWT_SECRET=tobemodified
JWT_SECRET=tobemodified

@ -0,0 +1,28 @@
HOST=0.0.0.0
PORT=1337
APP_KEYS=chUnDYzQYwe0TBtXVv4sPg==,fVrGPGw5Xd4UdPisWHOHxQ==,Qre2n8wneae2BrXOotmagw==,B3suExWQFpyJS9mhqNcOLg==
API_TOKEN_SALT=tyYia7Nui8Y0lM0IRTDjmg==
ADMIN_JWT_SECRET=q1dnfyvh3K7yhTYbYNS7jw==
JWT_SECRET=nc8prafomnDTfDdS00OqTQ==
PG_DATABASE_HOST=localhost
PG_DATABASE_PORT=5432
PG_DATABASE_NAME=gs_database
PG_DATABASE_USERNAME=gs_username
PG_DATABASE_ROOT_PASSWORD=gs_root_username
PG_DATABASE_PASSWORD=gs_password
PG_DATABASE_SCHEMA=public
MYSQL_DATABASE_HOST=localhost
MYSQL_DATABASE_PORT=3307
MYSQL_DATABASE_NAME=gs_database
MYSQL_DATABASE_USERNAME=gs_username
MYSQL_DATABASE_ROOT_PASSWORD=gs_root_username
MYSQL_DATABASE_PASSWORD=gs_password
SMTP_HOST=mail.infomaniak.com
SMTP_PORT=587
SMTP_USERNAME=synology@naser.fr
SMTP_PASSWORD=Em18071988!
SMTP_DEFAULT_FROM=no-reply@strapi.io
SMTP_DEFAULT_REPLY=synology@naser.fr

@ -0,0 +1,28 @@
HOST=0.0.0.0
PORT=1337
APP_KEYS=chUnDYzQYwe0TBtXVv4sPg==,fVrGPGw5Xd4UdPisWHOHxQ==,Qre2n8wneae2BrXOotmagw==,B3suExWQFpyJS9mhqNcOLg==
API_TOKEN_SALT=tyYia7Nui8Y0lM0IRTDjmg==
ADMIN_JWT_SECRET=q1dnfyvh3K7yhTYbYNS7jw==
JWT_SECRET=nc8prafomnDTfDdS00OqTQ==
PG_DATABASE_HOST=localhost
PG_DATABASE_PORT=5432
PG_DATABASE_NAME=gs_database
PG_DATABASE_USERNAME=gs_username
PG_DATABASE_ROOT_PASSWORD=gs_root_username
PG_DATABASE_PASSWORD=gs_password
PG_DATABASE_SCHEMA=public
MYSQL_DATABASE_HOST=localhost
MYSQL_DATABASE_PORT=3306
MYSQL_DATABASE_NAME=dpxtrufj_gs_database
MYSQL_DATABASE_USERNAME=dpxtrufj_gs_username
MYSQL_DATABASE_ROOT_PASSWORD=gs_root_username
MYSQL_DATABASE_PASSWORD=q7=@oa*F*s4?8*Hq4H
SMTP_HOST=node143-eu.n0c.com
SMTP_PORT=587
SMTP_USERNAME=no-reply@nasercloud.fr
SMTP_PASSWORD=GuitarSchool123!
SMTP_DEFAULT_FROM=no-reply@strapi.io
SMTP_DEFAULT_REPLY=synology@naser.fr

@ -0,0 +1,28 @@
HOST=0.0.0.0
PORT=1337
APP_KEYS=chUnDYzQYwe0TBtXVv4sPg==,fVrGPGw5Xd4UdPisWHOHxQ==,Qre2n8wneae2BrXOotmagw==,B3suExWQFpyJS9mhqNcOLg==
API_TOKEN_SALT=tyYia7Nui8Y0lM0IRTDjmg==
ADMIN_JWT_SECRET=q1dnfyvh3K7yhTYbYNS7jw==
JWT_SECRET=nc8prafomnDTfDdS00OqTQ==
PG_DATABASE_HOST=localhost
PG_DATABASE_PORT=5432
PG_DATABASE_NAME=gs_database
PG_DATABASE_USERNAME=gs_username
PG_DATABASE_ROOT_PASSWORD=gs_root_username
PG_DATABASE_PASSWORD=gs_password
PG_DATABASE_SCHEMA=public
MYSQL_DATABASE_HOST=localhost
MYSQL_DATABASE_PORT=3306
MYSQL_DATABASE_NAME=dpxtrufj_gs_database
MYSQL_DATABASE_USERNAME=dpxtrufj_gs_user
MYSQL_DATABASE_ROOT_PASSWORD=gs_root_username
MYSQL_DATABASE_PASSWORD=q7=@oa*F*s4?8*Hq4H
SMTP_HOST=node143-eu.n0c.com
SMTP_PORT=587
SMTP_USERNAME=no-reply@nasercloud.fr
SMTP_PASSWORD=GuitarSchool123!
SMTP_DEFAULT_FROM=no-reply@nasercloud.fr
SMTP_DEFAULT_REPLY=contact@nasercloud.fr

@ -0,0 +1,3 @@
.cache
build
**/node_modules/**

@ -0,0 +1,27 @@
{
"parser": "babel-eslint",
"extends": "eslint:recommended",
"env": {
"commonjs": true,
"es6": true,
"node": true,
"browser": false
},
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": false
},
"sourceType": "module"
},
"globals": {
"strapi": true
},
"rules": {
"indent": ["error", 2, { "SwitchCase": 1 }],
"linebreak-style": ["error", "unix"],
"no-console": 0,
"quotes": ["error", "single"],
"semi": ["error", "always"]
}
}

115
.gitignore vendored

@ -0,0 +1,115 @@
############################
# 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
*.com
*.class
*.dll
*.exe
*.o
*.seed
*.so
*.swo
*.swp
*.swn
*.swm
*.out
*.pid
############################
# Logs and databases
############################
.tmp
*.log
*.sql
*.sqlite
*.sqlite3
############################
# Misc.
############################
*#
ssl
.idea
nbproject
public/uploads/*
!public/uploads/.gitkeep
############################
# 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-updater.json

@ -0,0 +1,8 @@
export default ({ env }) => ({
auth: {
secret: env('ADMIN_JWT_SECRET'),
},
apiToken: {
salt: env('API_TOKEN_SALT'),
},
});

@ -0,0 +1,10 @@
export default {
responses: {
privateAttributes: ['_v', 'id', 'created_at'],
},
rest: {
defaultLimit: 100,
maxLimit: 250,
withCount: true,
},
};

@ -0,0 +1,20 @@
export default ({env}) => ({
connection: {
client: 'mysql',
connection: {
host: env('MYSQL_DATABASE_HOST', 'localhost'),
port: env.int('MYSQL_DATABASE_PORT', 3306),
database: env('MYSQL_DATABASE_NAME', 'bank'),
user: env('MYSQL_DATABASE_USERNAME', 'postgres'),
password: env('MYSQL_DATABASE_PASSWORD', '0000'),
},
debug: false,
},
// connection: {
// client: 'sqlite',
// connection: {
// filename: path.join(__dirname, '..', '..', env('DATABASE_FILENAME', '.tmp/data.db')),
// },
// useNullAsDefault: true,
// },
});

@ -0,0 +1,12 @@
export default [
'strapi::errors',
'strapi::security',
'strapi::cors',
'strapi::poweredBy',
'strapi::logger',
'strapi::query',
'strapi::body',
'strapi::session',
'strapi::favicon',
'strapi::public',
];

@ -0,0 +1,25 @@
module.exports = ({env}) => ({
// ...
email: {
config: {
provider: 'nodemailer',
providerOptions: {
host: env('SMTP_HOST', 'smtp.example.com'),
port: env('SMTP_PORT', 587),
auth: {
user: env('SMTP_USERNAME'),
pass: env('SMTP_PASSWORD'),
},
// ... any custom nodemailer options
},
settings: {
defaultFrom: env('SMTP_DEFAULT_FROM', 'no-reply@strapi.io'),
defaultReplyTo: env('SMTP_DEFAULT_REPLY', 'synology@naser.fr'),
},
},
},
'import-export-entries': {
enabled: true
}
// ...
});

@ -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,0 +1,20 @@
services:
gs_mysql:
image: 'mariadb:10.3'
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE_NAME}
# So you don't have to use root, but you can if you like
MYSQL_USER: ${MYSQL_DATABASE_USERNAME}
# You can use whatever password you like
MYSQL_PASSWORD: ${MYSQL_DATABASE_PASSWORD}
# Password for root access
MYSQL_ROOT_PASSWORD: ${MYSQL_DATABASE_ROOT_PASSWORD}
ports:
# <Port exposed> : < MySQL Port running inside container>
- '${MYSQL_DATABASE_PORT}:3306'
expose:
# Opens port 3306 on the container
- '${MYSQL_DATABASE_PORT}'
# Where our data will be persisted
volumes:
- gs_mariadb-master:/var/lib/mysql

933
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -14,7 +14,14 @@
"@strapi/strapi": "4.6.0",
"@strapi/plugin-users-permissions": "4.6.0",
"@strapi/plugin-i18n": "4.6.0",
"better-sqlite3": "7.4.6"
"better-sqlite3": "7.4.6",
"@strapi/provider-email-nodemailer": "4.5.6",
"@strapi/utils": "4.5.6",
"mysql": "2.18.1",
"pg": "8.8.0",
"strapi-plugin-import-export-entries": "1.18.0",
"strapi-plugin-menus": "1.2.1",
"strapi-plugin-populate-deep": "1.1.2"
},
"author": {
"name": "A Strapi developer"

@ -0,0 +1,20 @@
services:
gs_postgres:
image: postgres:14-alpine
container_name: gs_postgres
shm_size: '4gb'
environment:
POSTGRES_USER: ${DATABASE_USERNAME}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_DB: ${DATABASE_NAME}
TZ: Europe/Paris
healthcheck:
test: 'PGPASSWORD="${DATABASE_PASSWORD}" psql --host ${DATABASE_HOST} --username ${DATABASE_USERNAME} --dbname ${DATABASE_NAME} -c "select 1" ; [ "0" -eq "$$?" ]; echo $$?'
interval: 30s
timeout: 10s
retries: 3
volumes:
- gs_postgres-master:/var/lib/postgresql/data:z
- ./.db/init:/docker-entrypoint-initdb.d
ports:
- ${DATABASE_PORT}:5432 # DB

@ -0,0 +1,35 @@
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) {
console.log(app);
},
};

@ -0,0 +1,13 @@
{
"extends": "@strapi/typescript-utils/tsconfigs/admin",
"include": [
"../plugins/**/admin/src/**/*",
"./"
],
"exclude": [
"node_modules/",
"build/",
"dist/",
"**/*.test.ts"
]
}

@ -1,9 +1,12 @@
'use strict';
const MonacoWebackPlugin = require('monaco-editor-webpack-plugin');
/* eslint-disable no-unused-vars */
module.exports = (config, webpack) => {
// Note: we provide webpack above so you should not `require` it
// Perform customizations to webpack config
// Important: return the modified config
config.plugins.push(new MonacoWebackPlugin())
return config;
};

@ -0,0 +1,32 @@
{
"kind": "collectionType",
"collectionName": "pages",
"info": {
"singularName": "page",
"pluralName": "pages",
"displayName": "Pages",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"label": {
"type": "string"
},
"slug": {
"type": "uid",
"targetField": "label"
},
"seo": {
"type": "component",
"repeatable": false,
"component": "shared.seo"
},
"Login": {
"type": "dynamiczone",
"components": []
}
}
}

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

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

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

@ -0,0 +1,17 @@
/**
* A set of functions called "actions" for `username`
*/
export default {
findOne: async (ctx, next) => {
try {
const data = await strapi
.service("api::username.username")
.findUsername(ctx.params.username);
ctx.body = data;
} catch (err) {
ctx.badRequest("Post report controller error", {moreDetails: err});
}
}
};

@ -0,0 +1,13 @@
export default {
routes: [
{
method: 'GET',
path: '/username/:username',
handler: 'username.findOne',
config: {
policies: [],
middlewares: [],
},
},
],
};

@ -0,0 +1,18 @@
/**
* username service
*/
export default () => ({
findUsername: async (username) => {
try {
console.log(username);
let users = await strapi.entityService.findMany(
"plugin::users-permissions.user", {filters: {email: username}}
);
return users.length !== 0;
} catch (err) {
return err;
}
}
});

@ -0,0 +1,16 @@
{
"collectionName": "components_meta_metas",
"info": {
"displayName": "meta",
"icon": "network-wired"
},
"options": {},
"attributes": {
"property": {
"type": "string"
},
"content": {
"type": "string"
}
}
}

@ -0,0 +1,36 @@
{
"collectionName": "components_shared_seos",
"info": {
"displayName": "Seo",
"icon": "book",
"description": ""
},
"options": {},
"attributes": {
"metaTitle": {
"type": "string"
},
"metaDescription": {
"type": "text"
},
"SharedImage": {
"displayName": "SharedImage",
"type": "component",
"repeatable": false,
"component": "shared.shared-image"
},
"Meta": {
"displayName": "meta",
"type": "component",
"repeatable": true,
"component": "meta.meta"
},
"preventIndexing": {
"type": "boolean",
"default": false
},
"structuredData": {
"type": "json"
}
}
}

@ -0,0 +1,24 @@
{
"collectionName": "components_shared_shared_images",
"info": {
"displayName": "SharedImage",
"icon": "file-image",
"description": ""
},
"options": {},
"attributes": {
"alt": {
"type": "string"
},
"media": {
"allowedTypes": [
"images",
"files",
"videos",
"audios"
],
"type": "media",
"multiple": false
}
}
}

@ -0,0 +1,79 @@
{
"kind": "collectionType",
"collectionName": "up_users",
"info": {
"name": "user",
"description": "",
"singularName": "user",
"pluralName": "users",
"displayName": "User"
},
"options": {
"draftAndPublish": false,
"timestamps": true
},
"attributes": {
"username": {
"type": "string",
"minLength": 3,
"unique": true,
"configurable": false,
"required": true
},
"email": {
"type": "email",
"minLength": 6,
"configurable": false,
"required": true
},
"provider": {
"type": "string",
"configurable": false
},
"password": {
"type": "password",
"minLength": 6,
"configurable": false,
"private": true
},
"resetPasswordToken": {
"type": "string",
"configurable": false,
"private": true
},
"confirmationToken": {
"type": "string",
"configurable": false,
"private": true
},
"confirmed": {
"type": "boolean",
"default": false,
"configurable": false
},
"blocked": {
"type": "boolean",
"default": false,
"configurable": false
},
"role": {
"type": "relation",
"relation": "manyToOne",
"target": "plugin::users-permissions.role",
"inversedBy": "users",
"configurable": false
},
"avatar": {
"allowedTypes": [
"images"
],
"type": "media",
"configurable": false,
"multiple": false
},
"newsletter": {
"type": "boolean",
"default": false
}
}
}

@ -0,0 +1,18 @@
export default {
/**
* An asynchronous register function that runs before
* your application is initialized.
*
* This gives you an opportunity to extend code.
*/
register(/*{ 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 }*/) {},
};

@ -0,0 +1,23 @@
{
"extends": "@strapi/typescript-utils/tsconfigs/server",
"compilerOptions": {
"outDir": "../../dist/apps/backend/dist",
"rootDir": "."
},
"include": [
"./",
"./**/*.ts",
"./**/*.js",
"src/**/*.json"
],
"exclude": [
"node_modules/",
"build/",
"dist/",
".cache/",
".tmp/",
"src/admin/",
"**/*.test.*",
"src/plugins/**"
]
}
Loading…
Cancel
Save