Skip to content

Commit

Permalink
Unstable (#359)
Browse files Browse the repository at this point in the history
Co-authored-by: Anatol Karalkoŭ <[email protected]>
Co-authored-by: denanmusinovic <[email protected]>
Co-authored-by: Denan Musinovic <[email protected]>
Co-authored-by: Viachaslau <[email protected]>
Co-authored-by: Bar Hofesh <[email protected]>
  • Loading branch information
6 people authored Sep 5, 2024
1 parent 0e91835 commit c7a46e2
Show file tree
Hide file tree
Showing 571 changed files with 21,008 additions and 182,140 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ KEYCLOAK_PUBLIC_CLIENT_ID=brokencrystals-client
KEYCLOAK_PUBLIC_CLIENT_SECRET=4bfb5df6-4647-46dd-bad1-c8b8ffd7caf4

BRIGHT_TOKEN=
BRIGHT_CLUSTER=app.neuralegion.com
SEC_TESTER_TARGET=http://localhost:8090
BRIGHT_CLUSTER=app.brightsec.com
SEC_TESTER_TARGET=http://localhost:3000

CHAT_API_URL=https://api-inference.huggingface.co/v1/chat/completions
CHAT_API_MODEL=meta-llama/Meta-Llama-3-8B-Instruct
Expand Down
25 changes: 0 additions & 25 deletions .eslintrc.js

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/check-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "React Front-End CI checks"

on:
pull_request:
branches:
- '**'

push:
branches:
- stable
- unstable

paths:
- 'client/**'
- '.github/workflows/*client.yml'

env:
HUSKY: 0

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Disable prepare script (husky)
run: npm pkg delete scripts.prepare

- name: Install dependencies
run: npm ci --prefix=client --no-audit

- name: Check format
run: npm run format --prefix=client

- name: Lint
run: npm run lint --prefix=client

- name: Build
run: npm run build --prefix=client
57 changes: 57 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "Nest Back-End CI checks"

on:
pull_request:
branches:
- '**'

push:
branches:
- stable
- unstable

paths:
- '*'
- 'src/**'
- 'test/**'
- '.github/workflows/check.yml'

env:
HUSKY: 0

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Disable prepare script (husky)
run: npm pkg delete scripts.prepare

- name: Install dependencies
run: npm ci --no-audit

- name: Check format
run: npm run format

- name: Lint
run: npm run lint

- name: Build
run: npm run build

- name: Test
run: npm run test
40 changes: 0 additions & 40 deletions .github/workflows/release.yml

This file was deleted.

1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/.github
/node_modules
/dist
/charts
/client
5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "all"
}
"trailingComma": "none"
}
17 changes: 17 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"sourceMaps": true,
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": true
},
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true
},
"baseUrl": "./"
},
"minify": false
}
24 changes: 10 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,23 @@
# BUILD FOR LOCAL DEVELOPMENT
###################

FROM node:14-alpine As build
FROM node:18-alpine AS build

WORKDIR /usr/src/app

RUN apk add --no-cache --virtual .gyp python3 py3-pip make g++

# Copy and build NestJS server project
COPY --chown=node:node package*.json ./
COPY --chown=node:node tsconfig.build.json ./
COPY --chown=node:node tsconfig.json ./
COPY --chown=node:node nest-cli.json ./
COPY --chown=node:node mikro-orm.config.ts ./
COPY --chown=node:node nest-cli.fast.json ./
COPY --chown=node:node .env ./
COPY --chown=node:node config ./config
COPY --chown=node:node keycloak ./keycloak
COPY --chown=node:node src ./src

RUN npm ci
RUN npm run build
ENV NPM_CONFIG_LOGLEVEL=error
RUN npm ci --no-audit
RUN npm run build:fast
RUN npm prune --production

# Copy and build client project
Expand All @@ -30,25 +28,23 @@ COPY --chown=node:node client/public ./client/public
COPY --chown=node:node client/typings ./client/typings
COPY --chown=node:node client/vcs ./client/vcs
COPY --chown=node:node client/tsconfig.json ./client/tsconfig.json
COPY --chown=node:node client/vite.config.ts ./client/vite.config.ts
COPY --chown=node:node client/index.html ./client/index.html

ENV CYPRESS_INSTALL_BINARY=0
RUN npm ci --prefix=client
RUN npm ci --prefix=client --no-audit
RUN npm run build --prefix=client

RUN apk del .gyp

USER node

###################
# PRODUCTION
###################

FROM node:14-alpine As production
FROM node:18-alpine AS production

WORKDIR /usr/src/app

COPY --chown=node:node nest-cli.json ./
COPY --chown=node:node mikro-orm.config.ts ./
COPY --chown=node:node .env ./
COPY --chown=node:node config ./config
COPY --chown=node:node keycloak ./keycloak
Expand All @@ -57,7 +53,7 @@ COPY --chown=node:node --from=build /usr/src/app/node_modules ./node_modules
COPY --chown=node:node --from=build /usr/src/app/package*.json ./
COPY --chown=node:node --from=build /usr/src/app/dist ./dist

COPY --chown=node:node --from=build /usr/src/app/client/build ./client/build
COPY --chown=node:node --from=build /usr/src/app/client/dist ./client/dist
COPY --chown=node:node --from=build /usr/src/app/client/vcs ./client/vcs

CMD ["npm", "run", "start:prod"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 NeuraLegion
Copyright (c) 2024 NeuraLegion

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit c7a46e2

Please sign in to comment.