Лабораторна 1Лабораторна 2Лабораторна 3Лабораторна 4Лабораторна 5Лабораторна 6Лабораторна 7Лабораторна 8Лабораторна 9
OpenChat is a lightweight and dependency-minimized web application designed to provide a real-time communication platform. The primary objective during development was to reduce reliance on external libraries and frameworks, achieving a streamlined and efficient architecture. The application incorporates an HTTP server, a WebSocket server, and a database to deliver a full-featured chat system.
-
🔐 User Authentication:
- Supports user registration (Sign up) and login (Log in).
- User credentials are stored in the database.
-
🏠 Chat Rooms:
- Users can create custom chat rooms by specifying a room name.
- Users can browse existing chat rooms and join them.
- Each user maintains a list of rooms they are a member of, enabling quick access to ongoing conversations.
-
⚡ Real-Time Messaging:
- Messages within a room are exchanged in real-time using WebSocket communication.
- Message history is maintained for each room.
-
👤 Profile Management:
- Users can update their nickname and password.
- Options to log out or delete the account are available.
-
📦 Dependency-Minimized Architecture:
- HTTP server handles static assets, authentication, and room management.
- WebSocket server facilitates real-time message exchange.
- Database stores user credentials, chat rooms, membership data, and message history.
- Sign Up: A new user fills out a registration form with essential details (e.g., username, password).
- Log In: Existing users provide their credentials to access their account.
Upon successful authentication, the user is redirected to the main chat interface.
- Users can:
- Create a Room: Provide a name to establish a new chat room.
- Join a Room: Browse and join available rooms created by other users.
- Users within a chat room can:
- Send messages.
- Receive messages in real-time from other members.
- Message history is displayed when entering a room, enabling context for ongoing discussions.
- Accessible via a dedicated settings button on the main chat interface.
- Users can:
- Change their nickname.
- Update their password.
- Log out from their account.
- Delete their account, removing all associated data.
- Serves static assets (HTML, CSS, JavaScript).
- Handles user authentication (Sign up, Log in, and profile management).
- Manages API endpoints for room creation, joining, and membership.
- Manages real-time message exchange between users.
- Ensures low-latency communication within chat rooms.
- Stores user data:
- Credentials (username, password).
- Profile settings (nickname).
- Maintains chat room details:
- Room names.
- Membership information.
- Preserves message history for each room.
- 🚀 Node.js: A scalable and efficient runtime for server-side operations.
- 💾 MySQL: A relational database management system for structured and persistent data storage.
- 📡 WebSockets: A communication protocol enabling real-time, bidirectional messaging.
- 🔒 dotenv: Facilitates secure management of environment variables.
- 📂 mysql2: Simplifies interaction with the MySQL database, providing asynchronous queries.
- ⚡ ws: Implements WebSocket-based real-time communication.
- ⚙️ Babel: Enables compatibility by transpiling modern JavaScript and TypeScript.
- ✅ Jest: A robust testing framework ensuring application reliability.
- 🎭 Playwright: Facilitates end-to-end testing for seamless user experience across browsers.
- 📏 ESLint: Maintains high code quality through linting.
- 🎨 Prettier: Automatically formats code for readability and consistency.
- 🐶 Husky: Integrates Git hooks for automated pre-commit checks.