Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ WORKDIR /app
RUN apk add --no-cache openssl

# Copy built output and minimal files
COPY --from=base /app/apps /app/apps
COPY --from=base /app/dist /app/dist
COPY --from=base /app/node_modules /app/node_modules
COPY --from=base /app/prisma /app/prisma
COPY --from=base /app/.env* ./
Expand Down
46 changes: 41 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#
#

<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>

✨ Your new, shiny [Nx workspace](https://nx.dev) is almost ready ✨.

[Learn more about this workspace setup and its capabilities](https://nx.dev/nx-api/node?utm_source=nx_project&amp;utm_medium=readme&amp;utm_campaign=nx_projects) or run `npx nx graph` to visually explore what was created. Now, let's get you up to speed!
[Learn more about this workspace setup and its capabilities](https://nx.dev/nx-api/node?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) or run `npx nx graph` to visually explore what was created. Now, let's get you up to speed!

## Finish your CI setup

[Click here to finish setting up your workspace!](https://cloud.nx.app/connect/rtuLBlFOCR)


## Run tasks

To run the dev server for your app, use:
Expand Down Expand Up @@ -57,7 +56,6 @@ You can use `npx nx list` to get a list of installed plugins. Then, run `npx nx

[Learn more about Nx plugins &raquo;](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) | [Browse the plugin registry &raquo;](https://nx.dev/plugin-registry?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)


[Learn more about Nx on CI](https://nx.dev/ci/intro/ci-with-nx#ready-get-started-with-your-provider?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)

## Install Nx Console
Expand All @@ -70,13 +68,51 @@ Nx Console is an editor extension that enriches your developer experience. It le

Learn more:

- [Learn more about this workspace setup](https://nx.dev/nx-api/node?utm_source=nx_project&amp;utm_medium=readme&amp;utm_campaign=nx_projects)
- [Learn more about this workspace setup](https://nx.dev/nx-api/node?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
- [Learn about Nx on CI](https://nx.dev/ci/intro/ci-with-nx?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
- [Releasing Packages with Nx release](https://nx.dev/features/manage-releases?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
- [What are Nx plugins?](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)

And join the Nx community:

- [Discord](https://go.nx.dev/community)
- [Follow us on X](https://twitter.com/nxdevtools) or [LinkedIn](https://www.linkedin.com/company/nrwl)
- [Our Youtube channel](https://www.youtube.com/@nxdevtools)
- [Our blog](https://nx.dev/blog?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)

## Deploying seller-ui and user-ui to Vercel

Create two Vercel projects, one for each Next.js app. Use these settings:

1. Project → Settings → General

- Root Directory: `apps/seller-ui` (Project 1) and `apps/user-ui` (Project 2)
- Framework Preset: Next.js
- Node Version: 20 (we set `"engines": { "node": "20.x" }` in each app)
- Install Command: leave default (`npm install`)
- Build Command: leave default (`next build`)
- Output Directory: leave default (managed by Next on Vercel)

2. Project → Settings → Environment Variables

- seller-ui
- `NEXT_PUBLIC_SERVER_URI` → Your API base URL (e.g. `https://api.example.com`)
- `NEXT_PUBLIC_CHAT_WEBSOCKET_URI` → WebSocket URL (use `wss://.../chat` in prod)
- `NEXT_PUBLIC_USER_UI_LINK` → Public URL of user-ui (e.g. `https://user.example.com`)
- user-ui
- `NEXT_PUBLIC_SERVER_URI` → Your API base URL (e.g. `https://api.example.com`)
- `NEXT_PUBLIC_CHAT_WEBSOCKET_URI` → WebSocket URL (use `wss://.../chat` in prod)
- `NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY` → Your Stripe publishable key

3. (Optional) Ignore builds when a project has no changes
- Project → Settings → Git → Ignored Build Step
- Command:
```bash
git diff --quiet ${VERCEL_GIT_PREVIOUS_SHA:-HEAD^} ${VERCEL_GIT_COMMIT_SHA:-HEAD} -- . || exit 1
```
- This runs builds only when files in the project’s root directory changed.

Notes

- Each app has `build`/`dev` scripts and Node 20 engines in its `package.json`.
- Next Image remote host `ik.imagekit.io` is already allowed in both apps.
9 changes: 8 additions & 1 deletion apps/seller-ui/next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ts-check

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { composePlugins, withNx } = require('@nx/next');

/**
Expand All @@ -20,6 +19,14 @@ const nextConfig = {
},
],
},

// Disable type-checking and ESLint during build on Vercel
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},
};

const plugins = [
Expand Down
31 changes: 30 additions & 1 deletion apps/seller-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,38 @@
"name": "@./seller-ui",
"version": "0.0.1",
"private": true,
"scripts": {
"build": "next build",
"start": "next start -p $PORT",
"dev": "next dev -p 3000"
},
"engines": {
"node": "20.x"
},
"dependencies": {
"@nx/next": "^20.6.1",
"@tanstack/react-query": "^5.83.0",
"@tanstack/react-table": "^8.21.3",
"axios": "^1.10.0",
"jotai": "^2.12.5",
"lucide-react": "^0.525.0",
"next": "~15.1.4",
"react": "19.0.0",
"react-dom": "19.0.0"
"react-dom": "19.0.0",
"react-hook-form": "^7.60.0",
"react-hot-toast": "^2.5.2",
"react-quill-new": "^3.6.0",
"styled-components": "^6.1.19",
"tailwind-merge": "^3.3.1",
"canvas-confetti": "^1.9.3"
},
"devDependencies": {
"autoprefixer": "10.4.13",
"postcss": "8.4.38",
"tailwindcss": "3.4.3",
"typescript": "~5.7.2",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@types/node": "~18.16.9"
}
}
12 changes: 10 additions & 2 deletions apps/seller-ui/src/app/(routes)/dashboard/inbox/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use client';

import React, { useState, useEffect } from 'react';
import React, { Suspense, useState, useEffect } from 'react';
import { useSearchParams, useRouter } from 'next/navigation';
import { useWebSocket } from 'apps/seller-ui/src/context/websocket-context';
import { useConversations } from 'apps/seller-ui/src/hooks/chat';
import { ChatHeader, ChatWindow, ConversationList, EmptyChatState } from 'apps/seller-ui/src/shared/organisms';

const InboxPage: React.FC = () => {
const InboxPageInner: React.FC = () => {
const [selectedConversationId, setSelectedConversationId] = useState<string | null>(null);
const [selectedUser, setSelectedUser] = useState<any>(null);

Expand Down Expand Up @@ -107,4 +107,12 @@ const InboxPage: React.FC = () => {
);
};

const InboxPage: React.FC = () => {
return (
<Suspense fallback={<div />}>
<InboxPageInner />
</Suspense>
);
};

export default InboxPage;
8 changes: 7 additions & 1 deletion apps/user-ui/next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ts-check

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { composePlugins, withNx } = require('@nx/next');

/**
Expand All @@ -19,6 +18,13 @@ const nextConfig = {
},
],
},
// Disable type-checking and ESLint during build on Vercel
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},
};

const plugins = [
Expand Down
34 changes: 33 additions & 1 deletion apps/user-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,41 @@
"name": "@./user-ui",
"version": "0.0.1",
"private": true,
"scripts": {
"build": "next build",
"start": "next start -p $PORT",
"dev": "next dev -p 3001"
},
"engines": {
"node": "20.x"
},
"dependencies": {
"@nx/next": "^20.6.1",
"@stripe/react-stripe-js": "^3.9.1",
"@stripe/stripe-js": "^7.8.0",
"@tanstack/react-query": "^5.83.0",
"@tanstack/react-table": "^8.21.3",
"canvas-confetti": "^1.9.3",
"axios": "^1.10.0",
"lucide-react": "^0.525.0",
"next": "~15.1.4",
"react": "19.0.0",
"react-dom": "19.0.0"
"react-dom": "19.0.0",
"react-hook-form": "^7.60.0",
"react-hot-toast": "^2.5.2",
"react-image-magnify": "^2.7.4",
"tailwind-merge": "^3.3.1",
"ua-parser-js": "^2.0.4",
"zustand": "^5.0.7",
"react-quill-new": "^3.6.0"
},
"devDependencies": {
"autoprefixer": "10.4.13",
"postcss": "8.4.38",
"tailwindcss": "3.4.3",
"typescript": "~5.7.2",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@types/node": "~18.16.9"
}
}
10 changes: 5 additions & 5 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ module.exports = {
apps: [
{
name: 'auth-service',
script: 'apps/auth-service/dist/main.js',
script: 'dist/apps/auth-service/main.js',
env: { PORT: 6001 },
},
{
name: 'product-service',
script: 'apps/product-service/dist/main.js',
script: 'dist/apps/product-service/main.js',
env: { PORT: 6002 },
},
{
name: 'order-service',
script: 'apps/order-service/dist/main.js',
script: 'dist/apps/order-service/main.js',
env: { PORT: 6004 },
},
{
name: 'chat-service',
script: 'apps/chat-service/dist/main.js',
script: 'dist/apps/chat-service/main.js',
env: { PORT: 6005 },
},
{
name: 'api-gateway',
script: 'apps/api-gateway/dist/main.js',
script: 'dist/apps/api-gateway/main.js',
env: { PORT: 8080 },
},
],
Expand Down
15 changes: 14 additions & 1 deletion packages/components/rich-text-editor/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
'use client';

import React, { useEffect, useState } from 'react';
import ReactQuill from 'react-quill-new';
import dynamic from 'next/dynamic';
import 'react-quill-new/dist/quill.snow.css';

const ReactQuill = dynamic(() => import('react-quill-new'), {
ssr: false,
loading: () => (
<div className="rich-text-editor-wrapper">
<div className="quill-editor">
<div style={{ minHeight: 150 }} />
</div>
</div>
),
});

interface RichTextEditorProps {
value: string;
onChange: (content: string) => void;
Expand Down
Loading