https://github.com/spacesick/socketio-messaging
Simple real-time chatting with Node.js, Socket.io, and Prisma.
https://github.com/spacesick/socketio-messaging
nodejs prisma socket-io
Last synced: about 2 months ago
JSON representation
Simple real-time chatting with Node.js, Socket.io, and Prisma.
- Host: GitHub
- URL: https://github.com/spacesick/socketio-messaging
- Owner: spacesick
- Created: 2023-05-01T09:05:08.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-04T03:53:12.000Z (almost 3 years ago)
- Last Synced: 2025-06-25T13:52:50.667Z (12 months ago)
- Topics: nodejs, prisma, socket-io
- Language: JavaScript
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# socketio-messaging
This is a simple backend implementation for a real-time chatting web app using Node.js, Socket.io, and Prisma hooked to a PostgreSQL database. You can see a pairing frontend implementation in [one of my other repositories](https://github.com/spacesick/vehicle-rental-nuxt).
## Running the server
1. Clone this repository
2. Make sure you have npm and Node.js version 14 or higher installed
3. Install the required packages,
```bash
npm install
```
4. Create a `.env` file in the root directory and define the following environment variables,
- `PORT`: the desired port for the server
- `FRONT_END_DEPLOYMENT`: the URL of your frontend app
- `DATABASE_URL`: the URL of your PostgreSQL database
Below is an example,
```dotenv
PORT=8080
FRONT_END_DEPLOYMENT="http://localhost:3000"
DATABASE_URL="postgresql://user:password@host:port/database?schema=public"
```
5. Run the following to migrate the Prisma schema into your database and generate a Prisma client,
```bash
npx prisma db push
npx prisma generate
```
6. Start the server,
```bash
npm start
```