Skip to content

Commit

Permalink
Add react_rooms_chat example.
Browse files Browse the repository at this point in the history
  • Loading branch information
tausifcreates committed Dec 18, 2023
1 parent 3c4d186 commit 62a94a9
Show file tree
Hide file tree
Showing 35 changed files with 5,577 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/react-rooms-chat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# A room based group chat app built with React and Socketioxide.
The building instructions for the client and the server can be found in the respective folders.

App Screenshot:
![App Screenshot](app-screenshot.png)
Binary file added examples/react-rooms-chat/app-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions examples/react-rooms-chat/client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
root: true,
env: {browser: true, es2020: true},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: {ecmaVersion: 'latest', sourceType: 'module'},
settings: {react: {version: '18.2'}},
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{allowConstantExport: true},
],
"react/prop-types": "off"
},
}
24 changes: 24 additions & 0 deletions examples/react-rooms-chat/client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
23 changes: 23 additions & 0 deletions examples/react-rooms-chat/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
This repo provides the frontend for the Rust Socket.io video by
[Dreams of Code](https://youtube.com/@dreamsofcode).

## Requirements

- Node v18
- npm

## Usage

1. Fisrt `cd` into this directory.
2. Then install the depencencies using npm

```shell
$ npm install
```
3. Finally, run the development server

```shell
$ npm run dev
```

You should see the client running on http://localhost:5173
13 changes: 13 additions & 0 deletions examples/react-rooms-chat/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Chatly</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading

0 comments on commit 62a94a9

Please sign in to comment.