https://github.com/fauna-labs/chat-app-streaming
https://github.com/fauna-labs/chat-app-streaming
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fauna-labs/chat-app-streaming
- Owner: fauna-labs
- Created: 2024-03-11T23:39:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-16T15:11:22.000Z (about 1 year ago)
- Last Synced: 2024-10-02T20:01:47.828Z (9 months ago)
- Language: JavaScript
- Homepage: https://chat-app-streaming.vercel.app
- Size: 344 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Fauna Stream Chat App
This sample app demostrates how to use Fuana stream to build a real-time chat app. It's built with Next.js and Fauna database.
### Prerequisites
- Basic knowledge of React and Next.js
- Fauna account### Getting Started
1. Clone the repository
```bash
git clone https://github.com/fauna-labs/chat-app-streaming
```
2. Install dependencies
```bash
cd chat-app-streaming
npm install```
3. Configure Fauna database
- Login to your Fauna CLI using `fauna cloud-login`. If you don't have the CLI installed, you can install it using `npm install -g fauna-shell`
- Create a new database using `fauna create-database chat-app`
- Migrate the schema using `fauna schema push`
- Create a new key for your UnAuthenticatedRole by running the following FQL code in the Fauna shell
```
Key.create({
role: 'UnAuthenticatedRole'
})
```4. Save the key to a `.env` file in the root of the project.
```bash
# UnAuthenticatedRole
NEXT_PUBLIC_FAUNA_UNAUTHENTICATED_SECRET=
```5. Run the app
```bash
npm run dev
```
6. Open the app in your browser at `http://localhost:3000`