-
Notifications
You must be signed in to change notification settings - Fork 275
feat: rooms/messages API + WS realtime, React client, proxy rewrite #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
djoseph-png
wants to merge
1
commit into
mate-academy:master
Choose a base branch
from
djoseph-png:develop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /* ESLint config: React + TypeScript + Prettier (sem import/*) */ | ||
| module.exports = { | ||
| root: true, | ||
| parser: '@typescript-eslint/parser', | ||
| parserOptions: { | ||
| ecmaVersion: 'latest', | ||
| sourceType: 'module', | ||
| project: './tsconfig.json', | ||
| tsconfigRootDir: __dirname, | ||
| ecmaFeatures: { jsx: true }, | ||
| }, | ||
| settings: { | ||
| react: { version: 'detect' }, | ||
| }, | ||
| plugins: ['@typescript-eslint', 'react', 'react-hooks', 'prettier'], | ||
| extends: [ | ||
| 'eslint:recommended', | ||
| 'plugin:@typescript-eslint/recommended', | ||
| 'plugin:react/recommended', | ||
| 'plugin:react-hooks/recommended', | ||
| 'prettier', | ||
| ], | ||
| ignorePatterns: [ | ||
| 'dist', | ||
| 'build', | ||
| 'coverage', | ||
| 'node_modules', | ||
| '**/*.css.d.ts', | ||
| '.eslintcache', | ||
| ], | ||
| rules: { | ||
| 'prettier/prettier': 'warn', | ||
| 'react/react-in-jsx-scope': 'off', | ||
| '@typescript-eslint/no-explicit-any': 'off', | ||
| '@typescript-eslint/ban-ts-comment': 'off', | ||
| // Evita quebrar por blocos vazios enquanto desenvolve | ||
| 'no-empty': ['warn', { allowEmptyCatch: true }], | ||
| }, | ||
| }; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: Test | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ master ] | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [20.x] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| - run: npm install | ||
| - run: npm test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Node Chat | ||
|
|
||
| Chat full-stack com salas, histórico e tempo real. | ||
|
|
||
| ## Como rodar | ||
| - **Tudo junto**: `npm run start:all` | ||
| - Ou separado: | ||
| - Backend: `npm run server` (porta 3000) | ||
| - Frontend: `npm run dev` (Vite, porta 5173) | ||
|
|
||
| > Proxy do Vite já configurado: `/api` → http://localhost:3000 e `/ws` → ws://localhost:3000 | ||
|
|
||
| ## Funcionalidades | ||
| - Username enviado a `/auth/login` e salvo em `localStorage`. | ||
| - Salas: criar / renomear / excluir / selecionar. | ||
| - Histórico por sala: `GET /rooms/:id/messages`. | ||
| - Tempo real: **WebSocket**, **SSE** e **Long Polling** (seletor no topo direito). | ||
|
|
||
| ## Build e preview | ||
| ```bash | ||
| npm run build | ||
| npm run preview | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <!doctype html> | ||
| <html lang="pt-BR"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||
| <title>Node Chat</title> | ||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/main.tsx"></script> | ||
| </body> | ||
| </html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line states: “Salas: criar / renomear / excluir / selecionar.” The server provides PATCH and DELETE for rooms, but the frontend UI/components (e.g. RoomSidebar and App) do not include rename or delete actions — update the README or add client-side rename/delete implementations that call the server endpoints and handle edge cases (e.g., deleting the currently selected room). See server routes and client usage for context: server index.js implements PATCH/DELETE and messages/history endpoints ; client code for login, creating/selecting rooms is in App.tsx and RoomSidebar ; task requirements: implement create/rename/join/delete rooms .