diff --git a/.github/workflows/build-pull-request.yaml b/.github/workflows/build-main.yaml similarity index 74% rename from .github/workflows/build-pull-request.yaml rename to .github/workflows/build-main.yaml index 57a4bcbd..2f914b16 100644 --- a/.github/workflows/build-pull-request.yaml +++ b/.github/workflows/build-main.yaml @@ -1,10 +1,9 @@ - -name: Pull Request Build +name: Main Build on: - pull_request: - branches: [ main ] - + push: + branches: [main] + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml new file mode 100644 index 00000000..522afcb5 --- /dev/null +++ b/.github/workflows/build-release.yaml @@ -0,0 +1,10 @@ +name: Release Build + +on: + push: + tags: + - "*.*.*" + +jobs: + build: + uses: ./.github/workflows/workflow-build.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yaml similarity index 84% rename from .github/workflows/build.yml rename to .github/workflows/build.yaml index 6b3b0135..e744b8cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yaml @@ -1,9 +1,9 @@ name: Build on: - push: - branches: [ main ] - + pull_request: + branches: [main] + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yaml similarity index 94% rename from .github/workflows/deploy.yml rename to .github/workflows/deploy.yaml index 29d772c8..7fe3e217 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yaml @@ -2,10 +2,9 @@ name: Deploy on: workflow_run: - workflows: [ Build ] - branches: [ main ] - types: [ completed ] - + workflows: ["Main Build"] + types: [completed] + concurrency: group: ${{ github.ref }} cancel-in-progress: false @@ -36,7 +35,7 @@ jobs: with: node-version: 18 - - name: Install AWS CDK + - name: Install AWS CDK run: | npm install -g aws-cdk diff --git a/.github/workflows/publish-docker-image.yaml b/.github/workflows/docker-build-and-publish.yaml similarity index 68% rename from .github/workflows/publish-docker-image.yaml rename to .github/workflows/docker-build-and-publish.yaml index 1dae6ba1..81d97726 100644 --- a/.github/workflows/publish-docker-image.yaml +++ b/.github/workflows/docker-build-and-publish.yaml @@ -1,9 +1,9 @@ -name: Release Build and Push +name: Docker Build and Push on: - push: - tags: - - "*.*.*" + workflow_run: + workflows: ["Release Build"] + types: [completed] env: REGISTRY_IMAGE_API: fynnfluegge/rocketnotes-api @@ -20,6 +20,10 @@ env: jobs: build-and-push: runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18.x] + steps: - name: Checkout code uses: actions/checkout@v4 @@ -30,6 +34,22 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - uses: dawidd6/action-download-artifact@v2 + with: + name: webapp-build + path: webapp/build + run_id: ${{ github.event.workflow_run.id }} + + - uses: actions/setup-python@v5 + with: + python-version: "3.9" + + - uses: aws-actions/setup-sam@v2 + with: + use-installer: true + token: ${{ secrets.GITHUB_TOKEN }} + - run: sam build + - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -44,10 +64,11 @@ jobs: uses: docker/build-push-action@v5 with: context: . + file: ./Dockerfile.sam platforms: linux/amd64,linux/arm64 push: true tags: | - ${{ env.REGISTRY_IMAGE_API }}:${{ env.RELEASE_TAG }} + ${{ env.REGISTRY_IMAGE }}:${{ env.RELEASE_TAG }} ${{ env.REGISTRY_IMAGE_API }}:latest - name: Build and push Docker image webapp @@ -57,5 +78,5 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: | - ${{ env.REGISTRY_IMAGE_WEBAPP }}:${{ env.RELEASE_TAG }} + ${{ env.REGISTRY_IMAGE }}:${{ env.RELEASE_TAG }} ${{ env.REGISTRY_IMAGE_WEBAPP }}:latest diff --git a/.github/workflows/electron-build-and-publish.yaml b/.github/workflows/electron-build-and-publish.yaml new file mode 100644 index 00000000..87bc5f73 --- /dev/null +++ b/.github/workflows/electron-build-and-publish.yaml @@ -0,0 +1,64 @@ +name: Electron Build and Publish + +on: + workflow_run: + workflows: ["Release Build"] + types: [completed] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18.x] + + steps: + - uses: actions/checkout@v3 + + - name: Cache node modules + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Build electron app + run: | + cd webapp + npm ci + npm run build-electron + env: + AWS_REGION: ${{ vars.AWS_REGION }} + DOMAIN_NAME: ${{ vars.DOMAIN_NAME }} + API_URL: ${{ vars.API_URL }} + COGNITO_USER_POOL_ID: ${{ vars.COGNITO_USER_POOL_ID }} + COGNITO_APP_CLIENT_ID: ${{ vars.COGNITO_APP_CLIENT_ID }} + REDIRECT_SIGN_IN: ${{ vars.REDIRECT_SIGN_IN }} + REDIRECT_SIGN_OUT: ${{ vars.REDIRECT_SIGN_OUT }} + AUTH_GUARD_REDIRECT: ${{ vars.AUTH_GUARD_REDIRECT }} + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@master + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} + aws-region: ${{ vars.AWS_REGION }} + + - name: Bundle and Publish electron + run: | + cd webapp + npm run bundle-electron + env: + AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }} + AWS_REGION: ${{ vars.AWS_REGION }} diff --git a/.github/workflows/workflow-build.yaml b/.github/workflows/workflow-build.yaml index 5176941e..8ad17ac9 100644 --- a/.github/workflows/workflow-build.yaml +++ b/.github/workflows/workflow-build.yaml @@ -1,4 +1,3 @@ - name: Reusable Build Workflow on: diff --git a/README.md b/README.md index 14ce58c7..42783d8f 100644 --- a/README.md +++ b/README.md @@ -16,14 +16,15 @@ It utilizes a [100% Serverless RAG pipeline](https://medium.com/@fynnfluegge/ser [langchain](https://github.com/langchain-ai/langchain), [sentence-transformers](https://github.com/UKPLab/sentence-transformers), [faiss](https://github.com/facebookresearch/faiss), -[Ollama](https://github.com/jmorganca/ollama) and OpenAI or Anthropic. +[Ollama](https://github.com/jmorganca/ollama) and OpenAI or Anthropic. ## How to use - [Sign Up](https://takeniftynotes.auth.eu-central-1.amazoncognito.com/login?response_type=code&client_id=tt3v27pnqqh7elqdvq9tgmr9v&redirect_uri=https://app.takeniftynotes.net) for free - Run it 100% [locally with Docker](INSTALLATION.md#run-with-docker) - Host at [AWS](INSTALLATION.md#aws-hosting) -- Check [contributing guide](CONTRIBUTING.md#contributing-guide) how to setup a local development environment +- Check [Contribution Guide](CONTRIBUTING.md#contributing-guide) how to setup a local development environment + - If you are interested in contributing, visit [Contributing](README.md#Contributing) section for more details. ## ✨ Features @@ -41,7 +42,7 @@ It utilizes a [100% Serverless RAG pipeline](https://medium.com/@fynnfluegge/ser - 📥 Zettelkasten with semantic archiving - Use vector index to insert notes into highest semantic-ranked documents - WIP: Neovim plugin [rocketnotes.nvim](https://github.com/fynnfluegge/rocketnotes.nvim) - +  
@@ -104,9 +105,10 @@ It utilizes a [100% Serverless RAG pipeline](https://medium.com/@fynnfluegge/ser
- ## Contributing +A good way to do the first contribution are the *good first issue* labelled issues [here](https://github.com/fynnfluegge/rocketnotes/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22). On some of the issues are already linked PRs with comments in the code what has to be done. These PRs can be picked up if not assigned to someone yet. + The most comfortable way to get started is to open the project in a ready-to-code Gitpod workspace with all packages & tools preinstalled and a running database with sample data.
@@ -117,7 +119,7 @@ The most comfortable way to get started is to open the project in a ready-to-cod   -If you prefer to setup the project on your local machine see [contributing guide](CONTRIBUTING.md#contributing-guide) and learn all required steps to run it locally in development mode. +If you prefer to setup the project on your local machine see [Contributing Guide](CONTRIBUTING.md#contributing-guide) and learn all required steps to run it locally in development mode. Don't hesitate to open an issue for getting some feedback about a potential bug or if you desire a missing feature. It is appreciated to check over current [issues](https://github.com/fynnfluegge/rocketnotes/issues) and provide feedback to existing ones or even raise a PR which solves an issue. diff --git a/landing-page/src/app/app.component.html b/landing-page/src/app/app.component.html index 767a3bd6..cb6916bf 100644 --- a/landing-page/src/app/app.component.html +++ b/landing-page/src/app/app.component.html @@ -23,7 +23,7 @@ macOS diff --git a/webapp/Dockerfile b/webapp/Dockerfile index 1f91e141..9a3d7846 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /root/ COPY ./build ./build COPY package*.json ./ -RUN npm install +RUN npm install --omit=dev COPY server.js ./ EXPOSE 3001 diff --git a/webapp/package.json b/webapp/package.json index 60af65b8..a7bb16ea 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -1,6 +1,6 @@ { "name": "webapp", - "version": "1.0.2", + "version": "1.0.0", "main": "electron.js", "scripts": { "ng": "ng", @@ -12,7 +12,7 @@ "build": "npm run config-prod && ng build --configuration production", "build-local": "export API_URL='http://localhost:3002' && npm run config-dev && ng build", "build-electron": "npm run config-prod && ng build --configuration production --base-href ./", - "bundle-electron": "./node_modules/.bin/electron-builder", + "bundle-electron": "./node_modules/.bin/electron-builder --publish always", "test": "ng test" }, "private": true,