Skip to content

Commit 78e6576

Browse files
committed
feat: add hooks for API health, update checking, viewer caching, and viewer count management
- Implemented `useApiHealth` hook to check the health of the remote API (CORS disabled temporarily). - Created `useUpdateChecker` hook to check for updates from GitHub releases. - Developed `useViewerCache` hook to manage and cache viewer count values. - Added `useViewerCount` hook to fetch and manage viewer count for a given username. - Introduced `useWebSocketBot` hook for managing WebSocket connections and bot interactions. chore: configure Next.js and Tailwind CSS - Updated `next.config.js` for standalone output and build error handling. - Added `postcss.config.js` for Tailwind CSS integration. - Configured `tailwind.config.js` with custom content paths and theme extensions. feat: implement local service connector and WebSocket service - Created `LocalServiceConnector` for connecting to a local Python backend service. - Developed `WebSocketService` for handling WebSocket communication with the bot. feat: add Zustand store for bot management - Implemented Zustand store to manage bot status and actions (start, stop, check status). style: add global styles and utility functions - Added global CSS styles and utility functions for animations and class name management.
1 parent 0aefe5a commit 78e6576

Some content is hidden

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

63 files changed

+4444
-4719
lines changed

frontend/.gitignore

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@
33
# dependencies
44
/node_modules
55
/.pnp
6-
.pnp.*
7-
.yarn/*
8-
!.yarn/patches
9-
!.yarn/plugins
10-
!.yarn/releases
11-
!.yarn/versions
6+
.pnp.js
127

138
# testing
149
/coverage
@@ -28,14 +23,18 @@
2823
npm-debug.log*
2924
yarn-debug.log*
3025
yarn-error.log*
31-
.pnpm-debug.log*
3226

33-
# env files (can opt-in for committing if needed)
34-
.env
27+
# local env files
28+
.env*.local
3529

3630
# vercel
3731
.vercel
3832

3933
# typescript
4034
*.tsbuildinfo
4135
next-env.d.ts
36+
37+
pnpm-lock.yaml
38+
yarn.lock
39+
package-lock.json
40+
bun.lockb

frontend/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=true

frontend/.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

frontend/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Next UI
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

frontend/README.md

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,53 @@
1-
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
1+
# Next.js & HeroUI Template
22

3-
## Getting Started
3+
This is a template for creating applications using Next.js 14 (app directory) and HeroUI (v2).
44

5-
First, run the development server:
5+
[Try it on CodeSandbox](https://githubbox.com/heroui-inc/heroui/next-app-template)
6+
7+
## Technologies Used
8+
9+
- [Next.js 14](https://nextjs.org/docs/getting-started)
10+
- [HeroUI v2](https://heroui.com/)
11+
- [Tailwind CSS](https://tailwindcss.com/)
12+
- [Tailwind Variants](https://tailwind-variants.org)
13+
- [TypeScript](https://www.typescriptlang.org/)
14+
- [Framer Motion](https://www.framer.com/motion/)
15+
- [next-themes](https://github.com/pacocoursey/next-themes)
16+
17+
## How to Use
18+
19+
### Use the template with create-next-app
20+
21+
To create a new project based on this template using `create-next-app`, run the following command:
622

723
```bash
8-
npm run dev
9-
# or
10-
yarn dev
11-
# or
12-
pnpm dev
13-
# or
14-
bun dev
24+
npx create-next-app -e https://github.com/heroui-inc/next-app-template
1525
```
1626

17-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
27+
### Install dependencies
28+
29+
You can use one of them `npm`, `yarn`, `pnpm`, `bun`, Example using `npm`:
1830

19-
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
31+
```bash
32+
npm install
33+
```
2034

21-
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
35+
### Run the development server
2236

23-
## Learn More
37+
```bash
38+
npm run dev
39+
```
2440

25-
To learn more about Next.js, take a look at the following resources:
41+
### Setup pnpm (optional)
2642

27-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
43+
If you are using `pnpm`, you need to add the following code to your `.npmrc` file:
2944

30-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
45+
```bash
46+
public-hoist-pattern[]=*@heroui/*
47+
```
3148

32-
## Deploy on Vercel
49+
After modifying the `.npmrc` file, you need to run `pnpm install` again to ensure that the dependencies are installed correctly.
3350

34-
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.
51+
## License
3552

36-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
53+
Licensed under the [MIT license](https://github.com/heroui-inc/next-app-template/blob/main/LICENSE).
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"use client";
2-
import "./globals.css";
2+
import "@/styles/globals.css";
33
import "react-toastify/dist/ReactToastify.css";
44
import ThemeProvider from "../components/ThemeProvider";
55
import ThemeSwitcher from "../components/ThemeSwitcher";
66
import Spline from "@splinetool/react-spline";
77
import ApiHealthProvider from "../components/ApiHealthProvider";
88
import UpdateProvider from "../components/UpdateProvider";
99
import { useEffect, useState } from "react";
10-
import { Button } from "@heroui/react";
10+
import { Button } from "@heroui/button";
1111

1212
export default function RootLayout({
1313
children,
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"use client";
2-
import { Form, Input, Button, Card, CardHeader, CardBody } from "@heroui/react";
32
import { toast, ToastContainer } from "react-toastify";
3+
import { Card, CardHeader, CardBody } from "@heroui/card";
4+
import { Form } from "@heroui/form";
5+
import { Input } from "@heroui/input";
6+
import { Button } from "@heroui/button";
47
import "react-toastify/dist/ReactToastify.css";
58
import React, { useState } from "react";
69
import { login } from "../functions/UserAPI";

0 commit comments

Comments
 (0)