diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..c651c781 --- /dev/null +++ b/.npmrc @@ -0,0 +1,5 @@ +ignore-workspace-root-check=true +node-linker=hoisted +restrict-manifest-changes=true +sync-injected-deps-after-scripts[]=build +inject-workspace-packages=true \ No newline at end of file diff --git a/apps/backend/.eslintrc.json b/apps/backend/.eslintrc.json deleted file mode 100644 index 9d9c0db5..00000000 --- a/apps/backend/.eslintrc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - } - ] -} diff --git a/apps/backend/.gitignore b/apps/backend/.gitignore new file mode 100644 index 00000000..0dff6fb6 --- /dev/null +++ b/apps/backend/.gitignore @@ -0,0 +1,8 @@ +dist/ +node_modules/ +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + diff --git a/apps/backend/jest.config.ts b/apps/backend/jest.config.ts deleted file mode 100644 index b6f3f642..00000000 --- a/apps/backend/jest.config.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'backend', - preset: '../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../coverage/apps/backend', -}; diff --git a/apps/backend/nest-cli.json b/apps/backend/nest-cli.json new file mode 100644 index 00000000..7078b40b --- /dev/null +++ b/apps/backend/nest-cli.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json.schemastore.org/nest-cli", + "collection": "@nestjs/schematics", + "monorepo": false, + "sourceRoot": "src", + "entryFile": "../../dist/backend/apps/backend/src/main", + "language": "ts", + "generateOptions": { + "spec": false + }, + "compilerOptions": { + "manualRestart": true, + "tsConfigPath": "./tsconfig.build.json", + "webpack": false, + "deleteOutDir": true, + "assets": [], + "watchAssets": false, + "plugins": [] + } +} diff --git a/apps/backend/package.json b/apps/backend/package.json new file mode 100644 index 00000000..1498b335 --- /dev/null +++ b/apps/backend/package.json @@ -0,0 +1,14 @@ +{ + "name": "postiz-backend", + "version": "1.0.0", + "description": "", + "scripts": { + "dev": "dotenv -e ../../.env -- nest start --watch --entryFile=./apps/backend/src/main", + "build": "NODE_ENV=production nest build", + "start": "node ./dist/apps/backend/src/main.js", + "pm2": "pm2 start pnpm --name backend -- start" + }, + "keywords": [], + "author": "", + "license": "ISC" +} \ No newline at end of file diff --git a/apps/backend/project.json b/apps/backend/project.json deleted file mode 100644 index 89d8ac2a..00000000 --- a/apps/backend/project.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "backend", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "apps/backend/src", - "projectType": "application", - "targets": { - "build": { - "executor": "@nx/webpack:webpack", - "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", - "options": { - "target": "node", - "compiler": "tsc", - "outputPath": "dist/apps/backend", - "main": "apps/backend/src/main.ts", - "tsConfig": "apps/backend/tsconfig.app.json", - "assets": ["apps/backend/src/assets"], - "webpackConfig": "apps/backend/webpack.config.js", - "transformers": [ - { - "name": "@nestjs/swagger/plugin", - "options": { - "dtoFileNameSuffix": [".dto.ts"], - "controllerFileNameSuffix": [".controller.ts"], - "introspectComments": true, - "classValidatorShim": true - } - } - ] - }, - "configurations": { - "development": {}, - "production": {} - } - }, - "serve": { - "executor": "@nx/js:node", - "defaultConfiguration": "development", - "options": { - "buildTarget": "backend:build", - "inspect": false - }, - "configurations": { - "development": { - "buildTarget": "backend:build:development" - }, - "production": { - "buildTarget": "backend:build:production" - } - } - }, - "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] - }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], - "options": { - "jestConfig": "apps/backend/jest.config.ts" - } - } - }, - "tags": [] -} diff --git a/apps/backend/src/api/routes/auth.controller.ts b/apps/backend/src/api/routes/auth.controller.ts index bf05fb29..b524cf99 100644 --- a/apps/backend/src/api/routes/auth.controller.ts +++ b/apps/backend/src/api/routes/auth.controller.ts @@ -2,7 +2,6 @@ import { Body, Controller, Get, - Ip, Param, Post, Query, @@ -103,7 +102,7 @@ export class AuthController { response.status(200).json({ register: true, }); - } catch (e) { + } catch (e: any) { response.status(400).send(e.message); } } @@ -167,7 +166,7 @@ export class AuthController { response.status(200).json({ login: true, }); - } catch (e) { + } catch (e: any) { response.status(400).send(e.message); } } diff --git a/apps/backend/src/api/routes/posts.controller.ts b/apps/backend/src/api/routes/posts.controller.ts index c9866bcd..32d1ff52 100644 --- a/apps/backend/src/api/routes/posts.controller.ts +++ b/apps/backend/src/api/routes/posts.controller.ts @@ -54,7 +54,7 @@ export class PostsController { return { ask: this._shortLinkService.askShortLinkedin(body.messages) }; } - @Get('/marketplace/:id?') + @Get('/marketplace/:id') async getMarketplacePosts( @GetOrgFromRequest() org: Organization, @Param('id') id: string diff --git a/apps/backend/tsconfig.app.json b/apps/backend/tsconfig.app.json deleted file mode 100644 index 6de27d07..00000000 --- a/apps/backend/tsconfig.app.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["node", "multer"], - "emitDecoratorMetadata": true, - "target": "es2021" - }, - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], - "include": ["src/**/*.ts"] -} diff --git a/apps/backend/tsconfig.build.json b/apps/backend/tsconfig.build.json new file mode 100644 index 00000000..bf14cec5 --- /dev/null +++ b/apps/backend/tsconfig.build.json @@ -0,0 +1,23 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["node_modules", "test", "dist", "**/*spec.ts"], + "compilerOptions": { + "module": "CommonJS", + "resolveJsonModule": true, + "declaration": true, + "removeComments": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "target": "ES2021", + "sourceMap": true, + "incremental": true, + "skipLibCheck": true, + "strictNullChecks": false, + "noImplicitAny": false, + "strictBindCallApply": false, + "forceConsistentCasingInFileNames": false, + "noFallthroughCasesInSwitch": false, + "outDir": "./dist" + } +} diff --git a/apps/backend/tsconfig.json b/apps/backend/tsconfig.json index 0eec5713..075254a9 100644 --- a/apps/backend/tsconfig.json +++ b/apps/backend/tsconfig.json @@ -1,17 +1,12 @@ { "extends": "../../tsconfig.base.json", - "files": [], - "include": [], - "references": [ - { - "path": "./tsconfig.app.json" - }, - { - "path": "./tsconfig.spec.json" - } - ], "compilerOptions": { - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true + "module": "commonjs", + "declaration": true, + "removeComments": true, + "allowSyntheticDefaultImports": true, + "target": "es2017", + "sourceMap": true, + "esModuleInterop": true } } diff --git a/apps/backend/tsconfig.spec.json b/apps/backend/tsconfig.spec.json deleted file mode 100644 index 9b2a121d..00000000 --- a/apps/backend/tsconfig.spec.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"] - }, - "include": [ - "jest.config.ts", - "src/**/*.test.ts", - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] -} diff --git a/apps/backend/webpack.config.js b/apps/backend/webpack.config.js deleted file mode 100644 index 6abb3ed2..00000000 --- a/apps/backend/webpack.config.js +++ /dev/null @@ -1,13 +0,0 @@ -const { composePlugins, withNx } = require('@nx/webpack'); - -// Nx plugins for webpack. -module.exports = composePlugins( - withNx({ - target: 'node', - }), - (config) => { - // Update the webpack config as needed here. - // e.g. `config.plugins.push(new MyPlugin())` - return config; - } -); diff --git a/apps/commands/.eslintrc.json b/apps/commands/.eslintrc.json deleted file mode 100644 index 9d9c0db5..00000000 --- a/apps/commands/.eslintrc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - } - ] -} diff --git a/apps/commands/.gitignore b/apps/commands/.gitignore new file mode 100644 index 00000000..0dff6fb6 --- /dev/null +++ b/apps/commands/.gitignore @@ -0,0 +1,8 @@ +dist/ +node_modules/ +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + diff --git a/apps/commands/jest.config.ts b/apps/commands/jest.config.ts deleted file mode 100644 index b12f8f71..00000000 --- a/apps/commands/jest.config.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'consumers', - preset: '../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../coverage/apps/consumers', -}; diff --git a/apps/commands/nest-cli.json b/apps/commands/nest-cli.json new file mode 100644 index 00000000..7078b40b --- /dev/null +++ b/apps/commands/nest-cli.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json.schemastore.org/nest-cli", + "collection": "@nestjs/schematics", + "monorepo": false, + "sourceRoot": "src", + "entryFile": "../../dist/backend/apps/backend/src/main", + "language": "ts", + "generateOptions": { + "spec": false + }, + "compilerOptions": { + "manualRestart": true, + "tsConfigPath": "./tsconfig.build.json", + "webpack": false, + "deleteOutDir": true, + "assets": [], + "watchAssets": false, + "plugins": [] + } +} diff --git a/apps/commands/package.json b/apps/commands/package.json new file mode 100644 index 00000000..be23c408 --- /dev/null +++ b/apps/commands/package.json @@ -0,0 +1,14 @@ +{ + "name": "postiz-command", + "version": "1.0.0", + "description": "", + "scripts": { + "dev": "dotenv -e ../../.env -- nest start --watch --entryFile=./apps/command/src/main", + "build": "NODE_ENV=production nest build", + "start": "node ./dist/apps/command/src/main.js", + "pm2": "pm2 start pnpm --name command -- start" + }, + "keywords": [], + "author": "", + "license": "ISC" +} \ No newline at end of file diff --git a/apps/commands/project.json b/apps/commands/project.json deleted file mode 100644 index 3629dc78..00000000 --- a/apps/commands/project.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "commands", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "apps/commands/src", - "projectType": "application", - "targets": { - "build": { - "executor": "@nx/webpack:webpack", - "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", - "options": { - "target": "node", - "compiler": "tsc", - "outputPath": "dist/apps/commands", - "main": "apps/commands/src/main.ts", - "tsConfig": "apps/commands/tsconfig.app.json", - "webpackConfig": "apps/commands/webpack.config.js" - }, - "configurations": { - "development": {}, - "production": {} - } - }, - "command": { - "executor": "nx:run-commands", - "defaultConfiguration": "development", - "options": { - "command": "cd dist/apps/commands && node main.js" - } - }, - "lint": { - "executor": "@nx/linter:eslint", - "outputs": ["{options.outputFile}"], - "options": { - "lintFilePatterns": ["apps/commands/**/*.ts"] - } - }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], - "options": { - "jestConfig": "apps/commands/jest.config.ts", - "passWithNoTests": true - }, - "configurations": { - "ci": { - "ci": true, - "codeCoverage": true - } - } - } - }, - "tags": [] -} diff --git a/apps/commands/tsconfig.app.json b/apps/commands/tsconfig.app.json deleted file mode 100644 index a2ce7652..00000000 --- a/apps/commands/tsconfig.app.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["node"], - "emitDecoratorMetadata": true, - "target": "es2021" - }, - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], - "include": ["src/**/*.ts"] -} diff --git a/apps/commands/tsconfig.build.json b/apps/commands/tsconfig.build.json new file mode 100644 index 00000000..bf14cec5 --- /dev/null +++ b/apps/commands/tsconfig.build.json @@ -0,0 +1,23 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["node_modules", "test", "dist", "**/*spec.ts"], + "compilerOptions": { + "module": "CommonJS", + "resolveJsonModule": true, + "declaration": true, + "removeComments": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "target": "ES2021", + "sourceMap": true, + "incremental": true, + "skipLibCheck": true, + "strictNullChecks": false, + "noImplicitAny": false, + "strictBindCallApply": false, + "forceConsistentCasingInFileNames": false, + "noFallthroughCasesInSwitch": false, + "outDir": "./dist" + } +} diff --git a/apps/commands/tsconfig.json b/apps/commands/tsconfig.json index c1e2dd4e..075254a9 100644 --- a/apps/commands/tsconfig.json +++ b/apps/commands/tsconfig.json @@ -1,16 +1,12 @@ { "extends": "../../tsconfig.base.json", - "files": [], - "include": [], - "references": [ - { - "path": "./tsconfig.app.json" - }, - { - "path": "./tsconfig.spec.json" - } - ], "compilerOptions": { + "module": "commonjs", + "declaration": true, + "removeComments": true, + "allowSyntheticDefaultImports": true, + "target": "es2017", + "sourceMap": true, "esModuleInterop": true } } diff --git a/apps/commands/tsconfig.spec.json b/apps/commands/tsconfig.spec.json deleted file mode 100644 index 9b2a121d..00000000 --- a/apps/commands/tsconfig.spec.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"] - }, - "include": [ - "jest.config.ts", - "src/**/*.test.ts", - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] -} diff --git a/apps/commands/webpack.config.js b/apps/commands/webpack.config.js deleted file mode 100644 index c1917ce0..00000000 --- a/apps/commands/webpack.config.js +++ /dev/null @@ -1,13 +0,0 @@ -const { composePlugins, withNx } = require('@nx/webpack'); - -// Nx plugins for webpack. -module.exports = composePlugins( - withNx({ - target: 'node', - }), - (config) => { - // Update the webpack config as needed here. - // e.g. `config.plugins.push(new MyPlugin())` - return config; - } -); diff --git a/apps/cron/.eslintrc.json b/apps/cron/.eslintrc.json deleted file mode 100644 index 9d9c0db5..00000000 --- a/apps/cron/.eslintrc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - } - ] -} diff --git a/apps/cron/.gitignore b/apps/cron/.gitignore new file mode 100644 index 00000000..0dff6fb6 --- /dev/null +++ b/apps/cron/.gitignore @@ -0,0 +1,8 @@ +dist/ +node_modules/ +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + diff --git a/apps/cron/jest.config.ts b/apps/cron/jest.config.ts deleted file mode 100644 index b12f8f71..00000000 --- a/apps/cron/jest.config.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'consumers', - preset: '../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../coverage/apps/consumers', -}; diff --git a/apps/cron/nest-cli.json b/apps/cron/nest-cli.json new file mode 100644 index 00000000..874969aa --- /dev/null +++ b/apps/cron/nest-cli.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json.schemastore.org/nest-cli", + "collection": "@nestjs/schematics", + "monorepo": false, + "sourceRoot": "src", + "entryFile": "../../dist/workers/apps/workers/src/main", + "language": "ts", + "generateOptions": { + "spec": false + }, + "compilerOptions": { + "manualRestart": true, + "tsConfigPath": "./tsconfig.build.json", + "webpack": false, + "deleteOutDir": true, + "assets": [], + "watchAssets": false, + "plugins": [] + } +} diff --git a/apps/cron/package.json b/apps/cron/package.json new file mode 100644 index 00000000..b5c3fb5f --- /dev/null +++ b/apps/cron/package.json @@ -0,0 +1,13 @@ +{ + "name": "postiz-cron", + "version": "1.0.0", + "description": "", + "scripts": { + "dev": "dotenv -e ../../.env -- nest start --watch --entryFile=./apps/cron/src/main", + "build": "NODE_ENV=production nest build", + "start": "node ./dist/apps/cron/src/main.js" + }, + "keywords": [], + "author": "", + "license": "ISC" +} \ No newline at end of file diff --git a/apps/cron/project.json b/apps/cron/project.json deleted file mode 100644 index d936df9a..00000000 --- a/apps/cron/project.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "cron", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "apps/cron/src", - "projectType": "application", - "targets": { - "build": { - "executor": "@nx/webpack:webpack", - "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", - "options": { - "target": "node", - "compiler": "tsc", - "outputPath": "dist/apps/cron", - "main": "apps/cron/src/main.ts", - "tsConfig": "apps/cron/tsconfig.app.json", - "webpackConfig": "apps/cron/webpack.config.js" - }, - "configurations": { - "development": {}, - "production": {} - } - }, - "serve": { - "executor": "@nx/js:node", - "defaultConfiguration": "development", - "options": { - "buildTarget": "cron:build" - }, - "configurations": { - "development": { - "buildTarget": "cron:build:development" - }, - "production": { - "buildTarget": "cron:build:production" - } - } - }, - "lint": { - "executor": "@nx/linter:eslint", - "outputs": ["{options.outputFile}"], - "options": { - "lintFilePatterns": ["apps/cron/**/*.ts"] - } - }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], - "options": { - "jestConfig": "apps/cron/jest.config.ts", - "passWithNoTests": true - }, - "configurations": { - "ci": { - "ci": true, - "codeCoverage": true - } - } - } - }, - "tags": [] -} diff --git a/apps/cron/tsconfig.app.json b/apps/cron/tsconfig.app.json deleted file mode 100644 index a2ce7652..00000000 --- a/apps/cron/tsconfig.app.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["node"], - "emitDecoratorMetadata": true, - "target": "es2021" - }, - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], - "include": ["src/**/*.ts"] -} diff --git a/apps/cron/tsconfig.build.json b/apps/cron/tsconfig.build.json new file mode 100644 index 00000000..bf14cec5 --- /dev/null +++ b/apps/cron/tsconfig.build.json @@ -0,0 +1,23 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["node_modules", "test", "dist", "**/*spec.ts"], + "compilerOptions": { + "module": "CommonJS", + "resolveJsonModule": true, + "declaration": true, + "removeComments": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "target": "ES2021", + "sourceMap": true, + "incremental": true, + "skipLibCheck": true, + "strictNullChecks": false, + "noImplicitAny": false, + "strictBindCallApply": false, + "forceConsistentCasingInFileNames": false, + "noFallthroughCasesInSwitch": false, + "outDir": "./dist" + } +} diff --git a/apps/cron/tsconfig.json b/apps/cron/tsconfig.json index c1e2dd4e..182ecd00 100644 --- a/apps/cron/tsconfig.json +++ b/apps/cron/tsconfig.json @@ -1,16 +1,12 @@ { "extends": "../../tsconfig.base.json", - "files": [], - "include": [], - "references": [ - { - "path": "./tsconfig.app.json" - }, - { - "path": "./tsconfig.spec.json" - } - ], "compilerOptions": { - "esModuleInterop": true + "module": "commonjs", + "declaration": true, + "removeComments": true, + "allowSyntheticDefaultImports": true, + "noLib": false, + "target": "ES2021", + "sourceMap": true } } diff --git a/apps/cron/tsconfig.spec.json b/apps/cron/tsconfig.spec.json deleted file mode 100644 index 9b2a121d..00000000 --- a/apps/cron/tsconfig.spec.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"] - }, - "include": [ - "jest.config.ts", - "src/**/*.test.ts", - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] -} diff --git a/apps/cron/webpack.config.js b/apps/cron/webpack.config.js deleted file mode 100644 index c1917ce0..00000000 --- a/apps/cron/webpack.config.js +++ /dev/null @@ -1,13 +0,0 @@ -const { composePlugins, withNx } = require('@nx/webpack'); - -// Nx plugins for webpack. -module.exports = composePlugins( - withNx({ - target: 'node', - }), - (config) => { - // Update the webpack config as needed here. - // e.g. `config.plugins.push(new MyPlugin())` - return config; - } -); diff --git a/apps/frontend/.eslintrc.json b/apps/frontend/.eslintrc.json deleted file mode 100644 index 6cfcf667..00000000 --- a/apps/frontend/.eslintrc.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "extends": [ - "plugin:@nx/react-typescript", - "next", - "next/core-web-vitals", - "../../.eslintrc.json" - ], - "ignorePatterns": ["!**/*", ".next/**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": { - "@next/next/no-html-link-for-pages": ["error", "apps/frontend/pages"], - "no-extra-boolean-cast": "off" - } - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], - "env": { - "jest": true - } - } - ] -} diff --git a/apps/frontend/.gitignore b/apps/frontend/.gitignore new file mode 100644 index 00000000..5ef6a520 --- /dev/null +++ b/apps/frontend/.gitignore @@ -0,0 +1,41 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files (can opt-in for committing if needed) +.env* + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/apps/frontend/README.md b/apps/frontend/README.md new file mode 100644 index 00000000..e215bc4c --- /dev/null +++ b/apps/frontend/README.md @@ -0,0 +1,36 @@ +This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +# or +bun dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. + +This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. diff --git a/apps/frontend/index.d.ts b/apps/frontend/index.d.ts deleted file mode 100644 index 7ba08fa1..00000000 --- a/apps/frontend/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -declare module '*.svg' { - const content: any; - export const ReactComponent: any; - export default content; -} diff --git a/apps/frontend/jest.config.ts b/apps/frontend/jest.config.ts deleted file mode 100644 index e69b2a7a..00000000 --- a/apps/frontend/jest.config.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'frontend', - preset: '../../jest.preset.js', - transform: { - '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest', - '^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }], - }, - moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], - coverageDirectory: '../../coverage/apps/frontend', -}; diff --git a/apps/frontend/next-env.d.ts b/apps/frontend/next-env.d.ts deleted file mode 100644 index 40c3d680..00000000 --- a/apps/frontend/next-env.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/// -/// - -// NOTE: This file should not be edited -// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. diff --git a/apps/frontend/next.config.js b/apps/frontend/next.config.js index b2075a75..23fbabe0 100644 --- a/apps/frontend/next.config.js +++ b/apps/frontend/next.config.js @@ -1,17 +1,8 @@ -//@ts-check - -// eslint-disable-next-line @typescript-eslint/no-var-requires -const { composePlugins, withNx } = require('@nx/next'); - -/** - * @type {import('@nx/next/plugins/with-nx').WithNxOptions} - **/ const nextConfig = { - nx: { - // Set this to true if you would like to use SVGR - // See: https://github.com/gregberge/vgr - svgr: false, + experimental: { + proxyTimeout: 90_000, }, + reactStrictMode: false, transpilePackages: ['crypto-hash'], images: { remotePatterns: [ @@ -48,9 +39,4 @@ const nextConfig = { }, }; -const plugins = [ - // Add more Next.js plugins to this list if needed. - withNx, -]; - -module.exports = composePlugins(...plugins)(nextConfig); +export default nextConfig; diff --git a/apps/frontend/package.json b/apps/frontend/package.json new file mode 100644 index 00000000..54053d54 --- /dev/null +++ b/apps/frontend/package.json @@ -0,0 +1,14 @@ +{ + "name": "postiz-frontend", + "version": "1.0.0", + "description": "", + "scripts": { + "dev": "dotenv -e ../../.env -- next dev -p 4200", + "build": "next build", + "start": "PORT=4200 next start", + "pm2": "PORT=4200 pm2 start pnpm --name frontend -- start" + }, + "keywords": [], + "author": "", + "license": "ISC" +} diff --git a/apps/frontend/postcss.config.js b/apps/frontend/postcss.config.js deleted file mode 100644 index 26b8d41b..00000000 --- a/apps/frontend/postcss.config.js +++ /dev/null @@ -1,10 +0,0 @@ -const { join } = require('path'); - -module.exports = { - plugins: { - tailwindcss: { - config: join(__dirname, 'tailwind.config.js'), - }, - autoprefixer: {}, - }, -}; \ No newline at end of file diff --git a/apps/frontend/postcss.config.mjs b/apps/frontend/postcss.config.mjs new file mode 100644 index 00000000..1a69fd2a --- /dev/null +++ b/apps/frontend/postcss.config.mjs @@ -0,0 +1,8 @@ +/** @type {import('postcss-load-config').Config} */ +const config = { + plugins: { + tailwindcss: {}, + }, +}; + +export default config; diff --git a/apps/frontend/project.json b/apps/frontend/project.json deleted file mode 100644 index 2e9dea71..00000000 --- a/apps/frontend/project.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "frontend", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "apps/frontend", - "projectType": "application", - "targets": { - "build": { - "executor": "@nx/next:build", - "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", - "options": { - "outputPath": "dist/apps/frontend", - "postcssConfig": "apps/frontend/postcss.config.js" - }, - "configurations": { - "development": { - "outputPath": "apps/frontend" - }, - "production": {} - } - }, - "serve": { - "executor": "@nx/next:server", - "defaultConfiguration": "development", - "options": { - "buildTarget": "frontend:build", - "dev": true - }, - "configurations": { - "development": { - "buildTarget": "frontend:build:development", - "dev": true - }, - "production": { - "buildTarget": "frontend:build:production", - "dev": false - } - } - }, - "export": { - "executor": "@nx/next:export", - "options": { - "buildTarget": "frontend:build:production" - } - }, - "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] - }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], - "options": { - "jestConfig": "apps/frontend/jest.config.ts" - } - } - }, - "tags": [] -} diff --git a/apps/frontend/src/app/(site)/layout.tsx b/apps/frontend/src/app/(site)/layout.tsx index 12b93072..478f4465 100644 --- a/apps/frontend/src/app/(site)/layout.tsx +++ b/apps/frontend/src/app/(site)/layout.tsx @@ -1,11 +1,6 @@ import {LayoutSettings} from "@gitroom/frontend/components/layout/layout.settings"; export default async function Layout({ children }: { children: React.ReactNode }) { - /* - * Replace the elements below with your own. - * - * Note: The corresponding styles are in the ./index.scss file. - */ return ( {children} diff --git a/apps/frontend/src/components/launches/polonto/polonto.picture.generation.tsx b/apps/frontend/src/components/launches/polonto/polonto.picture.generation.tsx index f1e4bfd7..add5e6a5 100644 --- a/apps/frontend/src/components/launches/polonto/polonto.picture.generation.tsx +++ b/apps/frontend/src/components/launches/polonto/polonto.picture.generation.tsx @@ -1,7 +1,9 @@ +'use client'; + import React, { useCallback } from 'react'; import { observer } from 'mobx-react-lite'; -import { InputGroup } from '@blueprintjs/core'; -import { Clean } from '@blueprintjs/icons'; +// import { InputGroup } from '@blueprintjs/core'; +// import { Clean } from '@blueprintjs/icons'; import { SectionTab } from 'polotno/side-panel'; import { getImageSize } from 'polotno/utils/image'; @@ -69,18 +71,18 @@ const GenerateTab = observer(({ store }: any) => {
Generate image with AI {data?.credits ? `(${data?.credits} left)` : ``}
- { - if (e.key === 'Enter') { - handleGenerate(); - } - }} - style={{ - marginBottom: '20px', - }} - inputRef={inputRef} - /> + {/* {*/} + {/* if (e.key === 'Enter') {*/} + {/* handleGenerate();*/} + {/* }*/} + {/* }}*/} + {/* style={{*/} + {/* marginBottom: '20px',*/} + {/* }}*/} + {/* inputRef={inputRef}*/} + {/*/>*/}