diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 9de5cb7..9e08820 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -48,5 +48,5 @@ jobs: - run: pnpm install - name: Build the application env: - BACKEND_API: "http://localhost:8080" + BACKEND_URL: "http://localhost:8080" run: pnpm build diff --git a/README.md b/README.md index fb58947..74fdb5e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # FlowInquiry Client [![Build status](https://github.com/flowinquiry/flowinquiry-frontend/actions/workflows/node.js.yml/badge.svg)](https://github.com/flowinquiry/flowinquiry-frontend/actions/workflows/node.js.yml) +![License](https://img.shields.io/badge/License-AGPLv3-blue) ## What is FlowInquiry @@ -11,16 +12,16 @@ FlowInquiry is a service designed to streamline the management of cases, tickets FlowInquiry addresses several challenges faced by organizations in managing cases, tickets, and team communication. Here are some specific use cases: **On-Call System Management** -In an on-call system, teams often face challenges in managing incoming requests or incidents, particularly when multiple shifts or team members are involved. FlowInquiry ensures that each request follows a well-defined workflow, with SLAs for escalation and resolution. This helps reduce response times, avoids missed escalations, and provides clear accountability for handling incidents. +Managing incoming requests or incidents in an on-call system can be challenging with multiple shifts and team members. FlowInquiry streamlines the process by enforcing well-defined workflows with SLAs for escalation and resolution, reducing response times, avoiding missed escalations, and ensuring accountability. **Case Management in CRM Applications** -CRM applications often struggle to manage customer cases effectively, especially when handling inquiries, complaints, or service requests. FlowInquiry enables teams to define custom workflows tailored to specific case types, such as refunds, escalations, or product inquiries. SLAs for each workflow stage ensure customers receive timely updates and resolutions, enhancing customer satisfaction and loyalty. +FlowInquiry helps CRM teams manage customer cases like inquiries, complaints, and service requests by enabling custom workflows tailored to case types such as refunds or escalations. SLAs at each workflow stage ensure timely updates and resolutions, boosting customer satisfaction and loyalty. **Team Communication and Collaboration** -Effective communication within and across teams can be difficult in large organizations, especially when requests involve multiple departments or external stakeholders. FlowInquiry acts as a centralized platform where requests are logged, tracked, and routed through clearly defined workflows. This reduces miscommunication, prevents delays, and ensures all parties are aligned on priorities. +FlowInquiry enhances communication across teams by providing a centralized platform to log, track, and route requests through clear workflows. This minimizes miscommunication, prevents delays, and aligns all stakeholders on priorities, even in large organizations. **Service Request Tracking for IT Teams** -IT teams managing internal service requests often encounter bottlenecks due to unclear processes or manual tracking. FlowInquiry allows IT departments to automate workflows for common requests such as software installation, access management, or issue resolution. The system ensures each request is assigned, processed, and resolved within agreed SLAs. +FlowInquiry automates IT service request workflows, such as software installation and access management, reducing bottlenecks caused by manual tracking. It ensures requests are assigned, processed, and resolved efficiently within SLA timelines. By tailoring workflows to these and other scenarios, FlowInquiry empowers teams to streamline operations, meet deadlines, and deliver exceptional service to both internal and external stakeholders. @@ -109,10 +110,10 @@ Set up the application environment variables by running the following script: scripts/init_environments.sh ``` -This script generates environment variables, including NEXT_PUBLIC_BACKEND_API, to establish the communication between the client and server. Example +This script generates environment variables, including BACKEND_URL, to establish the communication between the client and server. Example ``` -NEXT_PUBLIC_API_BASE_URL=http://localhost:8080 +BACKEND_URL=http://localhost:8080 ``` We recommend running the `scripts/all.sh` script, as it streamlines the process by checking your environment settings and performing all necessary configurations, removing the need to execute multiple scripts manually. diff --git a/next.config.mjs b/next.config.mjs index efc8e2a..a87e580 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -6,7 +6,7 @@ const nextConfig = { fallback: [ { source: "/api/:path*", - destination: `${process.env.BACKEND_API}/api/:path*`, + destination: `${process.env.BACKEND_URL}/api/:path*`, }, ], }; diff --git a/scripts/docker_deployment.sh b/scripts/docker_deployment.sh index 2854f2e..1a596ff 100755 --- a/scripts/docker_deployment.sh +++ b/scripts/docker_deployment.sh @@ -24,14 +24,14 @@ docker tag ${IMAGE_NAME} ${REMOTE_REPO}:${TAG} docker tag ${IMAGE_NAME} ${REMOTE_REPO}:latest # Step 3: Log in to the Docker repository (Docker Hub by default) -#echo "Logging into Docker repository..." -#docker login || { echo "Login failed"; exit 1; } -# -## Step 4: Push both tags to the remote repository -#echo "Pushing Docker image to remote repository with tag '${TAG}'..." -#docker push ${REMOTE_REPO}:${TAG} -# -#echo "Pushing Docker image to remote repository with tag 'latest'..." -#docker push ${REMOTE_REPO}:latest -# -#echo "Docker image has been pushed successfully with tags '${TAG}' and 'latest'." +echo "Logging into Docker repository..." +docker login || { echo "Login failed"; exit 1; } + +# Step 4: Push both tags to the remote repository +echo "Pushing Docker image to remote repository with tag '${TAG}'..." +docker push ${REMOTE_REPO}:${TAG} + +echo "Pushing Docker image to remote repository with tag 'latest'..." +docker push ${REMOTE_REPO}:latest + +echo "Docker image has been pushed successfully with tags '${TAG}' and 'latest'." diff --git a/scripts/init_environments.sh b/scripts/init_environments.sh index 8d7953b..710c00d 100755 --- a/scripts/init_environments.sh +++ b/scripts/init_environments.sh @@ -33,7 +33,7 @@ while true; do done # Append to the .env.local file -echo "BACKEND_API=\"$backend_server\"" >> "$output_file" +echo "BACKEND_URL=\"$backend_server\"" >> "$output_file" # Run npx auth and append its output to .env diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 1639f32..c36de8a 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -7,8 +7,7 @@ import { Inter } from "next/font/google"; import AutoInitBackendApi from "@/components/init-api-backend"; import { Toaster } from "@/components/ui/toaster"; import { TooltipProvider } from "@/components/ui/tooltip"; -import { setBackendApi } from "@/lib/runtime-variables"; -import { BackendApiProvider } from "@/providers/backend-api-provider"; +import { setBackendUrl, setBaseUrl } from "@/lib/runtime-variables"; import { ErrorProvider } from "@/providers/error-provider"; import ReactQueryProvider from "@/providers/react-query-provider"; import { ThemeProvider } from "@/providers/theme-provider"; @@ -20,23 +19,20 @@ export const metadata: Metadata = { description: "FlowInquiry dashboard", }; -// Server-side function to fetch the BACKEND_API dynamically -async function getBackendApi(): Promise { - const backendApi = process.env.BACKEND_API; - if (!backendApi) { - throw new Error("BACKEND_API is not defined in the environment"); - } - return backendApi; -} - const RootLayout = async ({ children, }: Readonly<{ children: React.ReactNode; }>) => { - const backendApi = await getBackendApi(); + const backendUrl = process.env.BACKEND_URL; + if (!backendUrl) { + throw new Error("BACKEND_URL is not defined in the environment"); + } + setBackendUrl(backendUrl); - setBackendApi(backendApi); + // Base url is the mandatory field in environments except local + const baseUrl = process.env.BASE_URL; + setBaseUrl(baseUrl); return ( @@ -52,23 +48,19 @@ const RootLayout = async ({