Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mejia-dev/mernchatapp
Full stack chat application! MERN Stack + Vite, TypeScript, & Tailwind!
https://github.com/mejia-dev/mernchatapp
chat chat-application expressjs mern mern-stack mongodb nodejs react tailwindcss typescript vite
Last synced: about 2 months ago
JSON representation
Full stack chat application! MERN Stack + Vite, TypeScript, & Tailwind!
- Host: GitHub
- URL: https://github.com/mejia-dev/mernchatapp
- Owner: mejia-dev
- License: mit
- Created: 2024-03-26T18:09:32.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-01T23:14:09.000Z (9 months ago)
- Last Synced: 2024-04-02T00:24:05.501Z (9 months ago)
- Topics: chat, chat-application, expressjs, mern, mern-stack, mongodb, nodejs, react, tailwindcss, typescript, vite
- Language: TypeScript
- Homepage:
- Size: 113 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: License.txt
Awesome Lists containing this project
README
# MERN Stack Chat Application
## What is a MERN stack?
A MERN stack is comprised of the following technologies that can be used to create a full-stack web application:
- [**M**ongoDb](https://www.mongodb.com/)
- [**E**xpressJS](https://expressjs.com/)
- [**R**eactJS](https://react.dev/)
- [**N**odeJS](https://nodejs.org/)#### Additional Technologies Used:
- [Vite](https://vitejs.dev/)
- [TypeScript](https://www.typescriptlang.org/)
- [Tailwind CSS](https://tailwindcss.com/)## Description
This project provides user login / logout functionality, account creation, and real time messaging using websockets.#### Additional features:
* Intuitive UI design.
* Autoscroll to the bottom of the page for long chats
* Status indicators for when a user is online or offline
* Easily scalable NoSQL database structure.More information autogenerated by Vite can be found below in the "More Vite Information" section.
## Setup/Installation Requirements
* Clone this repository by running the following command from the Git Bash console:
```bash
git clone https://github.com/mejia-dev/mernchatapp.git
```* Navigate to the project directory, then to the `api` subdirectory:
```bash
cd mernchatapp/api
```* Create a new file called `.env`:
```bash
touch .env
```* Create a new MongoDB database (refer to the [official documentation](https://www.mongodb.com/docs/atlas/create-database-deployment/) if needed).
* Add the deployment URL (starting with `mongodb+srv://`) into the `.env` file in the following format, replacing `YOUR_URL_HERE` with the url:
```txt
MONGO_URL= "YOUR_URL_HERE"
```* Next specify two more keys in `.env`.
* The JWT_SECRET must be a secret key for the JWT generation. This can be set to anything.
* The CLIENT_URL must be set to the server address that connections will be made from. The default should be `http://localhost:5173`.
```txt
MONGO_URL = "mongodb+srv://mernchat:[email protected]/?retryWrites=true&w=majority&appName=Cluster0"
JWT_SECRET="YOUR_SECRET_KEY"
CLIENT_URL="http://localhost:5173"
```* Run the following command to install dependencies:
```bash
npm install
```* Once the dependencies install, run the following command to start the backend API:
```bash
node index.js
```* Leave the terminal open, then start another terminal in the project directory to navigate to the `client` folder and run the start command to run the live development server:
* ```bash
cd mernchatapp/client
```
* ```bash
npm run start
```To generate a built version of the application, use `npm run build`.
## Known Bugs
* none
## License
MIT License
Copyright (c) 2024 Aaron Mejia
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.## More Vite Information:
Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh## Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level `parserOptions` property like this:
```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
```- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list