Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .eslintrc.cjs
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 }],
},
};
10 changes: 0 additions & 10 deletions .eslintrc.js

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/test.yml-template
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
22 changes: 22 additions & 0 deletions README2.md
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.

Copy link
Copy Markdown

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 .

- 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
12 changes: 12 additions & 0 deletions index.html
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>
Loading