Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/ever-co/ever-teams into …
Browse files Browse the repository at this point in the history
…fix/get-api-performance
  • Loading branch information
badalkhatri0924 committed Dec 7, 2023
2 parents 0a34e09 + 6844b65 commit 81977c2
Show file tree
Hide file tree
Showing 66 changed files with 3,344 additions and 702 deletions.
6 changes: 6 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@
"cloudinary",
"clsx",
"clsxm",
"opentelemetry",
"otlp",
"commitlint",
"greenkeeper",
"classpath",
"tsbuildinfo",
"sentryclirc",
"compodoc",
"consectetur",
"dolor",
Expand Down
10 changes: 8 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,26 @@ Jenkinsfile

**/.next
**/build
**/node_modules/*
**/dist
**/out

**/*.log

**/.vscode

**/.env
**/.env.local
**/.env*.local
**/.env*.sample
apps/**/.env
apps/**/.env.local
apps/**/.env*.local
apps/**/.env*.sample

fly.toml

node_modules

**/node_modules/*
apps/mobile/node_modules
apps/desktop/node_modules
apps/extensions/node_modules
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Web Build & Deploy DEV
name: Web Build & Vercel Deploy DEV
on:
push:
branches:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Web Build & Deploy PROD
name: Web Build & Vercel Deploy PROD
on:
push:
branches:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/docker-build-publish-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ concurrency:
jobs:
ever-teams-webapp:
runs-on: buildjet-8vcpu-ubuntu-2204

environment: dev

steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -21,6 +24,9 @@ jobs:
- name: Set up Docker Buildx

Check warning on line 24 in .github/workflows/docker-build-publish-dev.yml

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (Buildx)
uses: docker/setup-buildx-action@v2

Check warning on line 25 in .github/workflows/docker-build-publish-dev.yml

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (buildx)

- name: Output NEXT_PUBLIC_GAUZY_API_SERVER_URL
run: echo "NEXT_PUBLIC_GAUZY_API_SERVER_URL=${{ secrets.NEXT_PUBLIC_GAUZY_API_SERVER_URL }}"

- name: Build and push
uses: docker/build-push-action@v4
with:
Expand All @@ -36,6 +42,21 @@ jobs:
cache-to: type=inline
build-args: |
NODE_ENV=development
NEXT_PUBLIC_GAUZY_API_SERVER_URL=${{ secrets.NEXT_PUBLIC_GAUZY_API_SERVER_URL }}
NEXT_PUBLIC_GA_MEASUREMENT_ID=${{ secrets.NEXT_PUBLIC_GA_MEASUREMENT_ID }}
NEXT_PUBLIC_CAPTCHA_SITE_KEY=${{ secrets.NEXT_PUBLIC_CAPTCHA_SITE_KEY }}
NEXT_PUBLIC_DISABLE_AUTO_REFRESH=false
NEXT_PUBLIC_COOKIE_DOMAINS=${{ secrets.NEXT_PUBLIC_COOKIE_DOMAINS }}
NEXT_PUBLIC_BOARD_APP_DOMAIN=${{ secrets.NEXT_PUBLIC_BOARD_APP_DOMAIN }}
NEXT_PUBLIC_BOARD_BACKEND_POST_URL=${{ secrets.NEXT_PUBLIC_BOARD_BACKEND_POST_URL }}
NEXT_PUBLIC_BOARD_FIREBASE_CONFIG=${{ secrets.NEXT_PUBLIC_BOARD_FIREBASE_CONFIG }}
NEXT_PUBLIC_MEET_DOMAIN=${{ secrets.NEXT_PUBLIC_MEET_DOMAIN }}
NEXT_PUBLIC_SENTRY_DSN=${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}
NEXT_PUBLIC_SENTRY_DEBUG=${{ secrets.NEXT_PUBLIC_SENTRY_DEBUG }}
NEXT_PUBLIC_JITSU_BROWSER_URL=${{ secrets.NEXT_PUBLIC_JITSU_BROWSER_URL }}
NEXT_PUBLIC_JITSU_BROWSER_WRITE_KEY=${{ secrets.NEXT_PUBLIC_JITSU_BROWSER_WRITE_KEY }}
NEXT_PUBLIC_GITHUB_APP_NAME=ever-github
NEXT_PUBLIC_CHATWOOT_API_KEY=${{ secrets.NEXT_PUBLIC_CHATWOOT_API_KEY }}
- name: Login to DockerHub
uses: docker/login-action@v2
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/docker-build-publish-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ concurrency:
jobs:
ever-teams-webapp:
runs-on: buildjet-8vcpu-ubuntu-2204

environment: prod

steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -21,6 +24,9 @@ jobs:
- name: Set up Docker Buildx

Check warning on line 24 in .github/workflows/docker-build-publish-prod.yml

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (Buildx)
uses: docker/setup-buildx-action@v2

Check warning on line 25 in .github/workflows/docker-build-publish-prod.yml

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (buildx)

- name: Output NEXT_PUBLIC_GAUZY_API_SERVER_URL
run: echo "NEXT_PUBLIC_GAUZY_API_SERVER_URL=${{ secrets.NEXT_PUBLIC_GAUZY_API_SERVER_URL }}"

- name: Build and push
uses: docker/build-push-action@v4
with:
Expand All @@ -36,6 +42,21 @@ jobs:
cache-to: type=inline
build-args: |
NODE_ENV=production
NEXT_PUBLIC_GAUZY_API_SERVER_URL=${{ secrets.NEXT_PUBLIC_GAUZY_API_SERVER_URL }}
NEXT_PUBLIC_GA_MEASUREMENT_ID=${{ secrets.NEXT_PUBLIC_GA_MEASUREMENT_ID }}
NEXT_PUBLIC_CAPTCHA_SITE_KEY=${{ secrets.NEXT_PUBLIC_CAPTCHA_SITE_KEY }}
NEXT_PUBLIC_DISABLE_AUTO_REFRESH=false
NEXT_PUBLIC_COOKIE_DOMAINS=${{ secrets.NEXT_PUBLIC_COOKIE_DOMAINS }}
NEXT_PUBLIC_BOARD_APP_DOMAIN=${{ secrets.NEXT_PUBLIC_BOARD_APP_DOMAIN }}
NEXT_PUBLIC_BOARD_BACKEND_POST_URL=${{ secrets.NEXT_PUBLIC_BOARD_BACKEND_POST_URL }}
NEXT_PUBLIC_BOARD_FIREBASE_CONFIG=${{ secrets.NEXT_PUBLIC_BOARD_FIREBASE_CONFIG }}
NEXT_PUBLIC_MEET_DOMAIN=${{ secrets.NEXT_PUBLIC_MEET_DOMAIN }}
NEXT_PUBLIC_SENTRY_DSN=${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}
NEXT_PUBLIC_SENTRY_DEBUG=${{ secrets.NEXT_PUBLIC_SENTRY_DEBUG }}
NEXT_PUBLIC_JITSU_BROWSER_URL=${{ secrets.NEXT_PUBLIC_JITSU_BROWSER_URL }}
NEXT_PUBLIC_JITSU_BROWSER_WRITE_KEY=${{ secrets.NEXT_PUBLIC_JITSU_BROWSER_WRITE_KEY }}
NEXT_PUBLIC_GITHUB_APP_NAME=ever-github
NEXT_PUBLIC_CHATWOOT_API_KEY=${{ secrets.NEXT_PUBLIC_CHATWOOT_API_KEY }}
- name: Login to DockerHub
uses: docker/login-action@v2
Expand Down
53 changes: 47 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
# syntax = docker/dockerfile:1

# Adjust NODE_VERSION as desired
# Ever Teams Platform

ARG NODE_VERSION=18.17.1
ARG NEXT_PUBLIC_GAUZY_API_SERVER_URL=https://api.gauzy.co
ARG NEXT_PUBLIC_GA_MEASUREMENT_ID
ARG NEXT_PUBLIC_CAPTCHA_SITE_KEY
ARG NEXT_PUBLIC_DISABLE_AUTO_REFRESH=false
ARG NEXT_PUBLIC_COOKIE_DOMAINS=ever.team
ARG NEXT_PUBLIC_BOARD_APP_DOMAIN=https://board.ever.team
ARG NEXT_PUBLIC_BOARD_BACKEND_POST_URL=https://jsonboard.ever.team/api/v2/post/
ARG NEXT_PUBLIC_BOARD_FIREBASE_CONFIG
ARG NEXT_PUBLIC_MEET_DOMAIN=https://meet.ever.team
ARG NEXT_PUBLIC_SENTRY_DSN
ARG NEXT_PUBLIC_SENTRY_DEBUG
ARG NEXT_PUBLIC_JITSU_BROWSER_URL
ARG NEXT_PUBLIC_JITSU_BROWSER_WRITE_KEY
ARG NEXT_PUBLIC_GITHUB_APP_NAME=ever-github
ARG NEXT_PUBLIC_CHATWOOT_API_KEY

FROM node:${NODE_VERSION}-slim as base

# Output the environment variable value
RUN echo "NEXT_PUBLIC_GAUZY_API_SERVER_URL=${NEXT_PUBLIC_GAUZY_API_SERVER_URL}"

LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.source https://github.com/ever-co/ever-teams

# Next.js app lives here
WORKDIR /app

Expand All @@ -14,17 +37,33 @@ ENV NEXT_SHARP_PATH=/temp/node_modules/sharp
RUN npm i -g npm@latest
# Install sharp, NextJS image optimization
RUN mkdir /temp && cd /temp && \
npm i sharp
npm i sharp

RUN npm cache clean --force


# Throw-away build stage to reduce size of final image
FROM base as build

# We make env vars passed as build argument to be available in this build stage because we prebuild the NextJs app
ARG NEXT_PUBLIC_GAUZY_API_SERVER_URL
ARG NEXT_PUBLIC_GA_MEASUREMENT_ID
ARG NEXT_PUBLIC_CAPTCHA_SITE_KEY
ARG NEXT_PUBLIC_DISABLE_AUTO_REFRESH
ARG NEXT_PUBLIC_COOKIE_DOMAINS
ARG NEXT_PUBLIC_BOARD_APP_DOMAIN
ARG NEXT_PUBLIC_BOARD_BACKEND_POST_URL
ARG NEXT_PUBLIC_BOARD_FIREBASE_CONFIG
ARG NEXT_PUBLIC_MEET_DOMAIN
ARG NEXT_PUBLIC_SENTRY_DSN
ARG NEXT_PUBLIC_SENTRY_DEBUG
ARG NEXT_PUBLIC_JITSU_BROWSER_URL
ARG NEXT_PUBLIC_JITSU_BROWSER_WRITE_KEY
ARG NEXT_PUBLIC_GITHUB_APP_NAME
ARG NEXT_PUBLIC_CHATWOOT_API_KEY

# Install packages needed to build node modules
RUN apt-get update -qq && \
apt-get install -y build-essential pkg-config python-is-python3
apt-get install -y build-essential pkg-config python-is-python3

# Install Yarn
RUN npm install -g yarn --force
Expand All @@ -35,19 +74,21 @@ COPY yarn.lock ./
COPY apps/web/package.json ./apps/web/package.json

RUN cd apps/web && \
yarn install --ignore-scripts
yarn install --ignore-scripts

# Copy application code
COPY . .

ENV NODE_ENV=production

RUN echo $NEXT_PUBLIC_GAUZY_API_SERVER_URL

# Build application
RUN yarn run build:web

# Remove development dependencies
RUN cd apps/web && \
yarn install --prod --ignore-scripts
yarn install --prod --ignore-scripts

RUN yarn cache clean

Expand Down
7 changes: 3 additions & 4 deletions Layerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ RUN apt-get update && \
apt-get update && \
apt-get install docker-ce docker-ce-cli containerd.io

COPY . .
RUN REPEATABLE docker pull everco/ever-teams-webapp

RUN REPEATABLE docker build -t ever-teams .

RUN REPEATABLE docker run -d -p 3000:3000 ever-teams && sleep 5
RUN REPEATABLE (docker rm ever-teams --force || true) &&\
docker run --name ever-teams -d -p 3000:3000 everco/ever-teams-webapp && sleep 5

EXPOSE WEBSITE localhost:3000
23 changes: 23 additions & 0 deletions Layerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM vm/ubuntu:18.04

MEMORY 8G

# install the latest version of Docker, as in the official Docker installation tutorial.
RUN apt-get update && \
apt-get install ca-certificates curl gnupg lsb-release && \
sudo mkdir -p /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |\
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt-get update && \
apt-get install docker-ce docker-ce-cli containerd.io

COPY . .

RUN REPEATABLE docker build -t ever-teams .

RUN REPEATABLE (docker rm ever-teams --force || true) &&\
docker run --name ever-teams -d -p 3000:3000 ever-teams && sleep 5

EXPOSE WEBSITE localhost:3000
22 changes: 22 additions & 0 deletions Layerfile.node
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM vm/ubuntu:22.04

ENV NODE_MAJOR=20

# install the latest version of Docker, as in the official Docker installation tutorial.
RUN apt-get update &&\
apt-get install -y ca-certificates curl gnupg &&\
sudo mkdir -p /etc/apt/keyrings &&\
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg &&\
echo \
"deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" |\
sudo tee /etc/apt/sources.list.d/nodesource.list &&\
apt-get update &&\
apt-get install nodejs yarn -y

COPY . .

RUN REPEATABLE cd apps/web && yarn install && yarn build

RUN BACKGROUND yarn start:web

EXPOSE WEBSITE localhost:3000
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ WIP

[![Deploy to Koyeb](https://www.koyeb.com/static/images/deploy/button.svg)](https://app.koyeb.com/deploy?name=ever-teams&type=docker&builder=dockerfile&image=ghcr.io/ever-co/ever-teams-webapp:latest&env[PORT]=3000&ports=3000;http;/)

### Northflank

[Deploy to Northflank](https://app.northflank.com/s/account/templates/new?data=656ed069216b5d387f5379c6)

## 📄 Content

- `/web` - NextJs-based (React) Web App at <https://app.ever.team> (deployed from `main` branch)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ const TaskMainInfo = observer(() => {
>
<TaskVersion
task={task}
canCreateVersion={true}
containerStyle={{
width: '70%',
borderRadius: 3
Expand Down Expand Up @@ -187,6 +188,7 @@ const TaskMainInfo = observer(() => {
>
<TaskStatus
task={task}
canCreateStatus={true}
containerStyle={{
width: '70%',
borderRadius: 3,
Expand Down Expand Up @@ -226,6 +228,7 @@ const TaskMainInfo = observer(() => {
>
<TaskSize
task={task}
canCreateSize={true}
containerStyle={{
width: '70%',
borderRadius: 3,
Expand All @@ -245,6 +248,7 @@ const TaskMainInfo = observer(() => {
>
<TaskPriority
task={task}
canCreatePriority={true}
containerStyle={{
width: '70%',
borderRadius: 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,21 @@ const ManageAssignees: React.FC<IManageAssignees> = ({ memberList, task }) => {
const assignedToTaskMembers = useMemo(
() =>
memberList?.filter((member) =>
member.employee ? task?.members.map((item) => item.userId).includes(member.employee?.userId) : false
member.employee
? task?.members.map((item) => item.userId).includes(member.employee?.userId) &&
member.employee?.isActive
: false
),
[memberList, task?.members]
);

const unassignedMembers = useMemo(
() =>
memberList?.filter((member) =>
member.employee ? !task?.members.map((item) => item.userId).includes(member.employee.userId) : false
member.employee
? !task?.members.map((item) => item.userId).includes(member.employee.userId) &&
member.employee?.isActive
: false
),
[memberList, task?.members]
);
Expand Down
Loading

0 comments on commit 81977c2

Please sign in to comment.