Skip to content

Commit

Permalink
Merge pull request #38 from hiteshchoudhary/feat/chat-app
Browse files Browse the repository at this point in the history
feat(chat-app): chat application apis with socket setup v1
  • Loading branch information
wajeshubham authored Aug 28, 2023
2 parents 0e788b9 + 948fd7b commit b9561b4
Show file tree
Hide file tree
Showing 58 changed files with 18,109 additions and 226 deletions.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ACCESS_TOKEN_SECRET=LD9cv1kBfgRHVIg9GG_OGzh9TUkcyqgZAaM0o3DmVkx08MCFRSzMocyO3UtN
ACCESS_TOKEN_EXPIRY=1d # 1 day. Formats: https://github.com/vercel/ms#examples
REFRESH_TOKEN_SECRET=CMdDNtowK7fX0-5D9cv0oJ008MCFRSLHVTUkcyqgZAaIg9GG_OGzh9zMocyO3UtN1kBfLRn3DmVkxdO # ok to change
REFRESH_TOKEN_EXPIRY=10d # 10 days. Formats: https://github.com/vercel/ms#examples
CORS_ORIGIN=http://localhost:3000 # add the frontend URL
# ################# REQUIRED ENV VARS END #################

# ----------------------------------------------------------------------------------------------------------
Expand Down
Empty file modified .husky/commit-msg
100644 → 100755
Empty file.
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions examples/chat-app/web/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# freeapi server urls
# know more about free api here: https://github.com/hiteshchoudhary/apihub
VITE_SERVER_URI=http://localhost:8080/api/v1
VITE_SOCKET_URI=http://localhost:8080
19 changes: 19 additions & 0 deletions examples/chat-app/web/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
plugins: ["react-refresh"],
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"@typescript-eslint/no-explicit-any": ["off"],
},
};
24 changes: 24 additions & 0 deletions examples/chat-app/web/.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?
12 changes: 12 additions & 0 deletions examples/chat-app/web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Installation and setup

Create a `.env` file in the ROOT folder and copy past the content of the `.env.sample` file in it.

Run the following commands to start the server

```bash
npm install
npm run dev

# Make sure to keep the freeapi server running
```
13 changes: 13 additions & 0 deletions examples/chat-app/web/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>FreeAPI | Chat app example</title>
</head>
<body class="bg-dark text-white">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading

0 comments on commit b9561b4

Please sign in to comment.