Skip to content

Commit b9561b4

Browse files
authored
Merge pull request #38 from hiteshchoudhary/feat/chat-app
feat(chat-app): chat application apis with socket setup v1
2 parents 0e788b9 + 948fd7b commit b9561b4

58 files changed

Lines changed: 18109 additions & 226 deletions

Some content is hidden

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

.env.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ACCESS_TOKEN_SECRET=LD9cv1kBfgRHVIg9GG_OGzh9TUkcyqgZAaM0o3DmVkx08MCFRSzMocyO3UtN
88
ACCESS_TOKEN_EXPIRY=1d # 1 day. Formats: https://github.com/vercel/ms#examples
99
REFRESH_TOKEN_SECRET=CMdDNtowK7fX0-5D9cv0oJ008MCFRSLHVTUkcyqgZAaIg9GG_OGzh9zMocyO3UtN1kBfLRn3DmVkxdO # ok to change
1010
REFRESH_TOKEN_EXPIRY=10d # 10 days. Formats: https://github.com/vercel/ms#examples
11+
CORS_ORIGIN=http://localhost:3000 # add the frontend URL
1112
# ################# REQUIRED ENV VARS END #################
1213

1314
# ----------------------------------------------------------------------------------------------------------

.husky/commit-msg

100644100755
File mode changed.

.husky/pre-commit

100644100755
File mode changed.

examples/chat-app/web/.env.sample

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# freeapi server urls
2+
# know more about free api here: https://github.com/hiteshchoudhary/apihub
3+
VITE_SERVER_URI=http://localhost:8080/api/v1
4+
VITE_SOCKET_URI=http://localhost:8080
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2020: true },
4+
extends: [
5+
"eslint:recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
"plugin:react-hooks/recommended",
8+
],
9+
ignorePatterns: ["dist", ".eslintrc.cjs"],
10+
parser: "@typescript-eslint/parser",
11+
plugins: ["react-refresh"],
12+
rules: {
13+
"react-refresh/only-export-components": [
14+
"warn",
15+
{ allowConstantExport: true },
16+
],
17+
"@typescript-eslint/no-explicit-any": ["off"],
18+
},
19+
};

examples/chat-app/web/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

examples/chat-app/web/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Installation and setup
2+
3+
Create a `.env` file in the ROOT folder and copy past the content of the `.env.sample` file in it.
4+
5+
Run the following commands to start the server
6+
7+
```bash
8+
npm install
9+
npm run dev
10+
11+
# Make sure to keep the freeapi server running
12+
```

examples/chat-app/web/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>FreeAPI | Chat app example</title>
8+
</head>
9+
<body class="bg-dark text-white">
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)