Skip to content

Commit

Permalink
Merge pull request #411 from aXenDeveloper/package/copy_backend_files
Browse files Browse the repository at this point in the history
perf(backend): Create copy files script into backend
  • Loading branch information
aXenDeveloper authored Jul 11, 2024
2 parents 795e035 + 0c2d316 commit 8e49558
Show file tree
Hide file tree
Showing 166 changed files with 383 additions and 2,194 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Build Docs
run: pnpm build:docs

- name: Build Scripts
run: pnpm build:scripts

- name: Build Docs
run: pnpm build:docs
- name: Install scripts
run: pnpm install

- name: Run config init
run: pnpm config:init:skip-database

- name: Build
run: pnpm build
2 changes: 1 addition & 1 deletion .github/workflows/conventional-label.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
steps:
- uses: bcoe/conventional-release-labels@v1
with:
type_labels: '{"feat": "💡 Feature", "fix": "🐞 Bug", "breaking": "🚨 Breaking Changes", "docs": "📖 Documentation", "style": "💅 Style", "refactor": "🚀 Performerce", "perf": "🚀 Performerce", "test": "🧪 Test"}'
type_labels: '{"feat": "💡 Feature", "fix": "🐞 Bug", "breaking": "🚨 Breaking Changes", "docs": "📖 Documentation", "style": "💅 Style", "refactor": "🧱 Refactor", "perf": "🚀 Performerce", "test": "🧪 Test"}'
4 changes: 1 addition & 3 deletions apps/backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,4 @@ lerna-debug.log*

# Configuration
/src/plugins/*/admin/database/migrations
/src/plugins/core/utils/config.json
/src/plugins/core/utils/email.config.json
/src/plugins/core/utils/captcha.config.json
/src/plugins/core/
2 changes: 1 addition & 1 deletion apps/backend/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'drizzle-kit';

import { DATABASE_ENVS } from '@/database/client';
import { DATABASE_ENVS } from '@/database';

export default defineConfig({
dialect: 'postgresql',
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { DatabaseService } from 'vitnode-backend';
import { NodePgDatabase } from 'drizzle-orm/node-postgres';

import { schemaDatabase } from '@/database/schema';
import { schemaDatabase } from '@/database';

// Overwrite the DatabaseService class to include the db property
declare module 'vitnode-backend' {
Expand Down
32 changes: 1 addition & 31 deletions apps/backend/schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,6 @@ type GroupUser {
name: [TextLanguage!]!
}

input GroupsPermissionsCreatePluginCategories {
can_create: Boolean!
can_download_files: Boolean!
can_read: Boolean!
can_reply: Boolean!
group_id: Int!
}

type HslColor {
h: Int!
l: Int!
Expand Down Expand Up @@ -195,7 +187,6 @@ type LayoutAdminInstallObj {
}

type Mutation {
admin__blog_categories__create(color: String!, description: [TextLanguageInput!]!, name: [TextLanguageInput!]!, permissions: PermissionsCreatePluginCategories!): ShowBlogCategories!
admin__core_email_settings__edit(color_primary: String!, color_primary_foreground: String!, smtp_host: String!, smtp_password: String!, smtp_port: Int!, smtp_secure: Boolean!, smtp_user: String!): ShowAdminEmailSettingsServiceObj!
admin__core_email_settings__test(from: String!, message: String!, preview_text: String, subject: String!, to: String!): String!
admin__core_files__delete(id: Int!): String!
Expand Down Expand Up @@ -236,6 +227,7 @@ type Mutation {
core_groups__admin_create(content: ContentCreateAdminGroups!, name: [TextLanguageInput!]!): ShowAdminGroups!
core_members__avatar__delete: String!
core_members__avatar__upload(file: Upload!): UploadAvatarCoreMembersObj!
core_members__change_password(hashKey: String!, password: String!): User!
core_members__delete(id: Int!): String!
core_members__reset_password__create_key(email: String!): String!
core_sessions__sign_in(admin: Boolean, email: String!, password: String!, remember: Boolean): String!
Expand All @@ -257,14 +249,6 @@ type PageInfo {
totalCount: Float!
}

input PermissionsCreatePluginCategories {
can_all_create: Boolean!
can_all_download_files: Boolean!
can_all_read: Boolean!
can_all_reply: Boolean!
groups: [GroupsPermissionsCreatePluginCategories!]!
}

type Query {
admin__core_email_settings__show: ShowAdminEmailSettingsServiceObj!
admin__core_files__show(cursor: Int, first: Int, last: Int, search: String, sortBy: ShowCoreFilesSortByArgs): ShowAdminFilesObj!
Expand All @@ -280,7 +264,6 @@ type Query {
admin__core_staff_moderators__show(cursor: Int, first: Int, last: Int, sortBy: ShowAdminStaffModeratorsSortByArgs): ShowAdminStaffModeratorsObj!
admin__install__layout: LayoutAdminInstallObj!
admin__sessions__authorization: AuthorizationAdminSessionsObj!
blog_categories__show(cursor: Int, first: Int, last: Int): ShowBlogCategoriesObj!
core_files__show(cursor: Int, first: Int, last: Int, search: String, sortBy: ShowCoreFilesSortByArgs): ShowCoreFilesObj!
core_languages__show(cursor: Int, first: Int, last: Int, search: String, sortBy: ShowCoreLanguagesSortByArgs): ShowCoreLanguagesObj!
core_members__show(cursor: Int, first: Int, last: Int, name_seo: String, search: String, sortBy: ShowCoreMembersSortByArgs): ShowCoreMembersObj!
Expand Down Expand Up @@ -500,19 +483,6 @@ enum ShowAdminStaffModeratorsSortingColumnEnum {
updated
}

type ShowBlogCategories {
color: String!
description: [TextLanguage!]
id: Int!
name: [TextLanguage!]!
position: Int!
}

type ShowBlogCategoriesObj {
edges: [ShowBlogCategories!]!
pageInfo: PageInfo!
}

type ShowCoreFiles {
count_uses: Int!
created: DateTime!
Expand Down
3 changes: 1 addition & 2 deletions apps/backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { Module } from '@nestjs/common';
import { VitNodeCoreModule } from 'vitnode-backend';

import { PluginsModule } from './plugins/plugins.module';
import { DATABASE_ENVS } from './database/client';
import { schemaDatabase } from './database/schema';
import { DATABASE_ENVS, schemaDatabase } from './database';

@Module({
imports: [
Expand Down
19 changes: 19 additions & 0 deletions apps/backend/src/database.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// ! DO NOT REMOVE, MODIFY OR MOVE THIS FILE!!!

import tableCore from '@/plugins/core/admin/database/index';
import tableWelcome from '@/plugins/welcome/admin/database/index';
// ! === IMPORT ===

export const schemaDatabase = {
...tableWelcome,
// ! === MODULE ===
...tableCore,
};

export const DATABASE_ENVS = {
host: process.env.DB_HOST || 'localhost',
port: process.env.DB_PORT ? +process.env.DB_PORT : 5432,
user: process.env.DB_USER || 'root',
password: process.env.DB_PASSWORD || 'root',
database: process.env.DB_DATABASE || 'vitnode',
};
11 changes: 0 additions & 11 deletions apps/backend/src/database/schema.ts

This file was deleted.

9 changes: 0 additions & 9 deletions apps/backend/src/plugins/blog/admin/admin.module.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions apps/backend/src/plugins/blog/admin/database/index.ts

This file was deleted.

Loading

0 comments on commit 8e49558

Please sign in to comment.