first commit

main
Justin Xiao 2023-07-14 15:38:27 +08:00
commit 3adba5d69e
33 changed files with 12452 additions and 0 deletions

1
.gitignore vendored 100644
View File

@ -0,0 +1 @@
/**/node_modules

View File

@ -0,0 +1,2 @@
NEXT_SOCKET_PORT=3030
NEXT_PUBLIC_SOCKET_URL=http://localhost:3000

View File

@ -0,0 +1,2 @@
NEXT_SOCKET_PORT=3030
NEXT_PUBLIC_SOCKET_URL=ws://localhost:3001

View File

@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}

35
frontend/.gitignore vendored 100644
View File

@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env*.local
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts

34
frontend/README.md 100644
View File

@ -0,0 +1,34 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
## Getting Started
First, run the development server:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

View File

@ -0,0 +1,14 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config) => {
config.externals.push({
'utf-8-validate': 'commonjs utf-8-validate',
bufferutil: 'commonjs bufferutil',
})
return config
},
}
module.exports = nextConfig

6924
frontend/package-lock.json generated 100644

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
{
"name": "nextjs13-socketio-demo",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"prod": "next build && next start",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@emotion/react": "^11.11.1",
"@mantine/core": "^6.0.15",
"@mantine/form": "^6.0.15",
"@mantine/hooks": "^6.0.15",
"@mantine/modals": "^6.0.15",
"@mantine/nprogress": "^6.0.15",
"@tabler/icons-react": "^2.23.0",
"@types/node": "20.3.3",
"@types/react": "18.2.14",
"@types/react-dom": "18.2.6",
"autoprefixer": "10.4.14",
"eslint": "8.44.0",
"eslint-config-next": "13.4.7",
"next": "13.4.7",
"postcss": "8.4.24",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hot-toast": "^2.4.1",
"socket.io": "^4.7.1",
"socket.io-client": "^4.7.1",
"tailwindcss": "3.3.2",
"typescript": "5.1.6",
"zustand": "^4.3.8"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 283 64"><path fill="black" d="M141 16c-11 0-19 7-19 18s9 18 20 18c7 0 13-3 16-7l-7-5c-2 3-6 4-9 4-5 0-9-3-10-7h28v-3c0-11-8-18-19-18zm-9 15c1-4 4-7 9-7s8 3 9 7h-18zm117-15c-11 0-19 7-19 18s9 18 20 18c6 0 12-3 16-7l-8-5c-2 3-5 4-8 4-5 0-9-3-11-7h28l1-3c0-11-8-18-19-18zm-10 15c2-4 5-7 10-7s8 3 9 7h-19zm-39 3c0 6 4 10 10 10 4 0 7-2 9-5l8 5c-3 5-9 8-17 8-11 0-19-7-19-18s8-18 19-18c8 0 14 3 17 8l-8 5c-2-3-5-5-9-5-6 0-10 4-10 10zm83-29v46h-9V5h9zM37 0l37 64H0L37 0zm92 5-27 48L74 5h10l18 30 17-30h10zm59 12v10l-3-1c-6 0-10 4-10 10v15h-9V17h9v9c0-5 6-9 13-9z"/></svg>

After

Width:  |  Height:  |  Size: 629 B

View File

@ -0,0 +1,21 @@
"use client";
import { CacheProvider } from "@emotion/react";
import { useEmotionCache } from "@mantine/core";
import { useServerInsertedHTML } from "next/navigation";
export default function RootStyleRegistry({ children }: { children: React.ReactNode }) {
const cache = useEmotionCache();
cache.compat = true;
useServerInsertedHTML(() => (
<style
data-emotion={`${cache.key} ${Object.keys(cache.inserted).join(" ")}`}
dangerouslySetInnerHTML={{
__html: Object.values(cache.inserted).join(" "),
}}
/>
));
return <CacheProvider value={cache}>{children}</CacheProvider>;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -0,0 +1,3 @@
/* @tailwind base; */
@tailwind components;
@tailwind utilities;

View File

@ -0,0 +1,104 @@
"use client";
import {
Button,
Card,
Container,
Group,
Text,
Divider,
Input,
ScrollArea,
TextInput,
ActionIcon,
} from "@mantine/core";
import { IconArrowRight } from "@tabler/icons-react";
import NameModal from "@/components/NameModal";
import { useDisclosure } from "@mantine/hooks";
import useSocketStore from "@/store/socket";
import { useEffect, useRef, useState } from "react";
import useBasicStore from "@/store/basic";
export default function Home() {
const storeName = useBasicStore((state) => state.name);
const [socket, emit] = useSocketStore((state) => [state.socket, state.emit]);
const inputRef = useRef<HTMLInputElement>(null);
const [name, setName] = useState<string | null>(null); // avoiding Next.js hydration error
const [message, setMessage] = useState("");
const [messages, setMessages] = useState<string[]>([]);
const [opened, { open, close }] = useDisclosure(false);
const sendMessage = () => {
emit("message", message);
setMessages([...messages, message]);
setMessage("");
inputRef.current?.focus();
};
useEffect(() => {
setName(storeName);
if (!storeName) open();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [storeName]);
useEffect(() => {
socket?.on("message", (data) => {
console.log("message", data);
});
return () => {
socket?.off("message");
};
}, [socket]);
return (
<>
<Container pt="sm" size="md">
<Card shadow="sm" padding="sm" radius="md" withBorder>
<Group position="apart" mt="xs" mb="xs">
<Group>
<Text size="xl" weight={500} suppressHydrationWarning={true}>
{name}
</Text>
<Button size="xs" radius="md" onClick={open} variant="light">
Change name
</Button>
</Group>
<Input placeholder="Your target Socket ID" />
</Group>
<Divider />
<ScrollArea h={"80vh"} offsetScrollbars>
{messages.map((message, index) => (
<Text key={index}>{message}</Text>
))}
</ScrollArea>
<Divider />
<TextInput
ref={inputRef}
value={message}
onChange={(e) => setMessage(e.target.value)}
mt={10}
radius="xl"
size="md"
rightSection={
<ActionIcon size={32} radius="xl" variant="filled">
<IconArrowRight size="1.1rem" stroke={1.5} onClick={sendMessage} />
</ActionIcon>
}
placeholder="Type something..."
rightSectionWidth={42}
onKeyDown={(e) => {
if (e.key === "Enter") {
sendMessage();
}
}}
/>
</Card>
</Container>
<NameModal opened={opened} onClose={close} />
</>
);
}

View File

@ -0,0 +1,26 @@
import "./globals.css";
import { Inter } from "next/font/google";
import { AppProvider } from "./provide";
import { Toaster } from "react-hot-toast";
const inter = Inter({ subsets: ["latin"] });
type Prop = {
children: React.ReactNode;
};
export const metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
export default function RootLayout({ children }: Prop) {
return (
<html lang="en">
<body className={inter.className}>
<AppProvider>{children}</AppProvider>
<Toaster position="bottom-right" reverseOrder={false} />
</body>
</html>
);
}

View File

@ -0,0 +1,79 @@
"use client";
import { Container, Title, createStyles, rem } from "@mantine/core";
import { Button } from "@mantine/core";
import { useRouter } from "next/navigation";
const useStyles = createStyles((theme) => ({
inner: {
paddingTop: `calc(${theme.spacing.xl} * 4)`,
paddingBottom: `calc(${theme.spacing.xl} * 4)`,
display: "flex",
justifyContent: "space-between",
flexDirection: "column",
alignItems: "center",
textAlign: "center",
[theme.fn.smallerThan("md")]: {
marginRight: 0,
},
},
title: {
fontFamily: `Greycliff CF, ${theme.fontFamily}`,
fontWeight: 900,
fontSize: rem(64),
[theme.fn.smallerThan("md")]: {
maxWidth: "100%",
fontSize: rem(34),
lineHeight: 1.15,
},
},
subtitle: {
paddingTop: theme.spacing.xl,
fontFamily: `Greycliff CF, ${theme.fontFamily}`,
fontWeight: 800,
lineHeight: 1.05,
fontSize: rem(40),
[theme.fn.smallerThan("md")]: {
maxWidth: "100%",
fontSize: rem(26),
lineHeight: 1.15,
},
},
}));
export default function Home() {
const { classes } = useStyles();
const router = useRouter();
return (
<>
<Container pt="sm" size="lg">
<div className={classes.inner}>
<Title
variant="gradient"
gradient={{ from: "indigo", to: "cyan" }}
className={classes.title}
>
Tiny Socket.io demo
</Title>
<Title className={classes.subtitle}>Based on Next.js 13, Socket.io.</Title>
<Button
mt={30}
size="lg"
variant="gradient"
gradient={{ from: "teal", to: "lime", deg: 105 }}
onClick={() => {
router.push("/home");
}}
>
Get Started
</Button>
</div>
</Container>
</>
);
}

View File

@ -0,0 +1,27 @@
"use client";
import { MantineProvider } from "@mantine/core";
import RootStyleRegistry from "./emotion";
import { useEffect } from "react";
import useSocketStore from "@/store/socket";
type Prop = {
children: React.ReactNode;
};
export function AppProvider({ children }: Prop) {
const [disconnect] = useSocketStore(({ disconnect }) => [disconnect]);
useEffect(() => {
return () => {
console.log("disconnect");
disconnect();
};
}, []);
return (
<RootStyleRegistry>
<MantineProvider withGlobalStyles withNormalizeCSS>
{children}
</MantineProvider>
</RootStyleRegistry>
);
}

View File

@ -0,0 +1,116 @@
"use client";
import {
createStyles,
Badge,
Group,
Title,
Text,
Card,
SimpleGrid,
Container,
rem,
} from "@mantine/core";
import { IconGauge, IconUser, IconCookie } from "@tabler/icons-react";
const mockdata = [
{
title: "Extreme performance",
description:
"This dust is actually a powerful poison that will even make a pro wrestler sick, Regice cloaks itself with frigid air of -328 degrees Fahrenheit",
icon: IconGauge,
},
{
title: "Privacy focused",
description:
"People say it can run at the same speed as lightning striking, Its icy body is so cold, it will not melt even if it is immersed in magma",
icon: IconUser,
},
{
title: "No third parties",
description:
"Theyre popular, but theyre rare. Trainers who show them off recklessly may be targeted by thieves",
icon: IconCookie,
},
];
const useStyles = createStyles((theme) => ({
title: {
fontSize: rem(34),
fontWeight: 900,
[theme.fn.smallerThan("sm")]: {
fontSize: rem(24),
},
},
description: {
maxWidth: 600,
margin: "auto",
"&::after": {
content: '""',
display: "block",
backgroundColor: theme.fn.primaryColor(),
width: rem(45),
height: rem(2),
marginTop: theme.spacing.sm,
marginLeft: "auto",
marginRight: "auto",
},
},
card: {
border: `${rem(1)} solid ${
theme.colorScheme === "dark" ? theme.colors.dark[5] : theme.colors.gray[1]
}`,
},
cardTitle: {
"&::after": {
content: '""',
display: "block",
backgroundColor: theme.fn.primaryColor(),
width: rem(45),
height: rem(2),
marginTop: theme.spacing.sm,
},
},
}));
export default function FeaturesCards() {
const { classes, theme } = useStyles();
const features = mockdata.map((feature) => (
<Card key={feature.title} shadow="md" radius="md" className={classes.card} padding="xl">
<feature.icon size={rem(50)} stroke={2} color={theme.fn.primaryColor()} />
<Text fz="lg" fw={500} className={classes.cardTitle} mt="md">
{feature.title}
</Text>
<Text fz="sm" c="dimmed" mt="sm">
{feature.description}
</Text>
</Card>
));
return (
<Container size="lg" py="xl">
<Group position="center">
<Badge variant="filled" size="lg">
Best company ever
</Badge>
</Group>
<Title order={2} className={classes.title} ta="center" mt="sm">
Integrate effortlessly with any technology stack
</Title>
<Text c="dimmed" className={classes.description} ta="center" mt="md">
Every once in a while, youll see a Golbat thats missing some fangs. This happens
when hunger drives it to try biting a Steel-type Pokémon.
</Text>
<SimpleGrid cols={3} spacing="xl" mt={50} breakpoints={[{ maxWidth: "md", cols: 1 }]}>
{features}
</SimpleGrid>
</Container>
);
}

View File

@ -0,0 +1,47 @@
import { TextInput, Button, Modal, Text } from "@mantine/core";
import { FC } from "react";
import { useForm } from "@mantine/form";
import useBasicStore from "@/store/basic";
type Props = {
opened: boolean;
onClose: () => void;
};
const NameModal: FC<Props> = ({ opened, onClose }) => {
const [name, setName] = useBasicStore((state) => [state.name, state.setName]);
const form = useForm({
initialValues: {
name: "",
},
validate: {
name: (value) => (value.trim().length < 1 ? "Name is required" : null),
},
});
const handleSubmit = ({ name }: { name: string }) => {
console.log(name);
setName(name);
onClose();
};
return (
<Modal opened={opened} onClose={onClose} title="New Name">
<form onSubmit={form.onSubmit(handleSubmit)}>
<TextInput
label="Your name"
placeholder="Your name"
data-autofocus
{...form.getInputProps("name")}
/>
<Button type="submit" fullWidth mt="md">
Submit
</Button>
<Text size="xs" mt={5}>
Your current name is{" "}
<span style={{ fontWeight: "bold", backgroundColor: "#fcc419" }}>{name}</span>
</Text>
</form>
</Modal>
);
};
export default NameModal;

View File

@ -0,0 +1 @@
export const SOCKET_URL = process.env.NEXT_PUBLIC_SOCKET_URL || "";

View File

@ -0,0 +1,17 @@
import { NextApiResponseServerIO } from "@/types/next";
import { NextApiRequest } from "next";
const message = (req: NextApiRequest, res: NextApiResponseServerIO) => {
if (req.method === "POST") {
// get message
const message = req.body;
// dispatch to channel "message"
res?.socket?.server?.io?.emit("message", message);
// return message
res.status(201).json(message);
}
};
export default message;

View File

@ -0,0 +1,32 @@
import { NextApiRequest } from "next";
import { Server as ServerIO } from "socket.io";
import { Server as NetServer } from "http";
import { NextApiResponseServerIO } from "@/types/next";
export const config = {
api: {
bodyParser: false,
},
};
const socketio = async (req: NextApiRequest, res: NextApiResponseServerIO) => {
if (!res.socket.server.io) {
console.log("First connect on socket.io");
// adapt Next's net Server to http Server
const httpServer: NetServer = res.socket.server as any;
const io = new ServerIO(httpServer, {
path: "/api/socket/socketio",
addTrailingSlash: false,
});
io.on("connect", () => {
console.log("SOCKET CONNECTED!");
})
// append SocketIO server to Next.js socket server response
res.socket.server.io = io;
} else {
console.log("Socket.io already running");
}
res.end();
};
export default socketio;

View File

@ -0,0 +1,24 @@
import { create } from "zustand";
import { persist, createJSONStorage } from "zustand/middleware";
type Store = {
name: null | string;
setName: (name: string) => void;
};
const useBasicStore = create<Store>()(
persist(
(set) => ({
name: null,
setName: (name) => {
set({ name });
},
}),
{
name: "basic", // name of the item in the storage (must be unique)
storage: createJSONStorage(() => sessionStorage), // (optional) by default, 'localStorage' is used
}
)
);
export default useBasicStore;

View File

@ -0,0 +1,66 @@
import { SOCKET_URL } from "@/config";
import { toast } from "react-hot-toast";
import { io, Socket } from "socket.io-client";
import { create } from "zustand";
type Store = {
socketReady: boolean;
socket: null | Socket;
emit: (event: string, data: any) => void;
disconnect: () => void;
};
const useSocketStore = create<Store>((set, get) => {
const socket = io(
SOCKET_URL,
process.env.NODE_ENV === "development"
? {
path: "/api/socket/socketio",
addTrailingSlash: false,
}
: {}
);
socket
.on("connect", () => {
console.log("SOCKET CONNECTED!", socket.id);
set({ socketReady: true });
})
.on("disconnect", () => {
set({ socketReady: false });
});
return {
socketReady: false,
socket: socket,
emit: async (event: string, data: any) => {
if (process.env.NODE_ENV === "development") {
try {
const response = await fetch("/api/socket/message", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
console.log("response", response);
} catch (error) {
if (error instanceof Error) toast.error(error?.message);
}
} else {
// This response needs to define on server at first.
socket.emit(event, data, (response: any) => {
console.log(response.status); // ok
});
}
},
disconnect: () => {
const { socket } = get();
if (socket) {
socket.disconnect();
set({ socket: null });
}
},
};
});
export default useSocketStore;

View File

@ -0,0 +1,11 @@
import { Server as NetServer, Socket } from "net";
import { NextApiResponse } from "next";
import { Server as SocketIOServer } from "socket.io";
export type NextApiResponseServerIO = NextApiResponse & {
socket: Socket & {
server: NetServer & {
io: SocketIOServer;
};
};
};

View File

@ -0,0 +1,18 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}',
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
],
theme: {
extend: {
backgroundImage: {
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
'gradient-conic':
'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
},
},
},
plugins: [],
}

View File

@ -0,0 +1,28 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}

40
server/index.js 100644
View File

@ -0,0 +1,40 @@
import express from "express";
import http from "http";
const app = express();
const server = http.createServer(app);
import { Server } from "socket.io";
const io = new Server(server, {
cors: {
origin: "*",
},
});
const userSockets = new Map();
io.on("connection", (socket) => {
console.log(socket.id);
socket.on("message", (message, callback) => {
console.log(message);
io.emit("message", message);
callback({
status: "ok",
});
});
socket.on("disconnect", () => {
// Remove the user ID mapping when the socket disconnects
userSockets.forEach((socketId, userId) => {
if (socketId === socket.id) {
userSockets.delete(userId);
}
});
});
socket.on("clear", () => io.emit("clear"));
});
server.listen(3001, () => {
console.log("Server listening on port 3001");
});

1154
server/package-lock.json generated 100644

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
{
"name": "server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.18.2",
"nodemon": "^2.0.22",
"socket.io": "^4.7.1",
"uuid": "^9.0.0"
}
}