Skip to content

Commit f3eab9a

Browse files
committed
#210 - Move current sever-app related docker compose files under server-app, improve CONTRIBUTING guide
1 parent 39e09f2 commit f3eab9a

File tree

7 files changed

+194
-93
lines changed

7 files changed

+194
-93
lines changed

CONTRIBUTING.md

+187-2
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,202 @@ Pull requests are the best way to propose changes to the codebase (we use [Git-F
5151
7. When you raise a pull request, we automatically run tests on our CI. Please ensure that all the tests are passing for your code change. We will not be able to accept your change if the test suite doesn't pass.
5252
8. Documentation: When new features are added or there are changes to existing features that require updates to documentation, we encourage you to add/update any missing documentation in the [`/docs` folder](https://github.com/bytechefhq/bytechef/tree/master/docs). To update an existing documentation page, you can simply click on the `Edit this page` button on the bottom left corner of the documentation page.
5353

54+
5455
# Setup for local development
5556

57+
## Client Side
58+
59+
This section explains how you can setup a development environment for ByteChef client app. ByteChef's client (UI/frontend) uses the ReactJS library and Typescript.
60+
61+
### Prerequisites
62+
63+
- Node v16+
64+
- [Docker](https://docs.docker.com/get-docker/)
65+
66+
### Steps for setup
67+
68+
1. Clone the ByteChef repository(if you haven't already), open terminal and `cd` into it
69+
70+
```bash
71+
git clone https://github.com/bytechefhq/bytechef.git
72+
cd bytechef
73+
```
74+
75+
2. Change your directory to the `client` folder.
76+
77+
```bash
78+
cd client
79+
```
80+
81+
2. Install dependencies.
82+
83+
```bash
84+
npm install
85+
```
86+
87+
3. Serve with hot reload.
88+
89+
```bash
90+
npm run dev
91+
```
92+
93+
Your ByteChef client is now running on <http://localhost:5173>.
94+
95+
#### Note:
96+
By default, your client app points to the local API server - http://localhost:5173. If you don't have the API server running on your local system, your page will load with errors. To set up the API server on your local system, please follow the instructions [here](#setup-with-docker).
97+
98+
### Running Lint
99+
100+
```bash
101+
npm run lint
102+
```
103+
104+
### Running Typecheck
105+
106+
```bash
107+
npm run typecheck
108+
```
109+
110+
### Running Build
111+
112+
```bash
113+
npm run build
114+
```
115+
116+
### Running Tests
117+
118+
```bash
119+
npm run test
120+
```
121+
56122
## Server Side
57123

124+
This section explains how you can set up a development environment for ByteChef server instance. As the server codebase is written in Java and is powered by Spring, you need Java and Gradle installed to build the code. You also need one instance of PostgreSQL and Redis each to run ByteChef server instance.
125+
126+
## Setup with Docker
127+
128+
Build and run the server codebase in a Docker container. This is the easiest way to get the server instance up and running if you are more interested in contributing to the [client codebase](#client-side).
129+
58130
### Prerequisites
59131

60-
TODO
132+
[Docker](https://docs.docker.com/get-docker/)
61133

62134
### Steps for setup
63135

64-
TODO
136+
1. Clone the ByteChef repository(if you haven't already), open terminal and `cd` into it
137+
138+
```bash
139+
git clone https://github.com/bytechefhq/bytechef.git
140+
cd bytechef
141+
```
142+
143+
2. Change your directory to the `server` folder.
144+
145+
```bash
146+
cd server
147+
```
148+
149+
3. Start up the container
150+
151+
```bash
152+
docker compose -f docker-compose.dev.server.yml up -d
153+
```
154+
155+
#### Other useful Commands
156+
157+
Stop locally built server instance.
158+
159+
```bash
160+
docker compose -f docker-compose.dev.server.yml down
161+
```
162+
163+
Rebuild a docker image of the locally built server instance.
164+
165+
```bash
166+
docker compose -f docker-compose.dev.server.yml down --rmi local
167+
docker compose -f docker-compose.dev.server.yml up -d
168+
```
169+
170+
#### Troubleshooting
171+
172+
Out of date schema
173+
174+
If you see `Either revert the changes to the migration, or run repair to update the schema history` in the terminal log when experiencing errors, execute the following command which will remove the out of date schemas:
175+
176+
```bash
177+
docker compose -f deploy/docker/docker-compose.dev.server.yml down -v
178+
```
179+
180+
181+
## Local Setup
182+
183+
This section doesn't provide instructions to install Java and Gradle because these vary between different operating systems and distributions. Please refer to the documentation of your operating system or package manager to install these tools.
184+
185+
### Prerequisites
186+
187+
- [Docker](https://docs.docker.com/get-docker/)
188+
- Java - OpenJDK 17.
189+
- Gradle - V7.6+.
190+
- A PostgreSQL database - Refer to the [Setting up local development infrastructure](#setting-up-local-development-infrastructure-using-docker).
191+
- A Redis instance - Refer to the [Setting up local development infrastructure](#setting-up-local-development-infrastructure-using-docker).
192+
193+
### Steps for setup
194+
195+
1. Clone the ByteChef repository, open terminal and `cd` into it
196+
197+
```bash
198+
git clone https://github.com/bytechefhq/bytechef.git
199+
cd bytechef
200+
```
201+
202+
#### Setting up local development infrastructure using Docker
203+
204+
2. Change your directory to th `server` folder.
205+
206+
```bash
207+
cd server
208+
```
209+
210+
3. Use `docker-compose.dev.infra.yml` for running required infrastructure(PostgreSQL, Redis):
211+
212+
```bash
213+
docker compose -f docker-compose.dev.infra.yml up -d
214+
```
215+
216+
#### Building and running the code
217+
218+
3. Run the following command to compile codebase:
219+
220+
```bash
221+
../gradlew clean compileJava
222+
```
223+
224+
4. Change your directory to th `apps/server-app` folder.
225+
226+
```bash
227+
cd apps/server-app
228+
```
229+
230+
5. Start the ByteChef server instance by running :
231+
232+
```bash
233+
../../../gradlew bootRun
234+
```
235+
236+
By default, the server will start on port 9555.
237+
238+
When the server starts, it automatically runs migrations on PostgreSQL and populate it with some initial required data.
239+
240+
You can check the status of the server by hitting the endpoint: http://localhost:9555/webjars/swagger-ui/index.html on your browser to get Swagger UI with the list of API endpoints.
241+
242+
### Running Tests
243+
244+
1. Run the command to execute tests
245+
246+
```bash
247+
cd bytechef
248+
./gradlew test && gw testIntegration
249+
```
65250

66251
## Questions?
67252
Contact us on [Discord](https://discord.gg/PybnUM3Y) or mail us at [support@bytechef.io](mailto:support@bytechef.io).

client/README.md

+1-45
Original file line numberDiff line numberDiff line change
@@ -15,48 +15,4 @@ This project uses many tools like:
1515
- [Eslint](https://eslint.org)
1616
- [Prettier](https://prettier.io)
1717

18-
## Getting Started
19-
20-
### Install
21-
22-
Access the project directory.
23-
24-
```bash
25-
cd client
26-
```
27-
28-
Install dependencies.
29-
30-
```bash
31-
npm install
32-
```
33-
34-
Serve with hot reload at <http://localhost:5173>.
35-
36-
```bash
37-
npm run dev
38-
```
39-
40-
### Lint
41-
42-
```bash
43-
npm run lint
44-
```
45-
46-
### Typecheck
47-
48-
```bash
49-
npm run typecheck
50-
```
51-
52-
### Build
53-
54-
```bash
55-
npm run build
56-
```
57-
58-
### Test
59-
60-
```bash
61-
npm run test
62-
```
18+
For details on setting up your development machine, please refer to the [Setup Guide](../CONTRIBUTING.md#client-side)

deploy/docker/README.md

+3-43
Original file line numberDiff line numberDiff line change
@@ -30,50 +30,10 @@ $ docker-compose --version
3030
docker-compose version 1.29.2, build 5becea4c
3131
```
3232

33-
## Deployed from the Docker registry
33+
## Setup with Docker Compose (recommended)
3434

3535
TODO
3636

37-
## Built from the source code on the local machine
37+
## Setup with Docker run
3838

39-
Build and start locally built server instance.
40-
41-
Open the terminal inside the `deploy/docker` folder.
42-
43-
### 2. Commands
44-
45-
```bash
46-
docker compose -f docker-compose.dev.server.yml up -d
47-
```
48-
49-
Stop locally built server instance.
50-
51-
```bash
52-
docker compose -f docker-compose.dev.server.yml down
53-
```
54-
55-
Rebuild a docker image of the locally built server instance.
56-
57-
```bash
58-
docker compose -f docker-compose.dev.server.yml down --rmi local
59-
docker compose -f docker-compose.dev.server.yml up -d
60-
```
61-
62-
## Local Development infrastructure
63-
64-
Use `docker-compose.dev.infra.yml` for required infrastructure(Postgres, Redis, RabbitMQ) when doing backend development:
65-
66-
```bash
67-
docker compose -f docker-compose.dev.infra.yml up
68-
```
69-
70-
## Troubleshooting
71-
72-
### Out of date schema
73-
74-
If you see `Either revert the changes to the migration, or run repair to update the schema history` in the terminal log when experiencing errors, execute the following command which will remove the out of date schemas:
75-
76-
```bash
77-
docker compose -f deploy/docker/docker-compose.dev.server.yml down -v
78-
79-
```
39+
TODO

server/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# ByteChef Server
22
This is the server-side repository for the ByteChef framework.
33
<br><br>
4-
For details on setting up your development machine, please refer to the [Setup Guide](../CONTRIBUTING.md#setup-for-local-development)
4+
For details on setting up your development machine, please refer to the [Setup Guide](../CONTRIBUTING.md#server-side)

deploy/docker/docker-compose.dev.server.yml server/docker-compose.dev.server.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ services:
2828
- cache:/data
2929
bytechef-server-app:
3030
build:
31-
context: ../../
32-
dockerfile: ./deploy/docker/dev-server/Dockerfile
31+
context: ../
32+
dockerfile: ./server/docker/dev-server/Dockerfile
3333
container_name: bytechef-server
3434
depends_on:
3535
- postgres
File renamed without changes.

0 commit comments

Comments
 (0)