Web application for real-time chat between authenticated users.
You can see the DeepWiki oficial documentacion here:
You can see the chat app running in production here:
- Sign up and sign in with Firebase Auth.
- User profile creation in Firestore on registration.
- User list to start conversations.
- Direct messages between users stored in Firestore.
- Profile updates (name and avatar).
- Password change.
- Light/dark theme.
- Toast notifications.
- Node.js 20+
- npm 10+
- Configured Firebase account/project
- Clone the repository
git clone https://github.com/AndresOrozcoDev/chat.git
cd chat- Install dependencies
npm install- Create a
.envfile with Firebase variables
VITE_FIREBASE_API_KEY=...
VITE_FIREBASE_AUTH_DOMAIN=...
VITE_FIREBASE_PROJECT_ID=...
VITE_FIREBASE_STORAGE_BUCKET=...
VITE_FIREBASE_MESSAGING_SENDER_ID=...
VITE_FIREBASE_APP_ID=...
VITE_FIREBASE_MEASUREMENT_ID=...- Start the development environment
npm run devnpm run dev: starts Vite in development mode.npm run build: compiles TypeScript and generates a production build.npm run preview: serves the build locally.npm run lint: runs ESLint.npm run test: runs Vitest in watch mode.npm run test:coverage: runs tests with coverage.
/: login/register: registration/dashboard: main chat/account: account and profile settings
.
|- functions/
| \- src/
| \- index.ts
|- public/
|- src/
| |- context/
| | |- auth.context.tsx
| | |- notify.context.tsx
| | \- theme.context.tsx
| |- features/
| | |- auth/
| | |- chat/
| | \- profile/
| |- shared/
| | |- components/
| | \- pages/
| |- App.tsx
| |- firebase-config.ts
| \- main.tsx
|- vercel.json
\- package.json
Main collections:
users/{uid}: basic public user data.users/{uid}/chats/{otherUid}: conversation reference with another user.users/{uid}/chats/{otherUid}/messages/{messageId}: chat messages.
Each message stores:
textsenderIdcreatedAt(server timestamp)
The project is prepared for Vercel:
vercel.jsonrewrites all routes toindex.htmlto support SPA routing.
- Functional app for authentication, messaging, and profile management.
- Test coverage is focused on main routing (
src/App.test.tsx). - There is a Cloud Function scaffold in
functions/src/index.ts, currently commented out.
Run tests in watch mode with fast feedback (development mode):
npm run testRun tests with coverage:
npm run test:coverageRun tests with UI:
npm run test:uiReview production package vulnerabilities:
npm audit fixGenerate a production build:
npm run buildMIT (LICENSE).
Developed by Andres Orozco