···1-# Not A Friend
2-3-A application which provides a platform for random strangers to meet and chat.
4-5----
6-## What This Project Demonstrates
7-8-- Real-time communication using WebSockets
9-- User session and state management
10-- Friend request and relationship handling
11-- Client-side data persistence with IndexedDB
12-- Managing live connections and disconnections
13-14----
15-16-## Tech Stack
17-18-- **Frontend:** React
19-- **Backend:** Node.js, Express
20-- **Database:** PostgreSQL, Redis
21-- **Client Side Storage**: IndexedDB
22-- **Other Tools:** WebSockets, Prisma
23-24----
25-26-## Getting Started
27-28-Steps to run the project locally:
29-30-1. Installing Requirements
31- 1. Node
32- 2. PostgreSQL
33- 3. Redis
34-35-2. Running Client
36-37-```bash
38-git clone https://tangled.org/jai44.tngl.sh/NotAFriend
39-cd NotAFriend
40-cd client
41-npm install
42-npm run dev
43-```
44-45-3. Running Server
46-47-``` bash
48-cd ../server
49-npm install
50-cd prisma
51-npx prisma generate
52-npm run dev
53-```
···1-/*
2- Warnings:
3-4- - You are about to drop the `Messages` table. If the table is not empty, all the data it contains will be lost.
5-6-*/
7--- DropForeignKey
8-ALTER TABLE "public"."Messages" DROP CONSTRAINT "Messages_receiverId_fkey";
9-10--- DropForeignKey
11-ALTER TABLE "public"."Messages" DROP CONSTRAINT "Messages_senderId_fkey";
12-13--- DropTable
14-DROP TABLE "public"."Messages";
···00000000000000
-16
server/src/prisma/schema.prisma
···19 username String @unique
20 name String
21 password String
22-23- friendships Friendship[] @relation("UserFriendships") // friendships this user initiated
24- friends Friendship[] @relation("FriendUser") // friendships where this user is the friend
25-}
26-27-model Friendship {
28- id Int @id @default(autoincrement())
29- userId Int
30- friendId Int
31- createdAt DateTime @default(now())
32-33- // Each friendship connects two users:
34- user User @relation("UserFriendships", fields: [userId], references: [id])
35- friend User @relation("FriendUser", fields: [friendId], references: [id])
36-37- @@unique([userId, friendId])
38}