Skip to content

Commit 3b271dd

Browse files
authored
chore: split backend into server/api and server/shared (activepieces#3931)
* chore: split backend into server/api and server/shared * chore: create worker package * fix: remove sandboxed from .env
1 parent 27b22fa commit 3b271dd

File tree

580 files changed

+16474
-7888
lines changed

Some content is hidden

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

580 files changed

+16474
-7888
lines changed

.devcontainer/codespaces.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ gh codespace ports visibility 3000:public -c $CODESPACE_NAME
1111
gh codespace ports visibility 4200:public -c $CODESPACE_NAME
1212
export BACKEND_URL=$(gh codespace ports -c $CODESPACE_NAME --json sourcePort,browseUrl | jq -r '.[] | select(.sourcePort == 3000) | .browseUrl')
1313
sed -i "s|apiUrl: 'http://localhost:3000/v1'|apiUrl: '${BACKEND_URL}/v1'|g" /workspace/packages/ui/common/src/lib/environments/environment.ts
14-
sed -i "s|AP_WEBHOOK_URL=\"http://localhost:3000\"|AP_WEBHOOK_URL=\"${BACKEND_URL}\"|g" /workspace/packages/backend/.env
14+
sed -i "s|AP_WEBHOOK_URL=\"http://localhost:3000\"|AP_WEBHOOK_URL=\"${BACKEND_URL}\"|g" /workspace/packages/server/api/.env

.github/workflows/build-cloud-nx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
parallel-commands-on-agents: |
2020
npx nx affected --target=lint --parallel=3
2121
npx nx affected --target=build -c production --parallel=3
22-
npx nx run-many --target=test --projects=engine,shared,backend --parallel=3
22+
npx nx run-many --target=test --projects=engine,shared,server-api --parallel=3
2323
2424
agents:
2525
name: Nx Cloud - Agents

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ tmp
66
.nx/
77
/out-tsc
88
firebase-admin-sdk.json
9-
cache
109
dev
1110

1211
# SDK Build
@@ -49,7 +48,6 @@ Thumbs.db
4948
.angular
5049
activepieces-engine.js
5150
.history/
52-
packages/backend/.env
5351

5452
# produced by unsandboxed engine execution
5553
.pnpm-store
@@ -61,4 +59,3 @@ packages/backend/.env
6159
scratch.md
6260

6361
# environment variables
64-
.env

.husky/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
. "$(dirname -- "$0")/_/husky.sh"
33

44
# Check if the commit includes changes to the backend's .env file
5-
if git diff --cached --name-only -- packages/backend/.env | grep -q '^packages/backend/.env$'; then
5+
if git diff --cached --name-only -- packages/server/api/.env | grep -q '^packages/server/api/.env$'; then
66
echo "Error: You're attempting to commit the backend's .env file. Please avoid committing this file."
77
exit 1
88
fi

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ COPY . .
4949
COPY .npmrc package.json package-lock.json ./
5050
RUN npm ci
5151

52-
RUN npx nx run-many --target=build --projects=backend,ui-core --configuration production --skip-nx-cache
52+
RUN npx nx run-many --target=build --projects=server-api,ui-core --configuration production --skip-nx-cache
5353

5454
# Install backend production dependencies
55-
RUN cd dist/packages/backend && npm install --production --force
55+
RUN cd dist/packages/server/api && npm install --production --force
5656

5757
### STAGE 2: Run ###
5858
FROM base AS run
5959

6060
# Set up backend
6161
WORKDIR /usr/src/app
6262

63-
COPY packages/backend/src/assets/default.cf /usr/local/etc/isolate
63+
COPY packages/server/api/src/assets/default.cf /usr/local/etc/isolate
6464

6565
# Install Nginx and gettext for envsubst
6666
RUN apt-get update && apt-get install -y nginx gettext

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Copyright (c) 2020-2024 Activepieces Inc.
22

33
Portions of this software are licensed as follows:
44

5-
* All content that resides under the "packages/ee/" and "packages/backend/src/app/ee/" directory of this repository, if that directory exists, is licensed under the license defined in packages/ee/LICENSE
5+
* All content that resides under the "packages/ee/" and "packages/server/api/src/app/ee" directory of this repository, if that directory exists, is licensed under the license defined in packages/ee/LICENSE
66
* All third party components incorporated into the Activepieces Inc Software are licensed under the original license provided by the owner of the applicable component.
77
* Content outside of the above mentioned directories or restrictions above is available under the "MIT Expat" license as defined below.
88

docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
nginx -g "daemon off;" &
55

66
# Start backend server
7-
node --enable-source-maps dist/packages/backend/main.js
7+
node --enable-source-maps dist/packages/server/api/main.js

docs/about/license.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Activepieces' **core** is released as open source under the [MIT license](https:
88

99
The MIT license is a permissive license that grants users the freedom to use, modify, or distribute the software without any significant restrictions. The only requirement is that you include the license notice along with the software when distributing it.
1010

11-
Using the enterprise features (under the packages/ee and packages/backend/src/app/ee folder) with a self-hosted instance requires an Activepieces license. If you are looking for these features, contact us at [[email protected]](mailto:[email protected]).
11+
Using the enterprise features (under the packages/ee and packages/server/api/src/app/ee folder) with a self-hosted instance requires an Activepieces license. If you are looking for these features, contact us at [[email protected]](mailto:[email protected]).
1212

1313
**Benefits of Dual Licensing Repo**
1414

docs/developers/architecture/repo-structure.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The repository is structured as a monorepo using the NX build system, with TypeS
99
.
1010
├── packages
1111
│ ├── ui
12-
│ ├── backend
12+
│ ├── server
1313
| ├── ee
1414
│ ├── engine
1515
│ ├── pieces
@@ -18,7 +18,7 @@ The repository is structured as a monorepo using the NX build system, with TypeS
1818
```
1919

2020
- `ui`: This package contains the user interface, implemented using the Angular framework.
21-
- `backend`: This package contains the API implementation, using the Fastify framework.
21+
- `server`: This package contains the API implementation, using the Fastify framework.
2222
- `ee`: This package contains features that are only available in the paid edition.
2323
- `engine`: This package contains the logic for flow execution within the sandbox.
2424
- `pieces`: This package contains the implementation of triggers and actions for third-party apps.

docs/developers/building-pieces/create-action.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export const gelato = createPiece({
169169

170170
# Testing
171171

172-
By default, the development setup only builds specific components. Open the file `packages/backend/.env` and include "gelato" in the `AP_DEV_PIECES`.
172+
By default, the development setup only builds specific components. Open the file `packages/server/api/.env` and include "gelato" in the `AP_DEV_PIECES`.
173173

174174
For more details, check out the [Piece Development](../development-setup/getting-started) section.
175175

0 commit comments

Comments
 (0)