Welcome to Talk Time, a real-time chat application built using the MERN stack (MongoDB, Express.js, React.js, Node.js). Users can engage in conversations with each other seamlessly.
- Node.js and Express.js for server-side logic
- MongoDB for database management
- Socket.io for real-time communication
- Bcrypt for password hashing
- Jsonwebtoken for token-based authentication
- Cookie-parser for cookie parsing
- React.js for building the user interface
- Tailwind CSS for styling
- Express for server initialization
- Socket.io for real-time chat functionality
- Nodemon for automatic server restarts
- Dotenv for environment variable management
- Bcrypt for password hashing
- Jsonwebtoken for token creation
- Mongoose for MongoDB connection
- Cookie-parser for cookie parsing
auth.routes.js
: Defines authentication routes (signup, login, logout)messages.routes.js
: Defines message routes (api/messages/send/id
)user.routes.js
: Defines user routes
auth.controller.js
: Handles authentication logic (login, signup, logout)messages.controller.js
: Manages message-related functions (sendMessage, getMessage)user.controller.js
: Controls user-related functions
connectToMongoDB.js
: Establishes connection to MongoDB database
Contains all backend routes
user.model.js
: Defines user schemamessage.model.js
: Defines message schemaconversation.model.js
: Defines conversation schema
protectRoute.js
: Protects routes from unauthorized access
generateToken.js
: Generates tokens for authentication and security
To run the application, follow these steps:
-
Clone the repository git clone https://github.com/yourusername/talk-time.git cd talk-time
-
Navigate to the frontend and backend directories and install dependencies
cd frontend npm install
cd backend npm install -
Set up environment variables
- Create a
.env
file in the backend directory and configure your application settings, including MongoDB URI and JWT secret key.
- Create a
-
Start the server and client
cd backend npm start server
cd frontend npm start dev -
Access the application in your browser at
http://localhost:3000
We express gratitude to the following resources which greatly contributed to the development of Talk Time:
- Documentation from MongoDB, Express.js, React.js, and Node.js
- Various online tutorials and guides on real-time chat application development
- Stack Overflow community for valuable insights and solutions
Feel free to reach out with any questions or feedback!