This project implements a search bar for efficient filtering and an add new chat box feature for dynamic chat creation. It is built with Node.js and provides an intuitive framework for managing chat functionality.
-
Real-Time Search:
- Instantly filters chat lists based on user input.
- Updates dynamically as you type in the search bar.
-
Add New Chat Box:
- Easily create new chat boxes with custom titles or user IDs.
- Handles multiple chats seamlessly.
-
Scalable Framework:
- Built for easy expansion and integration into larger systems.
/data # Stores chat data or mock datasets
/node_modules # Auto-managed dependencies
/public # Static assets such as CSS, JavaScript, and images
package.json # Dependency and project configuration
package-lock.json # Dependency lock file
server.js # Entry point for the application
Ensure you have the following installed:
- Node.js (version 14 or higher)
- npm (Node Package Manager)
-
Clone the repository:
git clone https://github.com/youle1999/SearchBar-function.git cd SearchBar-function -
Install dependencies:
npm install
-
Start the server:
npm start
-
Open your browser and go to:
http://localhost:3000 -
Use the search bar to filter existing chats in real-time and the Add Chat button to dynamically add new chat boxes.
-
GET
/api/chats:- Retrieves a list of existing chats.
-
POST
/api/chats:- Adds a new chat box.
- Payload example:
{ "title": "New Chat", "userId": "User123" }
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Commit your changes (
git commit -m "Add new feature"). - Push the branch (
git push origin feature-branch). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.