🌐 WorldItSocialNetwork – Back-End
This repository contains the server-side application for WorldItSocialNetwork , a social media platform designed for connectivity and interaction.
It now uses Bun as a modern, ultra-fast runtime instead of npm.
Core: Bun, TypeScript, Express.js
Database: SQLite (via Prisma ORM)
Authentication: JWT, Bcrypt
File Handling: Multer
Communication: Nodemailer
WorldItSocialNetwork-Back-End/
├── prisma/
│ └── schema.prisma
├── public/
│ └── uploads/
├── src/
│ ├── index.ts
│ ├── socket.ts
│ ├── config/
│ ├── middlewares/
│ ├── types/
│ ├── utils/
│ ├── userApp/
│ ├── postApp/
│ ├── friendshipApp/
│ ├── chatsApp/
│ ├── messagesApp/
│ └── albumApp/
├── .env
├── package.json
└── tsconfig.json
2️⃣ Environment Configuration
PORT = 3000
DATABASE_URL = " file:./dev.db"
JWT_SECRET = " your_super_secret_key"
Method
Endpoint
Description
POST
/reg
Register a new user
POST
/log
Login user
POST
/sendCode
Send code by email
GET
/me
Get information about user from token
PUT
/:id
Update user by id
GET
/all
Get all users
GET
/:id
Get user by id
Method
Endpoint
Description
GET
/
Get all post
POST
/create
Create post
PUT
/:id
Update post
DELETE
/:id
Delete post
Method
Endpoint
Description
GET
/
Get all albums
POST
/create
Create album
PUT
/:id
Update album
DELETE
/:id
Delete album
Method
Endpoint
Description
GET
/all
Get friends
POST
/create
Send request
POST
/acceptFriendship
Accept request
DELETE
/deleteFriendship
Remove friend
Method
Endpoint
Description
GET
/
Get conversations
POST
/create
Start chat
GET
/:id
Get messages
Method
Endpoint
Description
DELETE
/:id
Delete message
POST
/create
Send message
GET
/:id
Get message
Images stored in:
Command
Description
bun run start
Run compiled project from dist/index.js
bun run dev
Run project in development mode using Bun (runs TypeScript directly)
bun run build
Build TypeScript → JavaScript (tsc)
bun run prisma:format
Format Prisma schema
bun run prisma:migrate
Apply Prisma migrations
bun run prisma:seed
Run Prisma seed
bun run lint
Run ESLint
bun run lint:fix
Fix ESLint issues automatically
bun run format
Format code with Prettier
bun run prettier:check
Check formatting with Prettier
bun run copy:prisma
Copy generated Prisma client to dist/generated (Windows PowerShell)
bun run release
Run semantic-release