Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vth): add vth-dashboard app #152

Merged
merged 5 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ module.exports = {
'./apps/pdc-frontend/tsconfig.json',
'./apps/pdc-dashboard/tsconfig.json',
'./apps/pdc-dashboard/src/admin/tsconfig.json',
'./apps/vth-dashboard/tsconfig.json',
'./apps/vth-dashboard/src/admin/tsconfig.json',
'./packages/catalogi-data/tsconfig.json',
'./packages/upl/tsconfig.json',
'./packages/samenwerkende-catalogi/tsconfig.json',
Expand Down
5 changes: 5 additions & 0 deletions apps/vth-dashboard/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.cache
build
**/node_modules/**
.cache
.strapi-updater.json
33 changes: 33 additions & 0 deletions apps/vth-dashboard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 🚀 Getting started with Strapi

Strapi comes with a full featured [Command Line Interface](https://docs.strapi.io/developer-docs/latest/developer-resources/cli/CLI.html) (CLI) which lets you scaffold and manage your project in seconds.

## `develop`

Start your Strapi application with autoReload enabled. [Learn more](https://docs.strapi.io/developer-docs/latest/developer-resources/cli/CLI.html#strapi-develop)

```shell
npm run dev
# or
yarn dev
```

### `start`

Start your Strapi application with autoReload disabled. [Learn more](https://docs.strapi.io/developer-docs/latest/developer-resources/cli/CLI.html#strapi-start)

```shell
npm run start
# or
yarn start
```

### `build`

Build your admin panel. [Learn more](https://docs.strapi.io/developer-docs/latest/developer-resources/cli/CLI.html#strapi-build)

```shell
npm run build
# or
yarn build
```
13 changes: 13 additions & 0 deletions apps/vth-dashboard/config/admin.ts
Original file line number Diff line number Diff line change
@@ -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'),
},
},
});
7 changes: 7 additions & 0 deletions apps/vth-dashboard/config/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
rest: {
defaultLimit: 25,
maxLimit: 100,
withCount: true,
},
};
42 changes: 42 additions & 0 deletions apps/vth-dashboard/config/database.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
export default ({ env }) => {
const client = env('DATABASE_CLIENT', 'sqlite');

const connections = {
postgres: {
connection: {
connectionString: env('DATABASE_URL'),
host: env('DATABASE_HOST'),
port: env.int('DATABASE_PORT'),
database: env('DATABASE_NAME'),
user: env('DATABASE_USERNAME'),
password: env('DATABASE_PASSWORD'),
ssl: env.bool('DATABASE_SSL', false) && {
key: env('DATABASE_SSL_KEY', undefined),
cert: env('DATABASE_SSL_CERT', undefined),
ca: env('DATABASE_SSL_CA', undefined),
capath: env('DATABASE_SSL_CAPATH', undefined),
cipher: env('DATABASE_SSL_CIPHER', undefined),
rejectUnauthorized: env.bool('DATABASE_SSL_REJECT_UNAUTHORIZED', true),
},
schema: env('DATABASE_SCHEMA', 'public'),
},
pool: { min: env.int('DATABASE_POOL_MIN', 0), max: env.int('DATABASE_POOL_MAX', 30) },
},
sqlite: {
connection: {
filename: env('DATABASE_FILENAME', '.tmp/data.db'),
useNullAsDefault: true,
debug: false,
},
useNullAsDefault: true,
},
};

return {
connection: {
client,
...connections[client],
acquireConnectionTimeout: env.int('DATABASE_CONNECTION_TIMEOUT', 60000),
},
};
};
12 changes: 12 additions & 0 deletions apps/vth-dashboard/config/middlewares.ts
Original file line number Diff line number Diff line change
@@ -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',
];
46 changes: 46 additions & 0 deletions apps/vth-dashboard/config/plugins.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const { apolloPrometheusPlugin } = require('strapi-prometheus');

export default ({ env }) => ({
ckeditor5: {
enabled: false,
},
'strapi-tiptap-editor': {
enabled: true,
},
'strapi-prometheus': {
enabled: true,
graphql: {
enabled: true,
config: {
apolloServer: {
plugins: [apolloPrometheusPlugin], // add the plugin to get apollo metrics
tracing: true, // this must be true to get some of the data needed to create the metrics
},
},
},
},
slugify: {
enabled: true,
config: {
shouldUpdateSlug: true,
contentTypes: {
product: {
field: 'slug',
references: 'title',
},
},
},
},
upload: {
config: {
providerOptions: {
localServer: {
maxage: 300000,
},
},
},
},
publisher: {
enabled: true,
},
});
10 changes: 10 additions & 0 deletions apps/vth-dashboard/config/server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default ({ env }) => ({
host: env('HOST', '0.0.0.0'),
port: env.int('PORT', 1337),
app: {
keys: env.array('APP_KEYS'),
},
webhooks: {
populateRelations: env.bool('WEBHOOKS_POPULATE_RELATIONS', false),
},
});
Empty file.
Binary file added apps/vth-dashboard/favicon.ico
Binary file not shown.
46 changes: 46 additions & 0 deletions apps/vth-dashboard/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "@frameless/vth-dashboard",
"private": false,
"version": "0.1.0",
"description": "A Strapi application",
"keywords": [],
"scripts": {
"dev": "strapi develop",
"develop:watch": "strapi develop --watch-admin",
"start": "strapi start",
"prebuild": "npm run clean",
"build": "strapi build",
"strapi": "strapi",
"lint": "eslint --ext .js src",
"lint:fix": "eslint --ext .js src --fix",
"clean": "rimraf build .cache dist"
},
"dependencies": {
"@frameless/strapi-tiptap-editor": "0.0.0-semantically-released",
"@strapi/plugin-graphql": "4.10.5",
"@strapi/plugin-i18n": "4.10.5",
"@strapi/plugin-users-permissions": "4.10.5",
"@strapi/strapi": "4.10.5",
"better-sqlite3": "8.3.0",
"pg": "8.11.0",
"slugify": "1.6.6",
"strapi-plugin-publisher": "1.3.4",
"strapi-plugin-slugify": "2.3.2",
"strapi-prometheus": "1.5.0"
},
"author": {
"name": ""
},
"strapi": {
"uuid": "3d9f46d7-679c-4633-8821-761d8bbb5bea"
},
"engines": {
"node": "18.x.x"
},
"license": "MIT",
"devDependencies": {
"node-sass": "8.0.0",
"sass-loader": "13.2.2",
"scss": "0.2.4"
}
}
Empty file.
27 changes: 27 additions & 0 deletions apps/vth-dashboard/src/admin/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const config = {
locales: ['nl', 'en'],
notifications: {
releases: false,
},
translations: {
en: {
'app.components.HomePage.welcome': 'Welcome 👋',
},
nl: {
'app.components.HomePage.welcome': 'Welkom 👋',
'content-manager.popUpWarning.warning.has-draft-relations.title': 'Bevestiging',
'content-manager.popUpWarning.warning.publish-question': 'Wil je nog steeds publiceren?',
'content-manager.popUpWarning.warning.unpublish-question': 'Weet je zeker dat je het niet wilt publiceren?',
'content-manager.popUpWarning.warning.unpublish':
'Als je deze inhoud niet publiceert, wordt deze automatisch een concept.',
'content-manager.popUpWarning.warning.updateAllSettings': 'Dit zal al je instellingen wijzigen.',
},
},
};

const bootstrap = () => {};

export default {
config,
bootstrap,
};
5 changes: 5 additions & 0 deletions apps/vth-dashboard/src/admin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "@strapi/typescript-utils/tsconfigs/admin",
"include": ["../../../../packages/**/**/admin/src/**/*", "./"],
"exclude": ["node_modules/", "build/", "dist/", "**/*.test.ts"]
}
26 changes: 26 additions & 0 deletions apps/vth-dashboard/src/admin/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use strict';

module.exports = (config, webpack) => {
config.plugins.push(
new webpack.NormalModuleReplacementPlugin(/^tippy\.js$/, 'tippy.js/dist/tippy-bundle.umd.min.js'),
);
// Allow scss modules
config.resolve = {
...config.resolve,
extensions: [...config.resolve.extensions, '.scss'],
};

// Configure a SASS loader
config.module.rules.push({
test: /\.s[ac]ss$/i,
use: [
'style-loader',
'css-loader',
'sass-loader',
{
loader: 'sass-loader',
},
],
});
return config;
};
Empty file.
38 changes: 38 additions & 0 deletions apps/vth-dashboard/src/api/faq/content-types/faq/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"kind": "collectionType",
"collectionName": "faqs",
"info": {
"singularName": "faq",
"pluralName": "faqs",
"displayName": "FAQ",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {
"i18n": {
"localized": true
}
},
"attributes": {
"faq": {
"type": "component",
"repeatable": false,
"component": "sections.faq-section",
"pluginOptions": {
"i18n": {
"localized": true
}
}
},
"title": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string"
}
}
}
9 changes: 9 additions & 0 deletions apps/vth-dashboard/src/api/faq/controllers/faq.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* faq controller
*/

const { createCoreController } = require('@strapi/strapi').factories;

module.exports = createCoreController('api::faq.faq');
9 changes: 9 additions & 0 deletions apps/vth-dashboard/src/api/faq/routes/faq.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* faq router
*/

const { createCoreRouter } = require('@strapi/strapi').factories;

module.exports = createCoreRouter('api::faq.faq');
9 changes: 9 additions & 0 deletions apps/vth-dashboard/src/api/faq/services/faq.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* faq service
*/

const { createCoreService } = require('@strapi/strapi').factories;

module.exports = createCoreService('api::faq.faq');
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"kind": "singleType",
"collectionName": "not_found_pages",
"info": {
"singularName": "not-found-page",
"pluralName": "not-found-pages",
"displayName": "Not Found Page",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {
"i18n": {
"localized": true
}
},
"attributes": {
"title": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string"
},
"body": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "richtext"
}
}
}
Loading