Table of Contents
A simple chat app that persists current users via cookies, saves message history in MongoDB. I've built this app to learn more about the backend - specifically node.js, express, and socket.io. I was amazed by the power of sockets, which led me to building this project. Server has an API that handles user authentication as well as message receiving, creating and storing functionality. MongoDb is used as a database.
To get a local copy up and running follow these simple example steps.
First, create .env file with
NEXT_PUBLIC_HOST=http://localhost:3001
Second, install dependencies:
npm install
Third, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
- Install dependencies:
npm install
- Create .env file with:
PORT=3001, TOKEN_KEY(jwt secret) TOKEN_EXPIRES_IN ORIGIN='http://localhost:3000'(client url) MONGO_URL(mongo connection url)
npm start
- Socket.io integration
- DB users and messages persistence
- Cookies for user log-in
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Project Link: https://github.com/andrewsolonets/TheChatApp