@raketa-cloud/admin-starter-template 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/.dockerignore +5 -0
  2. package/.github/workflows/build.yml +67 -0
  3. package/.github/workflows/publish.yml +27 -0
  4. package/.gitignore +30 -0
  5. package/.prettierignore +1 -0
  6. package/.vscode/extensions.json +11 -0
  7. package/.vscode/settings.json +30 -0
  8. package/.vscode/tailwind.json +55 -0
  9. package/Dockerfile +20 -0
  10. package/README.md +25 -0
  11. package/babel.config.js +6 -0
  12. package/bin/dev +3 -0
  13. package/bin/docker-build +1 -0
  14. package/bin/docker-run +2 -0
  15. package/bin/pre-push.template +3 -0
  16. package/bin/serve +3 -0
  17. package/bin/setup +9 -0
  18. package/biome.json +24 -0
  19. package/config/base.js +100 -0
  20. package/config/development.js +12 -0
  21. package/config/production.js +13 -0
  22. package/config/staging.js +11 -0
  23. package/package.json +33 -0
  24. package/src/app.js +23 -0
  25. package/src/cloud/.keep +0 -0
  26. package/src/debugRoutes.js +8 -0
  27. package/src/getConfig.js +56 -0
  28. package/src/handlers/.keep +0 -0
  29. package/src/index.js +13 -0
  30. package/src/views/.keep +0 -0
  31. package/static/_assets/flags/bg.svg +5 -0
  32. package/static/_assets/flags/de.svg +5 -0
  33. package/static/_assets/flags/fr.svg +5 -0
  34. package/static/_assets/flags/gb.svg +7 -0
  35. package/static/_assets/flags/it.svg +7 -0
  36. package/static/_assets/flags/us.svg +9 -0
  37. package/static/apple-touch-icon.png +0 -0
  38. package/static/application.css +3804 -0
  39. package/static/favicon-96x96.png +0 -0
  40. package/static/favicon.ico +0 -0
  41. package/static/favicon.svg +14 -0
  42. package/static/site.webmanifest +21 -0
  43. package/static/web-app-manifest-192x192.png +0 -0
  44. package/static/web-app-manifest-512x512.png +0 -0
  45. package/tsconfig.json +12 -0
package/.dockerignore ADDED
@@ -0,0 +1,5 @@
1
+ .git
2
+ node_modules
3
+ Dockerfile
4
+ README.md
5
+ bin/
@@ -0,0 +1,67 @@
1
+ #
2
+ name: Create and publish a Docker image
3
+
4
+ on:
5
+ push:
6
+ branches: ["main"]
7
+
8
+ env:
9
+ REGISTRY: europe-west3-docker.pkg.dev
10
+ IMAGE_NAME: kosmodrum-214909/raketa/${{ github.repository }}
11
+ SSH_HOST: bono.raketadesign.com
12
+ SSH_USER: vestimir
13
+ CONTAINER_NAME: demo-admin
14
+ INTERNAL_PORT: 6969
15
+ EXTERNAL_PORT: 9000
16
+
17
+ jobs:
18
+ build-and-push-image:
19
+ runs-on: ubuntu-latest
20
+
21
+ permissions:
22
+ contents: read
23
+ packages: write
24
+ attestations: write
25
+ id-token: write
26
+
27
+ steps:
28
+ - name: Checkout repository
29
+ uses: actions/checkout@v4
30
+
31
+ - name: Log in to the Container registry
32
+ uses: docker/login-action@v3
33
+ with:
34
+ registry: ${{ env.REGISTRY }}
35
+ username: _json_key_base64
36
+ password: ${{ secrets.GC_ARTIFACT_KEY }}
37
+
38
+ - name: Extract metadata (tags, labels) for Docker
39
+ id: meta
40
+ uses: docker/metadata-action@v5
41
+ with:
42
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
43
+
44
+ - name: Build and push Docker image
45
+ id: push
46
+ uses: docker/build-push-action@v6
47
+ with:
48
+ context: .
49
+ push: true
50
+ tags: ${{ steps.meta.outputs.tags }}
51
+ labels: ${{ steps.meta.outputs.labels }}
52
+
53
+ deploy:
54
+ needs: build-and-push-image
55
+ runs-on: ubuntu-latest
56
+ steps:
57
+ - name: Deploy to remote server
58
+ uses: studioraketa/deploy-docker-ssh@8.0.0
59
+ with:
60
+ ssh_user: ${{ env.SSH_USER }}
61
+ ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
62
+ ssh_host: ${{ env.SSH_HOST }}
63
+ container_name: ${{ env.CONTAINER_NAME }}
64
+ external_port: ${{ env.EXTERNAL_PORT }}
65
+ internal_port: ${{ env.INTERNAL_PORT }}
66
+ image_url: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:main
67
+ docker_environment: -e RAKETA_ENV="production"
@@ -0,0 +1,27 @@
1
+ name: Publish Package to npmjs
2
+ on:
3
+ release:
4
+ types: [published]
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ permissions:
9
+ contents: read
10
+ id-token: write
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - uses: actions/setup-node@v4
15
+ with:
16
+ node-version: "20.x"
17
+ registry-url: "https://registry.npmjs.org"
18
+ cache: "npm"
19
+
20
+ - name: Install dependencies
21
+ run: npm ci
22
+
23
+ - name: Publish package
24
+ working-directory: ./
25
+ run: npm publish --access public
26
+ env:
27
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/.gitignore ADDED
@@ -0,0 +1,30 @@
1
+ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
+
3
+ # Dependencies
4
+ node_modules
5
+ .pnp
6
+ .pnp.js
7
+
8
+ # Testing
9
+ coverage
10
+
11
+ # Turbo
12
+ .turbo
13
+
14
+ # Vercel
15
+ .vercel
16
+
17
+ # Build Outputs
18
+ .next/
19
+ out/
20
+ build
21
+ dist
22
+
23
+ # Debug
24
+ npm-debug.log*
25
+ yarn-debug.log*
26
+ yarn-error.log*
27
+
28
+ # Misc
29
+ .DS_Store
30
+ *.pem
@@ -0,0 +1 @@
1
+ static
@@ -0,0 +1,11 @@
1
+ {
2
+ "recommendations": [
3
+ "christian-kohler.npm-intellisense",
4
+ "esbenp.prettier-vscode",
5
+ "bradlc.vscode-tailwindcss",
6
+ "biomejs.biome",
7
+ "wix.vscode-import-cost",
8
+ "DigitalBrainstem.javascript-ejs-support",
9
+ "j69.ejs-beautify"
10
+ ]
11
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "files.trimTrailingWhitespace": true,
3
+ "editor.tabSize": 2,
4
+ "editor.formatOnSave": true,
5
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
6
+ "files.autoSave": "onFocusChange",
7
+ "editor.rulers": [100],
8
+ "tailwindCSS.includeLanguages": {
9
+ "plaintext": "javascript"
10
+ },
11
+ "emmet.syntaxProfiles": {
12
+ "javascript": "jsx",
13
+ "typescript": "jsx"
14
+ },
15
+ "emmet.includeLanguages": {
16
+ "javascript": "javascriptreact",
17
+ "erb": "html",
18
+ "ejs": "html"
19
+ },
20
+ "editor.codeActionsOnSave": {
21
+ "source.organizeImports.biome": "explicit"
22
+ },
23
+ "[html]": {
24
+ "editor.defaultFormatter": "j69.ejs-beautify"
25
+ },
26
+ "css.customData": [".vscode/tailwind.json"],
27
+ "files.associations": {
28
+ "*.css": "tailwindcss"
29
+ }
30
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "version": 1.1,
3
+ "atDirectives": [
4
+ {
5
+ "name": "@tailwind",
6
+ "description": "Use the `@tailwind` directive to insert Tailwind's `base`, `components`, `utilities` and `screens` styles into your CSS.",
7
+ "references": [
8
+ {
9
+ "name": "Tailwind Documentation",
10
+ "url": "https://tailwindcss.com/docs/functions-and-directives#tailwind"
11
+ }
12
+ ]
13
+ },
14
+ {
15
+ "name": "@apply",
16
+ "description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that you’d like to extract to a new component.",
17
+ "references": [
18
+ {
19
+ "name": "Tailwind Documentation",
20
+ "url": "https://tailwindcss.com/docs/functions-and-directives#apply"
21
+ }
22
+ ]
23
+ },
24
+ {
25
+ "name": "@responsive",
26
+ "description": "You can generate responsive variants of your own classes by wrapping their definitions in the `@responsive` directive:\n```css\n@responsive {\n .alert {\n background-color: #E53E3E;\n }\n}\n```\n",
27
+ "references": [
28
+ {
29
+ "name": "Tailwind Documentation",
30
+ "url": "https://tailwindcss.com/docs/functions-and-directives#responsive"
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ "name": "@screen",
36
+ "description": "The `@screen` directive allows you to create media queries that reference your breakpoints by **name** instead of duplicating their values in your own CSS:\n```css\n@screen sm {\n /* ... */\n}\n```\n…gets transformed into this:\n```css\n@media (min-width: 640px) {\n /* ... */\n}\n```\n",
37
+ "references": [
38
+ {
39
+ "name": "Tailwind Documentation",
40
+ "url": "https://tailwindcss.com/docs/functions-and-directives#screen"
41
+ }
42
+ ]
43
+ },
44
+ {
45
+ "name": "@variants",
46
+ "description": "Generate `hover`, `focus`, `active` and other **variants** of your own utilities by wrapping their definitions in the `@variants` directive:\n```css\n@variants hover, focus {\n .btn-brand {\n background-color: #3182CE;\n }\n}\n```\n",
47
+ "references": [
48
+ {
49
+ "name": "Tailwind Documentation",
50
+ "url": "https://tailwindcss.com/docs/functions-and-directives#variants"
51
+ }
52
+ ]
53
+ }
54
+ ]
55
+ }
package/Dockerfile ADDED
@@ -0,0 +1,20 @@
1
+ FROM node:20-alpine AS build-env
2
+
3
+ RUN mkdir -p /app
4
+ WORKDIR /app
5
+
6
+ COPY ["./package.json", "./package-lock.json", "./"]
7
+ RUN npm install
8
+
9
+ # Copying source files
10
+ COPY . ./
11
+
12
+ FROM node:20-alpine
13
+
14
+ COPY --from=build-env /app /app
15
+
16
+ WORKDIR /app
17
+
18
+ EXPOSE 6969
19
+
20
+ CMD ["npm", "start"]
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # Admin Starter
2
+
3
+ ## Environment setup
4
+
5
+ Install the Node.js version specified in `.tool-versions`.
6
+
7
+ Run `bin/setup` and start the development server with `bin/dev`.
8
+
9
+ ## Editor setup
10
+
11
+ There is a VS Code workspace setup in the project. Please install the recommended extensions and use the suggested settings.
12
+
13
+ ## Formatting and linting
14
+
15
+ You can run `npm run format` to format the whole repo with Prettier (https://prettier.io) and `bin/lint` to lint it with Biome (https://biomejs.dev). If you want to apply auto-fixes run `npm run lint:fix` from the relevant app/package folder, proceed with caution as the project is using the `--apply-unsafe` option.
16
+
17
+ ## Code review guidelines
18
+
19
+ - All new modules should have tests with happy and unhappy paths
20
+ - Do not add expensive third-party dependencies
21
+ - Keep the browser JS to a minimum and as vanilla as possible
22
+
23
+ ## Deployment
24
+
25
+ - tbd
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ presets: [
3
+ ["@babel/preset-env", { targets: { node: "current" } }],
4
+ "@babel/preset-typescript",
5
+ ],
6
+ };
package/bin/dev ADDED
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ npm run dev
@@ -0,0 +1 @@
1
+ docker build . -t new-admin-js
package/bin/docker-run ADDED
@@ -0,0 +1,2 @@
1
+ docker stop new-admin-js || true && docker rm new-admin-js || true
2
+ docker run --name new-admin-js -p 9000:6969 new-admin-js
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ npm run format:check && npm run lint
package/bin/serve ADDED
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ npm run start
package/bin/setup ADDED
@@ -0,0 +1,9 @@
1
+ #!/bin/bash
2
+
3
+ rm -rf node_modules .next
4
+
5
+ cp bin/pre-push.template .git/hooks/pre-push
6
+
7
+ npm install
8
+
9
+ echo -e "🚀 Done. Start the local server with bin/dev"
package/biome.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
3
+ "organizeImports": {
4
+ "enabled": true
5
+ },
6
+ "files": {
7
+ "ignore": ["node_modules", ".git", ".vscode"]
8
+ },
9
+ "formatter": {
10
+ "enabled": false
11
+ },
12
+ "linter": {
13
+ "enabled": true,
14
+ "rules": {
15
+ "recommended": true,
16
+ "security": {
17
+ "noDangerouslySetInnerHtml": "off"
18
+ },
19
+ "complexity": {
20
+ "noForEach": "off"
21
+ }
22
+ }
23
+ }
24
+ }
package/config/base.js ADDED
@@ -0,0 +1,100 @@
1
+ export default {
2
+ i18n: {
3
+ defaultLocale: "en",
4
+ locales: {
5
+ en: {
6
+ name: "English",
7
+ code: "en-gb",
8
+ flag: "/static/_assets/flags/gb.svg",
9
+ },
10
+ bg: {
11
+ name: "Bulgarian",
12
+ code: "bg",
13
+ flag: "/static/_assets/flags/bg.svg",
14
+ },
15
+ de: {
16
+ name: "German",
17
+ code: "de",
18
+ flag: "/static/_assets/flags/de.svg",
19
+ },
20
+ us: {
21
+ name: "English (US)",
22
+ code: "en-us",
23
+ flag: "/static/_assets/flags/us.svg",
24
+ },
25
+ it: {
26
+ name: "Italian",
27
+ code: "it",
28
+ flag: "/static/_assets/flags/it.svg",
29
+ },
30
+ fr: {
31
+ name: "French",
32
+ code: "fr",
33
+ flag: "/static/_assets/flags/fr.svg",
34
+ },
35
+ },
36
+ timezones: [
37
+ { label: "Sofia", value: "Europe/Sofia" },
38
+ { label: "London", value: "Europe/London" },
39
+ { label: "Barcelona", value: "Europe/Madrid" },
40
+ { label: "New York", value: "America/New_York" },
41
+ { label: "Amsterdam", value: "Europe/Amsterdam" },
42
+ { label: "Berlin", value: "Europe/Berlin" },
43
+ { label: "Paris", value: "Europe/Paris" },
44
+ { label: "Vilnius", value: "Europe/Vilnius" },
45
+ ],
46
+ },
47
+ layout: {
48
+ sidebar: [
49
+ {
50
+ icon: "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZT0iY3VycmVudENvbG9yIj4KICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTE5LjUgMTQuMjV2LTIuNjI1YTMuMzc1IDMuMzc1IDAgMCAwLTMuMzc1LTMuMzc1aC0xLjVBMS4xMjUgMS4xMjUgMCAwIDEgMTMuNSA3LjEyNXYtMS41YTMuMzc1IDMuMzc1IDAgMCAwLTMuMzc1LTMuMzc1SDguMjVtMi4yNSAwSDUuNjI1Yy0uNjIxIDAtMS4xMjUuNTA0LTEuMTI1IDEuMTI1djE3LjI1YzAgLjYyMS41MDQgMS4xMjUgMS4xMjUgMS4xMjVoMTIuNzVjLjYyMSAwIDEuMTI1LS41MDQgMS4xMjUtMS4xMjVWMTEuMjVhOSA5IDAgMCAwLTktOVoiIC8+CiAgICAgICAgICAgICAgPC9zdmc+",
51
+ label: "Pages",
52
+ link: "/pages",
53
+ },
54
+ {
55
+ icon: "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZT0iY3VycmVudENvbG9yIj4KICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTEyIDcuNWgxLjVtLTEuNSAzaDEuNW0tNy41IDNoNy41bS03LjUgM2g3LjVtMy05aDMuMzc1Yy42MjEgMCAxLjEyNS41MDQgMS4xMjUgMS4xMjVWMThhMi4yNSAyLjI1IDAgMCAxLTIuMjUgMi4yNU0xNi41IDcuNVYxOGEyLjI1IDIuMjUgMCAwIDAgMi4yNSAyLjI1TTE2LjUgNy41VjQuODc1YzAtLjYyMS0uNTA0LTEuMTI1LTEuMTI1LTEuMTI1SDQuMTI1QzMuNTA0IDMuNzUgMyA0LjI1NCAzIDQuODc1VjE4YTIuMjUgMi4yNSAwIDAgMCAyLjI1IDIuMjVoMTMuNU02IDcuNWgzdjNINnYtM1oiIC8+CiAgICAgICAgICAgICAgPC9zdmc+",
56
+ label: "Articles",
57
+ link: "/articles",
58
+ },
59
+ {
60
+ icon: "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZT0iY3VycmVudENvbG9yIj4KICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZS1saW5lY2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A8cGF0aCBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik0xNSAxMmEzIDMgMCAxIDEtNiAwIDMgMyAwIDAgMSA2IDBaIiAvPgo8L3N2Zz4K",
76
+ label: "Settings",
77
+ submenus: [
78
+ {
79
+ link: "/settings/meta/edit",
80
+ label: "Meta and OpenGraph",
81
+ },
82
+ {
83
+ link: "/settings/layout/edit",
84
+ label: "Layout and Navigation",
85
+ },
86
+ ],
87
+ },
88
+ ],
89
+ },
90
+ helpers: {
91
+ buttons: {
92
+ typeOptions: [
93
+ ["primary", "Primary"],
94
+ ["primary-alt", "Primary (Alt)"],
95
+ ["secondary", "Secondary"],
96
+ ["text", "Text"],
97
+ ],
98
+ },
99
+ },
100
+ };
@@ -0,0 +1,12 @@
1
+ export default {
2
+ cloud: {
3
+ gateway_url: "https://gateway-staging.raketa.cloud",
4
+ gateway_project: "1-raketa-website-dizeip",
5
+ dxp_service_private: "cms-starter-dxp-private",
6
+ gateway_user_pool: "1-raketa-bmktca",
7
+ auth_callback_url: "http://localhost:6969/auth/google/callback",
8
+ images_api_key:
9
+ "841e3f57-4b61-4b7c-b350-8a2f2c108b7b.qMnfOVbPgaMUvQ596XZae12uNYMOMG",
10
+ },
11
+ website_url: "http://localhost:3000",
12
+ };
@@ -0,0 +1,13 @@
1
+ export default {
2
+ cloud: {
3
+ gateway_url: "https://gateway-staging.raketa.cloud",
4
+ gateway_project: "1-raketa-website-dizeip",
5
+ dxp_service_private: "cms-starter-dxp-private",
6
+ gateway_user_pool: "1-raketa-bmktca",
7
+ auth_callback_url:
8
+ "https://demo-admin.raketadesign.com/auth/google/callback",
9
+ images_api_key:
10
+ "841e3f57-4b61-4b7c-b350-8a2f2c108b7b.qMnfOVbPgaMUvQ596XZae12uNYMOMG",
11
+ },
12
+ website_url: "http://localhost:3000",
13
+ };
@@ -0,0 +1,11 @@
1
+ export default {
2
+ cloud: {
3
+ gateway_url: "",
4
+ gateway_project: "",
5
+ dxp_service_private: "",
6
+ gateway_user_pool: "",
7
+ auth_callback_url: "",
8
+ images_api_key: "",
9
+ },
10
+ website_url: "",
11
+ };
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@raketa-cloud/admin-starter-template",
3
+ "version": "1.0.1",
4
+ "files": [
5
+ "*"
6
+ ],
7
+ "scripts": {
8
+ "dev": "RAKETA_ENV=development tsx watch src/index.js",
9
+ "start": "tsx src/index.js",
10
+ "format": "prettier --write .",
11
+ "format:check": "prettier --check .",
12
+ "lint": "biome lint .",
13
+ "lint:fix": "biome lint --write --unsafe .",
14
+ "test": "jest",
15
+ "prepare": "cp ./node_modules/@raketa-cloud/admin/dist/application.css ./static/application.css"
16
+ },
17
+ "dependencies": {
18
+ "@biomejs/biome": "1.8.0",
19
+ "@hono/node-server": "1.11.2",
20
+ "@raketa-cloud/admin": "0.0.103",
21
+ "graphql-request": "7.1.0",
22
+ "hono": "4.6.2",
23
+ "prettier": "^3.3.1"
24
+ },
25
+ "devDependencies": {
26
+ "@babel/core": "7.24.7",
27
+ "@babel/preset-env": "7.24.7",
28
+ "@babel/preset-typescript": "7.24.7",
29
+ "@types/node": "20.11.17",
30
+ "jest": "29.7.0",
31
+ "tsx": "4.7.1"
32
+ }
33
+ }
package/src/app.js ADDED
@@ -0,0 +1,23 @@
1
+ import { serveStatic } from "@hono/node-server/serve-static";
2
+ import {
3
+ HonoAdapter,
4
+ setGlobalContext,
5
+ setupCloud,
6
+ routeStandard,
7
+ } from "@raketa-cloud/admin";
8
+ import { Hono } from "hono";
9
+ import getConfig from "./getConfig";
10
+
11
+ const app = new Hono();
12
+
13
+ app.use("/static/*", serveStatic({ root: "./" }));
14
+
15
+ const honoAdapter = new HonoAdapter(app, getConfig());
16
+
17
+ setGlobalContext(honoAdapter, (ctx) => {
18
+ setupCloud(ctx, getConfig);
19
+ });
20
+
21
+ routeStandard(honoAdapter);
22
+
23
+ export default app;
File without changes
@@ -0,0 +1,8 @@
1
+ import { inspectRoutes } from "hono/dev";
2
+ import app from "./app";
3
+
4
+ const routes = inspectRoutes(app);
5
+
6
+ for (const route of routes) {
7
+ console.log(`\x1b[35m${route.method}\x1b[0m\t${route.path}`);
8
+ }
@@ -0,0 +1,56 @@
1
+ import { buildResourcePath } from "@raketa-cloud/admin";
2
+ import base from "../config/base";
3
+ import development from "../config/development";
4
+ import production from "../config/production";
5
+ import staging from "../config/staging";
6
+
7
+ const PREFIX_MAP = {
8
+ page: "/",
9
+ article: "/blog",
10
+ event: "/events",
11
+ };
12
+
13
+ const configuration = {
14
+ base,
15
+ development,
16
+ production,
17
+ staging,
18
+ };
19
+
20
+ function buildPath(resource, resourceType, locale, defaultLocale) {
21
+ return buildResourcePath({
22
+ prefix_map: PREFIX_MAP,
23
+ resource,
24
+ resourceType,
25
+ locale,
26
+ defaultLocale,
27
+ });
28
+ }
29
+
30
+ function getConfig() {
31
+ const current = configuration[process.env.RAKETA_ENV || "development"];
32
+ const defaultLocale = base.i18n.defaultLocale;
33
+
34
+ return {
35
+ ...base,
36
+ ...current,
37
+ secrets: {
38
+ crypto_secret: "some-super-secret-passowrd-maybe-even-from-an-env",
39
+ },
40
+ remoteConfig: {
41
+ remoteLogin: `${current.website_url}/api/remote/login`,
42
+ remoteLogout: `${current.website_url}/api/remote/logout`,
43
+ resourceUrl: (resource, resourceType, locale) => {
44
+ return [
45
+ current.website_url,
46
+ buildPath(resource, resourceType, locale, defaultLocale),
47
+ ].join("");
48
+ },
49
+ resourcePath: (resource, resourceType, locale) => {
50
+ return buildPath(resource, resourceType, locale, defaultLocale);
51
+ },
52
+ },
53
+ };
54
+ }
55
+
56
+ export default getConfig;
File without changes
package/src/index.js ADDED
@@ -0,0 +1,13 @@
1
+ import { serve } from "@hono/node-server";
2
+ import { logger } from "hono/logger";
3
+ import app from "./app";
4
+
5
+ app.use(logger());
6
+
7
+ const port = 6969;
8
+ console.log(`Server is running on port ${port}`);
9
+
10
+ serve({
11
+ fetch: app.fetch,
12
+ port,
13
+ });
File without changes
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-bg" viewBox="0 0 512 512">
2
+ <path fill="#fff" d="M0 0h512v170.7H0z"/>
3
+ <path fill="#00966e" d="M0 170.7h512v170.6H0z"/>
4
+ <path fill="#d62612" d="M0 341.3h512V512H0z"/>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-de" viewBox="0 0 512 512">
2
+ <path fill="#fc0" d="M0 341.3h512V512H0z"/>
3
+ <path fill="#000001" d="M0 0h512v170.7H0z"/>
4
+ <path fill="red" d="M0 170.7h512v170.6H0z"/>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-fr" viewBox="0 0 512 512">
2
+ <path fill="#fff" d="M0 0h512v512H0z"/>
3
+ <path fill="#000091" d="M0 0h170.7v512H0z"/>
4
+ <path fill="#e1000f" d="M341.3 0H512v512H341.3z"/>
5
+ </svg>