Skip to content

Commit

Permalink
Merge pull request #4 from mondaycom/feat/dorsh/add_documentation_and…
Browse files Browse the repository at this point in the history
…_fixes

Adjust readme and github action
  • Loading branch information
DorShakedMonday authored Apr 18, 2024
2 parents bc55bce + 5e0cc23 commit a9c9c5c
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ jobs:
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ steps.package.outputs.version }}
tags: |
ghcr.io/${{ github.repository }}:${{ steps.package.outputs.version }}
ghcr.io/${{ github.repository }}:latest
75 changes: 73 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,74 @@
# apps-sdk-local-server
# Project Title

A local server for the apps-sdk package
This is a Node.js project that uses Docker for containerization. The project is written in TypeScript and uses npm and yarn as package managers.

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites

- Docker
- Node.js
- npm
- yarn

### Installation

1. Clone the repository:

```bash
git clone https://github.com/<username>/<repository>.git
```

2. Navigate to the project directory:

```bash
cd <repository>
```

3. Install the dependencies:

```bash
npm install
```

or

```bash
yarn install
```

## Running the Application

To run the application, you need to set up the Docker environment. The `docker-compose.yml` file is already provided in the repository.

1. Replace `<VOLUME_FOR_LOCAL_SERVER_IN_LOCAL_MACHINE>` in the `docker-compose.yml` file with the path to the volume on your local machine.

2. Set the `VOLUME_PATH` environment variable in the `docker-compose.yml` file to the same path as the volume path.

3. Run the Docker container:

```bash
docker-compose up
```

## Capabilities that require configuration

### Queue

The queue capability is used to manage the execution of tasks in the application. It is particularly useful for handling tasks that are time-consuming and can be processed in the background. The queue ensures that the tasks are executed in the order they were added and that no task is lost in case of a failure.

The queue capability is implemented using the `PUB_SUB_DEV_APP_SERVICE_URL` and `PUB_SUB_RETRY_INTERVAL_IN_SECONDS` environment variables defined in the `docker-compose.yml` file. The `PUB_SUB_DEV_APP_SERVICE_URL` is the URL of the local server that handles the tasks, and the `PUB_SUB_RETRY_INTERVAL_IN_SECONDS` is the time in seconds to retry failed requests to the local server from the queue.

The queue capability is essential for improving the performance and reliability of the application. It allows the application to handle a large number of tasks efficiently and ensures that all tasks are processed even in case of temporary failures.

The application will be accessible at `http://localhost:59999`.

## GitHub Actions

This repository uses GitHub Actions for CI/CD. The workflow is defined in the `.github/workflows/docker-image.yml` file. It automatically builds and pushes the Docker image to the GitHub Container Registry whenever there's a push to the `master` branch or when the workflow is manually triggered.

## License

This project is licensed under the MIT License - see the `LICENSE.md` file for details.
11 changes: 6 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ version: '3'
services:
local_monday_code_api_server:
image: ghcr.io/mondaycom/apps-sdk-local-server:latest
platform: linux/x86_64
user: node
volumes:
- /Users/dorsh/temp/local-volumes:/app/volumes
- <VOLUME_FOR_LOCAL_SERVER_IN_LOCAL_MACHINE>:/app/volumes #- /Users/dorsh/temp/local-volumes:/app/volumes # Example for local volume mapping
working_dir: /app
environment:
- VOLUME_PATH=/Users/dorsh/temp/local-volumes
- PUB_SUB_DEV_APP_SERVICE_URL=http://localhost:3000
- PUB_SUB_RETRY_INTERVAL_IN_SECONDS=600
- NODE_TLS_REJECT_UNAUTHORIZED=0
- VOLUME_PATH=<VOLUME_FOR_LOCAL_SERVER_IN_LOCAL_MACHINE> # Add the same path as the volume path (line 7)
- PUB_SUB_DEV_APP_SERVICE_URL=http://localhost:3000 # Change to your local server URL
- PUB_SUB_RETRY_INTERVAL_IN_SECONDS=600 # Time in seconds to retry failed requests to the local server from the queue
- NODE_TLS_REJECT_UNAUTHORIZED=0 # Required for local development
ports:
- '59999:3000'
command: node ./dist/src/app.js

0 comments on commit a9c9c5c

Please sign in to comment.