Skip to content

Commit d8a65eb

Browse files
committed
refactor: ♻️ bring back the apps (#417)
1 parent 18b9688 commit d8a65eb

File tree

672 files changed

+66926
-5175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

672 files changed

+66926
-5175
lines changed

apps/server/.dockerignore

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
node_modules/**
2+
docs
3+
.run
4+
dist
5+
.eslintrc.js
6+
.prettierrc
7+
http-client.env.json
8+
README.md
9+
.env
10+
.editorconfig
11+
**/Dockerfile
12+
13+
# Logs
14+
logs
15+
*.log
16+
17+
# Runtime data
18+
pids
19+
*.pid
20+
*.seed
21+
22+
# Directory for instrumented libs generated by jscoverage/JSCover
23+
lib-cov
24+
25+
# Coverage directory used by tools like istanbul
26+
coverage
27+
28+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# node-waf configuration
32+
.lock-wscript
33+
34+
# Compiled binary addons (http://nodejs.org/api/addons.html)
35+
build/Release
36+
37+
# Dependency directory
38+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
39+
node_modules
40+
41+
server/*.spec.js
42+
kubernetes
43+
e2e/
44+
build
45+
46+
.fta.json
47+
keploy-config.yaml
48+
nodemon.json
49+
openapi3.json
50+
schema.gql
51+
TODO.md

apps/server/.editorconfig

+647
Large diffs are not rendered by default.

apps/server/.env

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./../../.env

apps/server/.fta.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"output_limit": 250,
3+
"score_cap": 90,
4+
"exclude_directories": [
5+
"__fixtures__",
6+
"vendor",
7+
"build",
8+
"dist",
9+
"coverage",
10+
"node_modules",
11+
"public"
12+
],
13+
"exclude_filenames": [
14+
"*.test.{ts,tsx}"
15+
],
16+
"extensions": [
17+
".ts"
18+
],
19+
"include_comments": false,
20+
"exclude_under": 15
21+
}

apps/server/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src/externals/generated/**
2+
src/externals/compodoc/**
3+
vendor/**
4+
!.env

apps/server/.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}

apps/server/.run/dev.run.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="dev" type="js.build_tools.npm" nameIsGenerated="true">
3+
<package-json value="$PROJECT_DIR$/package.json" />
4+
<command value="run" />
5+
<scripts>
6+
<script value="dev" />
7+
</scripts>
8+
<node-interpreter value="project" />
9+
<envs />
10+
<method v="2" />
11+
</configuration>
12+
</component>

apps/server/.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

apps/server/README.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# `server`
2+
3+
## Goal
4+
5+
Overload server which as big amount of features as it is possible to resue as much code as it's possible in future,
6+
program in decoupled way to allow easy testing and development, and have fun while doing it.
7+
8+
## Features
9+
10+
- **🍭 Eye Candies**, who would like to look at a boring wall of text all the time, since start of application it gives
11+
you
12+
nice and friendly developer feel, as all of us - keeping candies for ourselves so these features are disabled
13+
for "serious" deployments.
14+
- **"Where is the fucking documentation?"**, no fucking more fellas, there you have static documentation dedicated for
15+
Angular-like projects (`compodoc`), static generation of `GraphQL` documentation, `Swagger` documentation for REST
16+
API, and `eventsdoc` for event-driven applications. I would like to document websockets with `asyncapi` but sorry
17+
ecosystem isn't ready for that yet. I mean... You still can completly do not give a fuck about documentation and will
18+
hear such thing but I think you can say you tried at least lol
19+
20+
- [ ] Circuit Breaker
21+
- [ ] Service Discovery
22+
- [ ] Error Handling
23+
- [ ] Exception Handling
24+
- [ ] RxJS
25+
- [ ] API Response Time
26+
- [ ] Serialization
27+
- [ ] Deserialization
28+
- [ ] Prometheus Metrics
29+
- [ ] Logging
30+
- [ ] Concurrency Control
31+
- [ ] Externalized Configuration
32+
- [ ] Deployment Profiles
33+
- [ ] OpenTracing
34+
- [ ] XSS
35+
- [ ] CORS
36+
- [ ] CSRF
37+
- [ ] OAuth 2.0
38+
- [ ] GraphQL
39+
- [ ] Rest
40+
41+
## Installation
42+
43+
```bash
44+
$ pnpm install
45+
```

apps/server/bin/start-server.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export UV_THREADPOOL_SIZE=16 && node --harmony --harmony-shipping \
2+
--enable-source-maps --max-old-space-size=6000 ../dist/src/main.js

apps/server/build/Dockerfile

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
FROM node:18 AS BUILD
2+
3+
ENV PNPM_HOME="/pnpm"
4+
ENV PATH="$PNPM_HOME:$PATH"
5+
6+
WORKDIR /tmp
7+
8+
RUN corepack enable
9+
10+
# Install pnpm
11+
# RUN npm install -g pnpm && mkdir -p /usr/.pnpm-store
12+
13+
# Copy package.json and pnpm-lock.yaml and install dependencies
14+
COPY ./package.json ./pnpm-lock.yaml ./
15+
16+
# Install dependencies with or without cache based on the USE_BUILDKIT environment variable
17+
RUN pnpm install
18+
19+
# Copy Prisma schema and generate Prisma client
20+
COPY ./prisma ./prisma/
21+
RUN pnpm prisma generate
22+
23+
# Copy the rest of the application code
24+
COPY . .
25+
26+
# Build the application
27+
RUN pnpm run build
28+
29+
# ---------------------------------------------------------
30+
31+
FROM node:18 AS RUNTIME
32+
33+
RUN addgroup --system application_users && \
34+
adduser --system --ingroup application_users application_user && \
35+
mkdir /usr/bin/application && \
36+
chown -R application_user:application_users /usr/bin/application && \
37+
chmod -R 777 /usr/bin/application
38+
39+
WORKDIR /usr/bin/application
40+
41+
COPY --from=BUILD /tmp/node_modules /usr/bin/application/node_modules
42+
COPY --from=BUILD /tmp/dist/src /usr/bin/application/bin
43+
COPY --from=BUILD /tmp/package.json /usr/bin/application/package.json
44+
45+
RUN chmod -R 777 /usr/bin/application/bin
46+
47+
USER application_user
48+
49+
# Set the NODE_ENV to production as a default
50+
ENV NODE_ENV production
51+
52+
EXPOSE 80
53+
EXPOSE 443
54+
55+
CMD ["node", "/usr/bin/application/bin/main.js"]

0 commit comments

Comments
 (0)