@ozdao/martyrs 0.2.586 → 0.2.587

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 (147) hide show
  1. package/dist/auth.server.js +14 -1
  2. package/dist/chats.server.js +1 -1
  3. package/dist/community.server.js +1 -1
  4. package/dist/core.server.js +24 -25
  5. package/dist/events.server.js +1 -1
  6. package/dist/files.server.js +1 -1
  7. package/dist/gallery.server.js +1 -1
  8. package/dist/inventory.server.js +1 -1
  9. package/dist/marketplace.server.js +1 -1
  10. package/dist/martyrs/src/components/Feed/Carousel.vue.js +1 -1
  11. package/dist/martyrs/src/components/Feed/Feed.vue.js +2 -2
  12. package/dist/martyrs/src/components/Loader/{Loader.vue.js → Loader.vue2.js} +2 -2
  13. package/dist/martyrs/src/components/Loader/Loader.vue2.js.map +1 -0
  14. package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue.js +1 -1
  15. package/dist/martyrs/src/components/Media/Media.vue.js +1 -1
  16. package/dist/martyrs/src/components/Menu/{Menu.vue.js → Menu.vue2.js} +2 -2
  17. package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +1 -0
  18. package/dist/martyrs/src/components/Select/{Select.vue.js → Select.vue2.js} +2 -2
  19. package/dist/martyrs/src/components/Select/Select.vue2.js.map +1 -0
  20. package/dist/martyrs/src/components/Spoiler/{Spoiler.vue.js → Spoiler.vue2.js} +2 -2
  21. package/dist/martyrs/src/components/Spoiler/Spoiler.vue2.js.map +1 -0
  22. package/dist/martyrs/src/components/UploadImage/UploadImage.vue.js +1 -1
  23. package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
  24. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +1 -1
  25. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js +1 -1
  26. package/dist/martyrs/src/modules/community/components/layouts/Community.vue.js +1 -1
  27. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +1 -1
  28. package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +1 -1
  29. package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +1 -1
  30. package/dist/martyrs/src/modules/core/views/components/pages/404.vue.js +10 -33
  31. package/dist/martyrs/src/modules/core/views/components/pages/404.vue.js.map +1 -1
  32. package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js +1 -1
  33. package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js +1 -1
  34. package/dist/martyrs/src/modules/core/views/components/sections/{Filters.vue.js → Filters.vue2.js} +2 -2
  35. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js.map +1 -0
  36. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  37. package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +2 -2
  38. package/dist/martyrs/src/modules/events/components/sections/Feed.vue.js +1 -1
  39. package/dist/martyrs/src/modules/events/components/sections/List.vue.js +1 -1
  40. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  41. package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +1 -1
  42. package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +1 -1
  43. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +1 -1
  44. package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.js +1 -1
  45. package/dist/martyrs/src/modules/marketplace/views/components/pages/Marketplace.vue.js +1 -1
  46. package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js +1 -1
  47. package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +1 -1
  48. package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +2 -2
  49. package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +1 -1
  50. package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +1 -1
  51. package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +1 -1
  52. package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +1 -1
  53. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +1 -1
  54. package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +1 -1
  55. package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js +1 -1
  56. package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +1 -1
  57. package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +1 -1
  58. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  59. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +2 -2
  60. package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  61. package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
  62. package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +1 -1
  63. package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +1 -1
  64. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  65. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
  66. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
  67. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  68. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
  69. package/dist/martyrs/src/modules/products/components/elements/Image360.vue.js +1 -1
  70. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +3 -3
  71. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  72. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +2 -2
  73. package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +1 -1
  74. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +1 -1
  75. package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  76. package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  77. package/dist/martyrs/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
  78. package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
  79. package/dist/martyrs/src/modules/spots/components/pages/Spot.vue.js +1 -1
  80. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +1 -1
  81. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +1 -1
  82. package/dist/notifications.server.js +1 -1
  83. package/dist/orders.server.js +1 -1
  84. package/dist/organizations.server.js +1 -1
  85. package/dist/pages.server.js +1 -1
  86. package/dist/products.server.js +1 -1
  87. package/dist/rents.server.js +1 -1
  88. package/dist/reports.server.js +1 -1
  89. package/dist/spots.server.js +1 -1
  90. package/dist/style.css +2 -2
  91. package/dist/wallet.server.js +1 -1
  92. package/package.json +2 -4
  93. package/src/modules/auth/auth.server.js +15 -1
  94. package/src/modules/chats/chats.server.js +1 -1
  95. package/src/modules/community/community.server.js +1 -1
  96. package/src/modules/core/core.server.js +4 -31
  97. package/src/modules/core/models/log.model.js +24 -0
  98. package/src/modules/core/views/components/pages/404.vue +2 -3
  99. package/src/modules/events/events.server.js +1 -1
  100. package/src/modules/files/files.server.js +1 -1
  101. package/src/modules/gallery/gallery.server.js +1 -1
  102. package/src/modules/governance/governance.server.js +1 -1
  103. package/src/modules/icons/icons.server.js +1 -1
  104. package/src/modules/inventory/inventory.server.js +1 -1
  105. package/src/modules/marketplace/marketplace.server.js +1 -1
  106. package/src/modules/notifications/notifications.server.js +1 -1
  107. package/src/modules/orders/orders.server.js +1 -1
  108. package/src/modules/organizations/organizations.server.js +1 -1
  109. package/src/modules/pages/pages.server.js +1 -1
  110. package/src/modules/products/products.server.js +1 -1
  111. package/src/modules/rents/rents.server.js +1 -1
  112. package/src/modules/reports/reports.server.js +1 -1
  113. package/src/modules/spots/spots.server.js +1 -1
  114. package/src/modules/wallet/wallet.server.js +1 -1
  115. package/dist/martyrs/src/components/Loader/Loader.vue.js.map +0 -1
  116. package/dist/martyrs/src/components/Menu/Menu.vue.js.map +0 -1
  117. package/dist/martyrs/src/components/Select/Select.vue.js.map +0 -1
  118. package/dist/martyrs/src/components/Spoiler/Spoiler.vue.js.map +0 -1
  119. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue.js.map +0 -1
  120. package/src/cli/commands/create.js +0 -106
  121. package/src/cli/index.js +0 -25
  122. package/src/cli/templates/app/.env.development.mustache +0 -14
  123. package/src/cli/templates/app/.env.production.mustache +0 -14
  124. package/src/cli/templates/app/Dockerfile +0 -36
  125. package/src/cli/templates/app/babel.config.js +0 -14
  126. package/src/cli/templates/app/env.js +0 -3
  127. package/src/cli/templates/app/index.js +0 -46
  128. package/src/cli/templates/app/mongodb.config.js +0 -18
  129. package/src/cli/templates/app/package.json.mustache +0 -65
  130. package/src/cli/templates/app/src/client.js +0 -22
  131. package/src/cli/templates/app/src/components/pages/Index.vue +0 -11
  132. package/src/cli/templates/app/src/configs/global.config.js.mustache +0 -40
  133. package/src/cli/templates/app/src/localization/extensions.js +0 -2
  134. package/src/cli/templates/app/src/localization/index.js +0 -44
  135. package/src/cli/templates/app/src/localization/overrides.js +0 -2
  136. package/src/cli/templates/app/src/localization/translations.js +0 -10
  137. package/src/cli/templates/app/src/models/index.js +0 -9
  138. package/src/cli/templates/app/src/router/index.js +0 -48
  139. package/src/cli/templates/app/src/scss/theme.scss +0 -18
  140. package/src/cli/templates/app/src/server.js +0 -68
  141. package/src/cli/templates/app/src/store/index.js +0 -9
  142. package/src/cli/templates/docker-compose.yaml.mustache +0 -47
  143. package/src/cli/templates/nginx/Dockerfile +0 -5
  144. package/src/cli/templates/nginx/default.conf.mustache +0 -55
  145. package/src/cli/templates/public/favicon/.gitkeep +0 -0
  146. package/src/cli/templates/start-dev.sh.mustache +0 -131
  147. package/src/cli/templates/start-prod.sh.mustache +0 -12
@@ -1,46 +0,0 @@
1
- import './env.js';
2
- import path from 'path';
3
- import { fileURLToPath } from 'url';
4
- import { rspack } from '@rspack/core';
5
-
6
- const __filename = fileURLToPath(import.meta.url);
7
- const projectRoot = path.dirname(__filename);
8
-
9
- const command = process.argv[2];
10
- const MODE = process.env.MODE || 'SSR';
11
- const isDev = process.env.NODE_ENV !== 'production';
12
-
13
- import {
14
- createSsrRspackDevServer,
15
- createSsrProdServer,
16
- createSpaRspackDevServer,
17
- createSpaProdServer,
18
- rspackConfigs
19
- } from '@ozdao/martyrs/builder';
20
- import createServer from './src/server.js';
21
-
22
- const configs = {
23
- api: rspackConfigs.apiConfig(projectRoot),
24
- spa: rspackConfigs.spaConfig(projectRoot),
25
- client: rspackConfigs.clientConfig(projectRoot),
26
- ssr: rspackConfigs.ssrConfig(projectRoot)
27
- };
28
-
29
- if (command === 'build') {
30
- const toBuild = MODE === 'SSR' ? [configs.client, configs.ssr] : [configs.spa];
31
-
32
- for (const config of toBuild) {
33
- const compiler = rspack(config);
34
- await new Promise(resolve => compiler.run(() => compiler.close(resolve)));
35
- }
36
-
37
- console.log('Build done');
38
- process.exit(0);
39
- }
40
-
41
- const serverFunc = MODE === 'SSR'
42
- ? (isDev ? createSsrRspackDevServer : createSsrProdServer)
43
- : (isDev ? createSpaRspackDevServer : createSpaProdServer);
44
-
45
- const start = serverFunc(projectRoot, configs, createServer);
46
- start();
@@ -1,18 +0,0 @@
1
- let adressDB = process.env.DB_ADDRESS;
2
-
3
- import db from "./src/models/index.js";
4
-
5
- db.mongoose
6
- .connect(adressDB, {
7
- connectTimeoutMS: 20000,
8
- socketTimeoutMS: 50000,
9
- })
10
- .then(() => {
11
- console.log("Successfully connect to MongoDB.");
12
- })
13
- .catch(err => {
14
- console.error("Connection error", err);
15
- process.exit();
16
- });
17
-
18
- export default db;
@@ -1,65 +0,0 @@
1
- {
2
- "name": "{{projectName}}",
3
- "version": "0.0.1",
4
- "description": "Project created with @ozdao/martyrs",
5
- "author": "",
6
- "license": "ISC",
7
- "private": true,
8
- "type": "module",
9
- "main": "./index.js",
10
- "scripts": {
11
- "preinstall": "npx only-allow pnpm",
12
- "dev": "NODE_ENV=development node --loader esm-module-alias/loader index.js",
13
- "dev:spa": "NODE_ENV=development MODE=SPA node --loader esm-module-alias/loader index.js",
14
- "dev:nginx": "../start-dev.sh",
15
- "build": "NODE_ENV=production node --loader esm-module-alias/loader index.js build",
16
- "build:spa": "NODE_ENV=production MODE=SPA node --loader esm-module-alias/loader index.js build",
17
- "start": "NODE_ENV=production node --loader esm-module-alias/loader index.js",
18
- "start:nginx": "../start-prod.sh"
19
- },
20
- "dependencies": {
21
- "@ozdao/martyrs": "{{martyrsVersion}}",
22
- "@rspack/cli": "1.5.3",
23
- "@unhead/ssr": "1.9.16",
24
- "@unhead/vue": "1.9.16",
25
- "@vue/compiler-sfc": "3.4.38",
26
- "@vue/server-renderer": "3.5.13",
27
- "axios": "1.7.4",
28
- "cookie-parser": "1.4.6",
29
- "cors": "2.8.5",
30
- "express": "4.19.2",
31
- "js-cookie": "3.0.5",
32
- "mongodb": "6.8.0",
33
- "mongoose": "8.5.3",
34
- "mustache": "4.2.0",
35
- "uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.56.0",
36
- "vue": "3.5.13",
37
- "vue-i18n": "9.14.0",
38
- "vue-router": "4.4.3",
39
- "webpack-dev-middleware": "7.3.0"
40
- },
41
- "devDependencies": {
42
- "@babel/core": "7.25.2",
43
- "@babel/plugin-transform-runtime": "7.24.7",
44
- "@babel/preset-env": "7.25.3",
45
- "@babel/preset-flow": "7.24.7",
46
- "@babel/runtime": "7.27.0",
47
- "@rspack/core": "1.5.3",
48
- "babel-loader": "9.1.3",
49
- "body-parser": "1.20.2",
50
- "core-js": "3.38.0",
51
- "css-loader": "7.1.2",
52
- "dotenv": "16.4.5",
53
- "esm-module-alias": "2.2.1",
54
- "only-allow": "1.2.1",
55
- "sass": "1.77.8",
56
- "sass-loader": "16.0.0",
57
- "vue-loader": "17.4.2"
58
- },
59
- "aliases": {
60
- "@": "./src"
61
- },
62
- "_moduleAliases": {
63
- "@": "./src"
64
- }
65
- }
@@ -1,22 +0,0 @@
1
- import 'martyrs-jit.css';
2
- import '@/scss/theme.scss';
3
-
4
- import { createUniversalApp } from '@ozdao/martyrs/modules/core/client';
5
-
6
- import { getConfig } from '@/configs/global.config.js';
7
- import { getRouter } from '@/router/index.js';
8
- import { getStore } from '@/store/index.js';
9
- import { getLocales } from '@/localization/index.js';
10
-
11
- const appPromise = createUniversalApp({
12
- getConfig,
13
- getRouter,
14
- getLocales,
15
- getStore,
16
- });
17
-
18
- export async function _renderApp({ url, cookies, languages, ssrContext }) {
19
- const { renderApp } = await appPromise;
20
-
21
- return renderApp({ url, cookies, languages, ssrContext });
22
- }
@@ -1,11 +0,0 @@
1
- <template>
2
- <div class="wrapper pd-medium">
3
- <div class="flex flex-column gap-medium align-center justify-center h-100vh">
4
- <h1 class="t-center">{{ $t('welcome') }}</h1>
5
- <p class="t-dark-semi t-center">Your martyrs project is ready!</p>
6
- </div>
7
- </div>
8
- </template>
9
-
10
- <script setup>
11
- </script>
@@ -1,40 +0,0 @@
1
- export async function getConfig() {
2
- return {
3
- env: {
4
- isMobileApp: process.env.MOBILE_APP || false,
5
- },
6
-
7
- core: {
8
- websocket: true,
9
- },
10
-
11
- app: {
12
- support: {
13
- url: 'https://t.me/support'
14
- },
15
- messages: {
16
- en: {
17
- meta: {
18
- title: '{{projectName}}',
19
- description: 'Project built with @ozdao/martyrs',
20
- },
21
- },
22
- ru: {
23
- meta: {
24
- title: '{{projectName}}',
25
- description: 'Проект на @ozdao/martyrs',
26
- },
27
- }
28
- }
29
- },
30
-
31
- modules: {
32
- auth: {
33
- loader: () => import('@ozdao/martyrs/modules/auth/client'),
34
- routes: ['/'],
35
- priority: 'high',
36
- dependencies: []
37
- },
38
- },
39
- };
40
- }
@@ -1,2 +0,0 @@
1
- export default {
2
- };
@@ -1,44 +0,0 @@
1
- import { createI18n } from 'vue-i18n';
2
- import { i18nManager } from '@ozdao/martyrs/modules/core/client';
3
-
4
- import translations from './translations.js';
5
- import overrides from './overrides.js';
6
- import extensions from './extensions.js';
7
-
8
- const supportedLocales = {
9
- en: "🇬🇧 EN",
10
- ru: "🇷🇺 RU"
11
- };
12
-
13
- export function getLocales() {
14
- if (translations) {
15
- Object.entries(translations).forEach(([module, locales]) => {
16
- i18nManager.register(module, locales);
17
- });
18
- }
19
-
20
- if (extensions) {
21
- Object.entries(extensions).forEach(([module, locales]) => {
22
- i18nManager.extend(module, locales);
23
- });
24
- }
25
-
26
- if (overrides) {
27
- Object.entries(overrides).forEach(([module, locales]) => {
28
- i18nManager.override(module, locales);
29
- });
30
- }
31
-
32
- const messages = i18nManager.getAllMessages();
33
-
34
- const i18n = createI18n({
35
- legacy: false,
36
- locale: 'en',
37
- fallbackLocale: 'en',
38
- messages,
39
- globalInjection: true,
40
- availableLocales: Object.keys(supportedLocales),
41
- });
42
-
43
- return i18n;
44
- }
@@ -1,2 +0,0 @@
1
- export default {
2
- };
@@ -1,10 +0,0 @@
1
- export default {
2
- app: {
3
- en: {
4
- welcome: 'Welcome',
5
- },
6
- ru: {
7
- welcome: 'Добро пожаловать',
8
- }
9
- }
10
- };
@@ -1,9 +0,0 @@
1
- import mongoose from 'mongoose';
2
-
3
- mongoose.Promise = global.Promise;
4
-
5
- const db = { mongoose: mongoose };
6
-
7
- db.ROLES = ["user", "admin", "moderator"];
8
-
9
- export default db;
@@ -1,48 +0,0 @@
1
- import {
2
- createRouter,
3
- createMemoryHistory,
4
- createWebHistory,
5
- } from 'vue-router';
6
-
7
- import { scrollBehavior, layoutClient, Header, Sidebar, Navigation, NavigationBar } from '@ozdao/martyrs/modules/core/client';
8
-
9
- const isServer = typeof window === 'undefined';
10
-
11
- let history = isServer ? createMemoryHistory() : createWebHistory();
12
-
13
- const routes = [{
14
- path: '/:locale?',
15
-
16
- components: {
17
- default: layoutClient
18
- },
19
-
20
- name: 'Home',
21
-
22
- meta: {
23
- header: Header,
24
- sidebar: Sidebar,
25
- sidebar_navigation: Navigation,
26
- navigationbar: NavigationBar,
27
- },
28
-
29
- children: [{
30
- path: '',
31
- name: "Index",
32
- meta: {
33
- title: {
34
- en: 'Home',
35
- ru: 'Главная'
36
- },
37
- },
38
- component: () => import('@/components/pages/Index.vue'),
39
- }]
40
- }];
41
-
42
- export function getRouter() {
43
- return createRouter({
44
- routes,
45
- history,
46
- scrollBehavior
47
- });
48
- }
@@ -1,18 +0,0 @@
1
- @import '/node_modules/@ozdao/martyrs/dist/style.css';
2
- @import '/node_modules/@ozdao/martyrs/src/styles/theme.scss';
3
-
4
- :root {
5
- color-scheme: light dark;
6
-
7
- --main: 59, 130, 246;
8
- --second: 139, 92, 246;
9
- --third: 34, 197, 94;
10
-
11
- --black: 0, 0, 0;
12
- --dark: 64, 64, 64;
13
- --grey: 156, 163, 175;
14
- --light: 243, 244, 246;
15
- --white: 255, 255, 255;
16
-
17
- --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
18
- }
@@ -1,68 +0,0 @@
1
- import path from 'path';
2
- import express from 'express';
3
- import cors from 'cors';
4
- import cookies from 'cookie-parser';
5
- import http from 'http';
6
- import dotenv from 'dotenv';
7
- import { fileURLToPath } from 'url';
8
-
9
- import core from '@ozdao/martyrs/modules/core/server';
10
- import auth from '@ozdao/martyrs/modules/auth/server';
11
- import db from '../mongodb.config.js';
12
-
13
- const __filename = fileURLToPath(import.meta.url);
14
- const __dirname = path.dirname(__filename);
15
-
16
- dotenv.config({ path: `.env.${process.env.NODE_ENV}` });
17
-
18
- const port = process.env.PORT || 8080;
19
- const publicPath = path.join(__dirname, '../../public');
20
-
21
- const createServer = async () => {
22
- const app = express();
23
-
24
- const allowedOrigins = [
25
- process.env.API_URL,
26
- 'http://localhost',
27
- 'http://localhost:8080',
28
- 'http://localhost:8040',
29
- 'http://localhost:8041',
30
- 'http://localhost:3000',
31
- ];
32
-
33
- app.use(cors({
34
- credentials: true,
35
- origin: (origin, callback) => {
36
- if (allowedOrigins.includes(origin) || !origin) {
37
- callback(null, true);
38
- } else {
39
- callback(new Error('Origin not allowed by CORS'));
40
- }
41
- },
42
- }));
43
-
44
- app.set("trust proxy", 1);
45
- app.use(express.json());
46
- app.use(express.urlencoded({ extended: true }));
47
- app.use(cookies());
48
- app.use(express.static(path.resolve(__dirname, "../../public")));
49
-
50
- const server = http.createServer(app);
51
-
52
- const wss = await core.WebSocketManager();
53
-
54
- wss.listen(process.env.PORT_WSS || 8020, () => {
55
- console.log(`WebSocket server listening on port ${process.env.PORT_WSS || 8020}`);
56
- });
57
-
58
- core.initialize(app, db, allowedOrigins, publicPath);
59
- auth.initialize(app, db, allowedOrigins, publicPath);
60
-
61
- return { app, server };
62
- };
63
-
64
- export { createServer };
65
-
66
- export default {
67
- createServer
68
- };
@@ -1,9 +0,0 @@
1
- import { useStore } from '@ozdao/martyrs/modules/core/client';
2
-
3
- export function getStore() {
4
- return useStore();
5
- }
6
-
7
- export { useStore };
8
-
9
- export default useStore();
@@ -1,47 +0,0 @@
1
- services:
2
- {{projectNameLower}}:
3
- restart: always
4
- build:
5
- context: .
6
- dockerfile: ./app/Dockerfile
7
- container_name: {{projectNameLower}}
8
- hostname: {{projectNameLower}}
9
- logging:
10
- driver: "json-file"
11
- options:
12
- max-size: "200m"
13
- max-file: "10"
14
- environment:
15
- - NODE_ENV=production
16
- - API_URL=http://localhost
17
- - PORT=8080
18
- ports:
19
- - "8080:8080"
20
- networks:
21
- - app-net
22
- volumes:
23
- - './public:/public'
24
- - builds_web:/app/builds/web/client
25
-
26
- nginx:
27
- image: nginx:1.27-alpine
28
- restart: unless-stopped
29
- container_name: nginx_{{projectNameLower}}
30
- hostname: nginx_{{projectNameLower}}
31
- volumes:
32
- - './public:/usr/share/nginx/html:ro'
33
- - builds_web:/usr/share/nginx/builds:ro
34
- - './nginx/default.conf:/etc/nginx/conf.d/default.conf:ro'
35
- networks:
36
- - app-net
37
- depends_on:
38
- - {{projectNameLower}}
39
- ports:
40
- - "80:80"
41
-
42
- networks:
43
- app-net:
44
- driver: bridge
45
-
46
- volumes:
47
- builds_web:
@@ -1,5 +0,0 @@
1
- FROM nginx
2
-
3
- COPY ./default.conf /etc/nginx/conf.d/
4
-
5
- CMD ["nginx", "-g", "daemon off;"]
@@ -1,55 +0,0 @@
1
- client_max_body_size 100M;
2
-
3
- gzip on;
4
- gzip_vary on;
5
- gzip_proxied any;
6
- gzip_comp_level 6;
7
- gzip_buffers 16 8k;
8
- gzip_http_version 1.1;
9
- gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
10
-
11
- server {
12
- listen 80;
13
- server_name localhost;
14
- server_tokens off;
15
- client_max_body_size 100M;
16
-
17
- location ~ \.(js|json|css|map)$ {
18
- root /usr/share/nginx/builds;
19
- access_log off;
20
- expires max;
21
- add_header Cache-Control "public, immutable";
22
- }
23
-
24
- location / {
25
- root /usr/share/nginx/html;
26
- try_files $uri @backend;
27
- }
28
-
29
- location @backend {
30
- proxy_pass http://{{projectNameLower}}:8080;
31
- proxy_http_version 1.1;
32
- proxy_set_header Host $host;
33
- proxy_buffers 8 16k;
34
- proxy_buffer_size 16k;
35
- proxy_set_header Cookie $http_cookie;
36
- proxy_set_header X-NginX-Proxy true;
37
- proxy_set_header X-Real-IP $remote_addr;
38
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
39
- proxy_set_header X-Forwarded-Proto https;
40
- proxy_read_timeout 86400;
41
- }
42
-
43
- location /api/ws {
44
- proxy_pass http://{{projectNameLower}}:8020;
45
- proxy_http_version 1.1;
46
- proxy_set_header Upgrade $http_upgrade;
47
- proxy_set_header Connection "upgrade";
48
- proxy_set_header Host $host;
49
- proxy_set_header X-Real-IP $remote_addr;
50
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
51
- proxy_set_header X-Forwarded-Proto $scheme;
52
- proxy_read_timeout 86400;
53
- proxy_buffering off;
54
- }
55
- }
File without changes
@@ -1,131 +0,0 @@
1
- #!/bin/bash
2
-
3
- echo "Checking ports..."
4
- lsof -ti:{{port}} | xargs kill -9 2>/dev/null
5
- lsof -ti:{{portNginx}} | xargs kill -9 2>/dev/null
6
- lsof -ti:{{portWss}} | xargs kill -9 2>/dev/null
7
-
8
- cd "$(dirname "$0")/app"
9
-
10
- echo "Starting development app on port {{port}}..."
11
- NODE_ENV=development PORT={{port}} PORT_WSS={{portWss}} node --loader esm-module-alias/loader index.js &
12
- APP_PID=$!
13
-
14
- echo "Waiting for app to start..."
15
- sleep 5
16
-
17
- if ! kill -0 $APP_PID 2>/dev/null; then
18
- echo "Error: App failed to start"
19
- exit 1
20
- fi
21
-
22
- PROJECT_ROOT="$(dirname "$0")"
23
-
24
- cat > /tmp/nginx-dev.conf <<EOF
25
- worker_processes auto;
26
- error_log /tmp/nginx-error.log warn;
27
- pid /tmp/nginx.pid;
28
-
29
- events {
30
- worker_connections 1024;
31
- }
32
-
33
- http {
34
- default_type application/octet-stream;
35
-
36
- types {
37
- text/html html htm shtml;
38
- text/css css;
39
- text/xml xml;
40
- application/javascript js;
41
- application/json json;
42
- image/gif gif;
43
- image/jpeg jpeg jpg;
44
- image/png png;
45
- image/svg+xml svg svgz;
46
- image/webp webp;
47
- font/woff woff;
48
- font/woff2 woff2;
49
- application/x-font-ttf ttf;
50
- application/vnd.ms-fontobject eot;
51
- }
52
-
53
- client_max_body_size 100M;
54
-
55
- gzip on;
56
- gzip_vary on;
57
- gzip_proxied any;
58
- gzip_comp_level 6;
59
- gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript;
60
-
61
- server {
62
- listen {{portNginx}};
63
- server_name localhost;
64
-
65
- location ~ \.(js|json|css|map)$ {
66
- proxy_pass http://127.0.0.1:{{port}};
67
- proxy_http_version 1.1;
68
- proxy_set_header Host \$host;
69
- proxy_set_header X-Real-IP \$remote_addr;
70
- proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
71
- proxy_set_header X-Forwarded-Proto \$scheme;
72
- proxy_buffering off;
73
- proxy_cache off;
74
- }
75
-
76
- location / {
77
- root $PROJECT_ROOT/public;
78
- try_files \$uri @backend;
79
- }
80
-
81
- location @backend {
82
- proxy_pass http://127.0.0.1:{{port}};
83
- proxy_http_version 1.1;
84
- proxy_set_header Upgrade \$http_upgrade;
85
- proxy_set_header Connection "upgrade";
86
- proxy_set_header Host \$host;
87
- proxy_set_header X-Real-IP \$remote_addr;
88
- proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
89
- proxy_set_header X-Forwarded-Proto \$scheme;
90
- proxy_read_timeout 86400;
91
- }
92
-
93
- location /ws {
94
- proxy_pass http://127.0.0.1:{{port}};
95
- proxy_http_version 1.1;
96
- proxy_set_header Upgrade \$http_upgrade;
97
- proxy_set_header Connection "upgrade";
98
- proxy_read_timeout 86400;
99
- }
100
-
101
- location /api/ws {
102
- proxy_pass http://127.0.0.1:{{portWss}};
103
- proxy_http_version 1.1;
104
- proxy_set_header Upgrade \$http_upgrade;
105
- proxy_set_header Connection "upgrade";
106
- proxy_set_header Host \$host;
107
- proxy_set_header X-Real-IP \$remote_addr;
108
- proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
109
- proxy_set_header X-Forwarded-Proto \$scheme;
110
- proxy_read_timeout 86400;
111
- proxy_buffering off;
112
- }
113
- }
114
- }
115
- EOF
116
-
117
- echo "Starting nginx on port {{portNginx}}..."
118
- nginx -c /tmp/nginx-dev.conf
119
-
120
- echo ""
121
- echo "================================="
122
- echo "Development server started!"
123
- echo "App: http://localhost:{{port}} (direct)"
124
- echo "Web: http://localhost:{{portNginx}} (via nginx)"
125
- echo "================================="
126
- echo ""
127
- echo "Press Ctrl+C to stop all services"
128
-
129
- trap "echo 'Stopping services...'; kill $APP_PID 2>/dev/null; nginx -c /tmp/nginx-dev.conf -s quit 2>/dev/null; exit" SIGINT SIGTERM
130
-
131
- wait $APP_PID
@@ -1,12 +0,0 @@
1
- #!/bin/bash
2
-
3
- cd "$(dirname "$0")"
4
-
5
- echo "Starting production with docker-compose..."
6
- docker-compose up -d --build
7
-
8
- echo ""
9
- echo "================================="
10
- echo "Production server started!"
11
- echo "Web: http://localhost"
12
- echo "================================="