Skip to content

Commit 745c18d

Browse files
authored
Merge pull request #54 from Ali1raz/rename
rename channel to team to channel, workpsace to organization
2 parents 005557a + 734d702 commit 745c18d

78 files changed

Lines changed: 948 additions & 921 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# TeamFlow
1+
# TeamComms
22

33
> An open-source, AI-powered real-time team messaging platform.
44
55
## Features
66

7-
- **Workspaces (Orgs)** — Create worspaces.
8-
- **Channels** — Organize conversations into topic-based channels within each workspace.
7+
- **Organizations (Orgs)** — Create organization.
8+
- **Teams** — Organize conversations into topic-based teams within each organization.
99
- **Threaded Messages** — Reply to any message in a thread to keep conversations focused
10-
- **Image Uploads** — Share images directly in channels via UploadThing
10+
- **Image Uploads** — Share images directly in teams via UploadThing
1111
- **AI Message Rewrite** — Let AI rewrite your message: adjust tone, fix grammar, or improve clarity
1212
- **AI Thread Summarization** — Summarize long threads to catch up instantly without reading every reply
1313
- **Email + OAuth Auth** — Sign in with GitHub
@@ -42,8 +42,8 @@
4242
### 1. Clone the repository
4343

4444
```bash
45-
git clone https://github.com/Ali1raz/team-flow.git
46-
cd team-flow
45+
git clone https://github.com/Ali1raz/team-comms.git
46+
cd team-comms
4747
```
4848

4949
### 2. Install dependencies
@@ -62,7 +62,7 @@ Fill in your `.env`:
6262

6363
```env
6464
# Database
65-
DATABASE_URL="postgresql://user:password@localhost:5432/team-flow?schema=public"
65+
DATABASE_URL="postgresql://user:password@localhost:5432/team-comms?schema=public"
6666
6767
# Auth
6868
BETTER_AUTH_SECRET=your_secret_here
@@ -145,7 +145,7 @@ Open [http://localhost:8787](http://localhost:8787) for wrangler dev server
145145

146146
## AI Features
147147

148-
TeamFlow integrates OpenAI-compatible models via OpenRouter and the Vercel AI SDK:
148+
TeamComms integrates OpenAI-compatible models via OpenRouter and the Vercel AI SDK:
149149

150150
- **Message Rewrite** — Rewrite message → click AI rewrite → Each rewrite is a streaming API call.
151151
- **Thread Summarization** — Click "Summarize thread" on any message thread → receive a streamed summary of the conversation.

app/(auth)/login/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { LoginForm } from "../_components/login-form";
2-
import Logo from "@/public/team-flow.png";
2+
import Logo from "@/public/team-comms.png";
33
import Image from "next/image";
44
import Link from "next/link";
55
import { auth } from "@/lib/auth";
@@ -9,7 +9,7 @@ import { Metadata } from "next";
99

1010
export const metadata: Metadata = {
1111
title: "Login",
12-
description: "Login to your TeamFlow account",
12+
description: "Login to your TeamComms account",
1313
robots: { index: false, follow: false },
1414
};
1515

@@ -30,12 +30,12 @@ export default async function LoginPage() {
3030
>
3131
<Image
3232
src={Logo}
33-
alt="TeamFlow Logo"
33+
alt="TeamComms Logo"
3434
width={40}
3535
height={40}
3636
className="object-cover"
3737
/>
38-
<p className="text-primary">TeamFlow</p>
38+
<p className="text-primary">TeamComms</p>
3939
</Link>
4040
<LoginForm />
4141
</div>

app/(workspace)/workspaces/[workspaceId]/_components/MessageList.tsx renamed to app/(organization)/organizations/[organizationId]/_components/MessageList.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { RealtimeUserSchemaType } from "@/realtime/schema";
1919
import { usePresence } from "@/hooks/use-presence";
2020

2121
export function MessageList() {
22-
const { channelId } = useParams<{ channelId: string }>();
22+
const { teamId } = useParams<{ teamId: string }>();
2323
const [hasInitialScrolled, setHasInitialScrolled] = useState(false);
2424
const ref = useRef<HTMLDivElement | null>(null);
2525
const bottomRef = useRef<HTMLDivElement | null>(null);
@@ -29,11 +29,11 @@ export function MessageList() {
2929

3030
const infiniteOptions = orpc.message.list.infiniteOptions({
3131
input: (pageParams: string | undefined) => ({
32-
channelId,
32+
teamId,
3333
cursor: pageParams,
3434
limit: 30,
3535
}),
36-
queryKey: ["message.list", channelId],
36+
queryKey: ["message.list", teamId],
3737
initialPageParam: undefined,
3838
getNextPageParam: (lastPage) => lastPage.nextCursor,
3939
select: (data) => ({
@@ -62,7 +62,7 @@ export function MessageList() {
6262

6363
const {
6464
data: { user },
65-
} = useSuspenseQuery(orpc.workspace.list.queryOptions());
65+
} = useSuspenseQuery(orpc.organization.list.queryOptions());
6666

6767
const isNearBottom = (el: HTMLDivElement) =>
6868
el.scrollHeight - el.scrollTop - el.clientHeight <= 80;
@@ -180,12 +180,15 @@ export function MessageList() {
180180
}
181181
};
182182

183-
const { workspaceId } = useParams<{ workspaceId: string }>();
183+
const { organizationId } = useParams<{ organizationId: string }>();
184184
const currentUser = user
185185
? ({ id: user.id } satisfies RealtimeUserSchemaType)
186186
: null;
187187

188-
const { onlineusers } = usePresence({ room: workspaceId, user: currentUser });
188+
const { onlineusers } = usePresence({
189+
room: organizationId,
190+
user: currentUser,
191+
});
189192

190193
const onlineUserIds = useMemo(
191194
() => new Set(onlineusers.map((u) => u.id)),
@@ -207,8 +210,8 @@ export function MessageList() {
207210
No messages
208211
</EmptyTitle>
209212
<EmptyDescription className="sm:w-xl w-sm sm:text-lg text-xs">
210-
There are no messages in this channel yet. Start the conversation
211-
by sending a new message!
213+
There are no messages in this team yet. Start the conversation by
214+
sending a new message!
212215
</EmptyDescription>
213216
</EmptyHeader>
214217
</Empty>

app/(workspace)/workspaces/[workspaceId]/_components/attachment-chip.tsx renamed to app/(organization)/organizations/[organizationId]/_components/attachment-chip.tsx

File renamed without changes.

app/(workspace)/workspaces/[workspaceId]/_components/delete-message-dialog.tsx renamed to app/(organization)/organizations/[organizationId]/_components/delete-message-dialog.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from "@/components/ui/dialog";
1414
import { orpc } from "@/lib/orpc";
1515
import { useMutation, useQueryClient } from "@tanstack/react-query";
16-
import { useRealtimeChannel } from "@/components/channel-realtime-provider";
16+
import { useRealtimeTeam } from "@/components/team-realtime-provider";
1717
import { Loader2 } from "lucide-react";
1818
import { useParams } from "next/navigation";
1919
import { toast } from "sonner";
@@ -29,13 +29,13 @@ export function DeleteMessageDialog({
2929
messageId,
3030
children,
3131
}: DeleteMessageDialogProps) {
32-
const { channelId } = useParams<{ channelId: string }>();
32+
const { teamId } = useParams<{ teamId: string }>();
3333
const queryClient = useQueryClient();
34-
const { send } = useRealtimeChannel();
34+
const { send } = useRealtimeTeam();
3535
const [open, setOpen] = useState(false);
3636

3737
// Must stay in sync with the key used in MessageList and EditMessageForm.
38-
const messageListKey = ["message.list", channelId];
38+
const messageListKey = ["message.list", teamId];
3939

4040
const deleteMessageMutation = useMutation(
4141
orpc.message.delete.mutationOptions({

app/(workspace)/workspaces/[workspaceId]/_components/edit-message-form.tsx renamed to app/(organization)/organizations/[organizationId]/_components/edit-message-form.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
} from "@tanstack/react-query";
1818
import { toast } from "sonner";
1919
import { useParams } from "next/navigation";
20-
import { useRealtimeChannel } from "@/components/channel-realtime-provider";
20+
import { useRealtimeTeam } from "@/components/team-realtime-provider";
2121

2222
interface EditMessageFormProps {
2323
message: messageType;
@@ -37,8 +37,8 @@ export function EditMessageForm({
3737
onCancel,
3838
onSave,
3939
}: EditMessageFormProps) {
40-
const { channelId } = useParams<{ channelId: string }>();
41-
const { send } = useRealtimeChannel();
40+
const { teamId } = useParams<{ teamId: string }>();
41+
const { send } = useRealtimeTeam();
4242

4343
const form = useForm<UpdateMessageSchemaType>({
4444
resolver: zodResolver(updateMessageSchema),
@@ -55,7 +55,7 @@ export function EditMessageForm({
5555

5656
// The raw key that MessageList.tsx registers its infinite query under.
5757
// Must stay in sync with the `queryKey` option passed to infiniteOptions there.
58-
const messageListKey = ["message.list", channelId];
58+
const messageListKey = ["message.list", teamId];
5959

6060
const updateMessageMutation = useMutation(
6161
orpc.message.update.mutationOptions({

app/(workspace)/workspaces/[workspaceId]/_components/image-dialog.tsx renamed to app/(organization)/organizations/[organizationId]/_components/image-dialog.tsx

File renamed without changes.

app/(workspace)/workspaces/[workspaceId]/_components/leave-workspace-dialog.tsx renamed to app/(organization)/organizations/[organizationId]/_components/leave-organization-dialog.tsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,67 +18,67 @@ import { useRouter } from "next/navigation";
1818
import { ReactNode, useState } from "react";
1919
import { toast } from "sonner";
2020

21-
export function LeaveWorkspaceDialog({
21+
export function LeaveOrganizationDialog({
2222
children,
23-
workspaceId,
23+
organizationId,
2424
}: {
2525
children?: ReactNode;
26-
workspaceId: string;
26+
organizationId: string;
2727
}) {
2828
const [open, setOpen] = useState(false);
2929
const router = useRouter();
3030

3131
const queryClient = useQueryClient();
3232

33-
const leaveWorkspaceMutation = useMutation(
34-
orpc.workspace.leave.mutationOptions({
33+
const leaveOrganizationMutation = useMutation(
34+
orpc.organization.leave.mutationOptions({
3535
onSuccess: () => {
3636
queryClient.invalidateQueries({
37-
queryKey: orpc.workspace.list.queryKey(),
37+
queryKey: orpc.organization.list.queryKey(),
3838
});
3939
queryClient.invalidateQueries({
40-
queryKey: orpc.workspace.members.list.queryKey(),
40+
queryKey: orpc.organization.members.list.queryKey(),
4141
});
4242

43-
router.push("/workspaces");
44-
toast.success("Workspace left successfully!");
43+
router.push("/organizations");
44+
toast.success("Organization left successfully!");
4545
setOpen(false);
4646
},
4747
onError: (error) => {
48-
toast.error("Failed to leave workspace", {
48+
toast.error("Failed to leave organization", {
4949
description: error.message,
5050
});
5151
},
5252
})
5353
);
5454

5555
function handleConfirm() {
56-
leaveWorkspaceMutation.mutate({ organizationId: workspaceId });
56+
leaveOrganizationMutation.mutate({ organizationId: organizationId });
5757
}
5858

5959
return (
6060
<Dialog open={open} onOpenChange={setOpen}>
6161
<DialogTrigger asChild>
6262
{children ?? (
6363
<Button variant="destructive" size="sm">
64-
Leave Workspace
64+
Leave Organization
6565
</Button>
6666
)}
6767
</DialogTrigger>
6868
<DialogContent className="sm:max-w-sm">
6969
<DialogHeader>
7070
<DialogTitle>Delete Message</DialogTitle>
7171
<DialogDescription>
72-
Are you sure you want to leave this workspace? This action cannot be
73-
undone.
72+
Are you sure you want to leave this organization? This action cannot
73+
be undone.
7474
</DialogDescription>
7575
</DialogHeader>
7676

7777
<DialogFooter className="gap-2">
7878
<DialogClose asChild>
7979
<Button
8080
variant="outline"
81-
disabled={leaveWorkspaceMutation.isPending}
81+
disabled={leaveOrganizationMutation.isPending}
8282
>
8383
Cancel
8484
</Button>
@@ -88,15 +88,15 @@ export function LeaveWorkspaceDialog({
8888
<Button
8989
variant="destructive"
9090
onClick={handleConfirm}
91-
disabled={leaveWorkspaceMutation.isPending}
91+
disabled={leaveOrganizationMutation.isPending}
9292
>
93-
{leaveWorkspaceMutation.isPending ? (
93+
{leaveOrganizationMutation.isPending ? (
9494
<>
9595
<Loader2 className="size-4 animate-spin" />
9696
Please wait...
9797
</>
9898
) : (
99-
"Leave Workspace"
99+
"Leave Organization"
100100
)}
101101
</Button>
102102
</DialogFooter>

0 commit comments

Comments
 (0)