Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
0b09cff
feat(voice-calls): change the voice calls model and type
akramhany Dec 11, 2024
4ddb106
feat(voice-calls): update voice call model and type
akramhany Dec 11, 2024
f5e9720
feat(voice-calls): make the initial structure of voice calls
akramhany Dec 11, 2024
8703430
feat(voice-calls): implement CREATE-CALL event handler
akramhany Dec 12, 2024
d70a16d
feat(voice-calls): Implement making clients join calls and notifying …
akramhany Dec 12, 2024
38cec50
feat(voice-calls): Implement Signal events to send data between clients
akramhany Dec 13, 2024
478bf4b
feat(voice-calls): Implement leaving a voice call
akramhany Dec 13, 2024
d06813d
feat(voice-calls): Comment lines that throws error until implementing…
akramhany Dec 13, 2024
0725a99
feat(voice-calls): Implement an endpoint to get all voice calls in a …
akramhany Dec 13, 2024
95bba44
chore(swagger): Document all calls-related sockets and endpoints
akramhany Dec 13, 2024
ded5efa
Update searchController.ts
PeterSafwatHBK Dec 13, 2024
3da494f
fix(messages): solve pagination bug
AhmedHamed3699 Dec 15, 2024
f53cfcd
fix(messages): messages sorting bug
AhmedHamed3699 Dec 15, 2024
ea4d1de
fix: solved some bugs and refactored a bit
AhmedHamed3699 Dec 16, 2024
ae43842
hotfix(messaging): new messages doesn't appear when refresh
AhmedHamed3699 Dec 16, 2024
c50d908
hotfix(chats): solved creation error
AhmedHamed3699 Dec 16, 2024
fb0a15c
fix: solved some small bugs
AhmedHamed3699 Dec 16, 2024
b420c8f
feat(chats): added E2EE to private chats
AhmedHamed3699 Dec 17, 2024
e1d2338
feat(chats): seed messages are now encrypted
AhmedHamed3699 Dec 17, 2024
401a1e3
fix(search): change search request to be POST (#141)
PeterSafwatHBK Dec 17, 2024
cdd8694
feat: add static analysis with sonar cube
amir-kedis Dec 17, 2024
c2835da
improve-search
PeterSafwatHBK Dec 17, 2024
b57680b
improve-search-fix
PeterSafwatHBK Dec 17, 2024
fc155d5
feat(messages): deliver messages on receive
AhmedHamed3699 Dec 17, 2024
527bf2c
feat(messages): add read message functionality
AhmedHamed3699 Dec 18, 2024
b869c05
hotfix: receive media & documentation
AhmedHamed3699 Dec 18, 2024
02e2b28
feat(search): Search response updated
PeterSafwatHBK Dec 18, 2024
7aea725
hotfix(chats): solved add members bug
AhmedHamed3699 Dec 18, 2024
a293449
fix(chats): fix small bug in creating groupt/channel
AhmedHamed3699 Dec 19, 2024
507391f
hotfix(chats): fix create group again
AhmedHamed3699 Dec 19, 2024
83d9149
feat(search): groups-channels-picture
PeterSafwatHBK Dec 19, 2024
1c6e900
hotfix(sockets): solved small bug
AhmedHamed3699 Dec 20, 2024
38b7f35
feat: created admin dashboard
PeterSafwatHBK Dec 20, 2024
8301805
feat: AI Integration
PeterSafwatHBK Dec 20, 2024
89a9487
hotfix: solved a small typescript error
AhmedHamed3699 Dec 20, 2024
f0bba36
Add Github action to check code compilation
shehab299 Dec 20, 2024
f057450
Updated checking code triggers
shehab299 Dec 20, 2024
0ee9e51
hotfix(messaging): AI integration bug
AhmedHamed3699 Dec 20, 2024
79be909
hotfix(seed): solved username bug
AhmedHamed3699 Dec 20, 2024
a428ba6
feat(chats): apply unfiltering
PeterSafwatHBK Dec 20, 2024
cccef7e
Update chatController.ts
PeterSafwatHBK Dec 20, 2024
f012bf8
Update userController.ts (#165)
PeterSafwatHBK Dec 20, 2024
3c04a5c
chore(logs): log something in voice calls
akramhany Dec 21, 2024
3732fce
fix: solved various bugs
AhmedHamed3699 Dec 21, 2024
baceab2
Update userRoute.ts (#168)
PeterSafwatHBK Dec 21, 2024
20c2873
chore(logs):put some logs (#170)
akramhany Dec 21, 2024
0cfbc94
fix(message): fix announcements
somiaelshemy Dec 21, 2024
07926a6
feat(messages): added mentions
AhmedHamed3699 Dec 21, 2024
8c17b83
fix: solved filtering bug
AhmedHamed3699 Dec 21, 2024
05f881a
fix: solved appropriate content bug
AhmedHamed3699 Dec 21, 2024
0fb3891
feat(firebase): install firebase
akramhany Dec 20, 2024
cb2b331
feat(fcmToken): implement an endpoint to update the FCM token
akramhany Dec 21, 2024
c61a87d
feat(messages-notifications): implement normal messages notifications
akramhany Dec 21, 2024
a4867b6
fix: changed mention regex
AhmedHamed3699 Dec 21, 2024
67a7a4a
Solve The Push Catastrophe
AhmedHamed3699 Dec 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@ MONGO_DB_PASSWORD=1234
REDIS_DOCKER_URL=redis://redis:6379
REDIS_LOCALHOST_URL=redis://localhost:6379

SERVER_URL=http://localhost:3000
WEBSOCKET_URL=ws://localhost:3000

ENCRYPTION_KEY_SECRET=encryption-key-secret #(32 bytes)
ENCRYPTION_KEY_IV=encryption-key-iv #(12 bytes)

SESSION_SECRET=session-secret
SESSION_EXPIRES_IN=180d

RECAPTCHA_SECRET=recaptcha-secret
RECAPTCHA_SITE=recaptcha-site
DISABLE_RECAPTCHA=false

EMAIL_PROVIDER=mailtrap-gmail

TELWARE_EMAIL=telware@gmail.com
TELWARE_PASSWORD=telware-password
GMAIL_HOST=smtp.gmail.com
Expand All @@ -36,4 +44,18 @@ GITHUB_CLIENT_SECRET=githu-client-secret
CROSS_PLATFORM_OAUTH_REDIRECT_URL=telware://telware.online/social-auth-loading
FRONTEND_URL=localhost:5174

GROUP_SIZE= 5
GROUP_SIZE= 5

FIREBASE_SERVICE_ACCOUNT='{
"type": "service_account",
"project_id": "your-project-id",
"private_key_id": "your-private-key-id",
"private_key": "-----BEGIN PRIVATE KEY-----\\nYOUR_PRIVATE_KEY\\n-----END PRIVATE KEY-----\\n",
"client_email": "your-client-email@your-project.iam.gserviceaccount.com",
"client_id": "your-client-id",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/your-client-email%40your-project.iam.gserviceaccount.com"
"universe_domain": "googleapis.com"
}'
39 changes: 39 additions & 0 deletions .github/workflows/checkCodeCompilationForPeter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Check That Code Compiles For Peter

on:
push:
branches:
- develop
- main

pull_request:
branches:
- main
- develop

pull_request_target:
branches:
- main
- develop

jobs:
check-code-compilation:

runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

- name: setup node
uses: actions/setup-node@v2
with:
node-version: 'lts/*'

- name: Install dependencies
run: npm install

- name: Run Server
run: npm run build


9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# telware backend

<!-- STATIC ANALYSIS BADGES -->
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=TelwareSW_telware-backend&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=TelwareSW_telware-backend)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=TelwareSW_telware-backend&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=TelwareSW_telware-backend)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=TelwareSW_telware-backend&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=TelwareSW_telware-backend)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=TelwareSW_telware-backend&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=TelwareSW_telware-backend)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=TelwareSW_telware-backend&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=TelwareSW_telware-backend)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=TelwareSW_telware-backend&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=TelwareSW_telware-backend)


Backend Repo for TelWare Messaging Platform
139 changes: 100 additions & 39 deletions docs/api/chat.swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,42 +61,30 @@
* Role:
* type: string
* description: Role of the user in the chat (e.g., member, admin).
* _id:
* type: string
* description: Unique identifier for the membership entry.
* id:
* type: string
* description: Alias for `_id`.
* type:
* type: string
* description: Type of the chat (e.g., "private", "group").
* encryptionKey:
* type: string
* description: Key used for encrypting chat messages.
* initializationVector:
* type: string
* description: Initialization vector for encrypting chat messages.
* isDeleted:
* type: boolean
* description: Indicates if the chat has been deleted.
* chatType:
* type: string
* description: Specific type of the chat (e.g., "NormalChat").
* __v:
* type: integer
* description: Version key.
* numberOfMembers:
* type: integer
* description: Total number of members in the chat.
* id:
* type: string
* description: Alias for `_id`.
* isMuted:
* type: boolean
* description: Indicates if the chat is muted.
* draft:
* type: string
* description: Draft message saved for the chat.
* _id:
* type: string
* description: Unique identifier for the chat entry.
* id:
* type: string
* description: Alias for `_id`.
* members:
* type: array
* items:
Expand Down Expand Up @@ -136,9 +124,20 @@
* items:
* type: string
* description: IDs of users blocked by this member.
* id:
* unreadMessages:
* type: array
* items:
* type: object
* properties:
* chatId:
* type: string
* description: Unique identifier of the chat this message belongs to.
* unreadMessagesCount:
* type: string
* description: Alias for `_id`.
* description: Number of unread messages in the chat.
* isMentioned:
* type: boolean
* description: Indicates if the user is mentioned in the chat.
* lastMessages:
* type: array
* items:
Expand Down Expand Up @@ -186,12 +185,6 @@
* type: string
* format: date-time
* description: Timestamp when the message was sent.
* __v:
* type: integer
* description: Version key.
* id:
* type: string
* description: Alias for `_id`.
* 401:
* description: User is not logged in or the request is invalid.
* content:
Expand Down Expand Up @@ -315,16 +308,23 @@
* name: page
* required: false
* schema:
* type: integer
* example: 1
* description: The page number for paginated messages (default is 1).
* type: objectId
* example: "674cbbba97faf0d2e8a93846"
* description: The page starting after that messageId.
* - in: query
* name: limit
* required: false
* schema:
* type: integer
* example: 50
* description: The number of messages to retrieve per page (default is 100).
* - in: query
* name: timestamp
* required: false
* schema:
* type: Date
* example: 2024-12-01T19:37:56.399Z
* description: The timestamp to retrieve messages after.
* responses:
* 200:
* description: Messages retrieved successfully.
Expand Down Expand Up @@ -356,6 +356,12 @@
* contentType:
* type: string
* example: text
* media:
* type: string
* example: "media-file-name.jpg"
* isEdited:
* type: boolean
* example: false
* isPinned:
* type: boolean
* example: false
Expand Down Expand Up @@ -383,17 +389,8 @@
* items:
* type: string
* example: []
* messageType:
* type: string
* example: private
* __v:
* type: integer
* example: 0
* id:
* type: string
* example: "674cbbba97faf0d2e8a93846"
* nextPage:
* type: integer
* type: objectId
* example: 2
* 400:
* description: Bad Request - Chat does not exist.
Expand Down Expand Up @@ -1063,3 +1060,67 @@
* type: string
* example: login first
*/

/**
* @swagger
* /chats/voice-calls/{chatId}:
* get:
* summary: Retrieve voice calls in a specific chat.
* description: Fetch all voice calls associated with a given chat ID. Access is restricted to chat members.
* tags:
* - Chat
* parameters:
* - in: path
* name: chatId
* required: true
* schema:
* type: string
* description: The ID of the chat whose voice calls are being retrieved.
* responses:
* 200:
* description: Voice calls retrieved successfully.
* content:
* application/json:
* schema:
* type: object
* properties:
* status:
* type: string
* example: success
* message:
* type: string
* example: voice calls retrieved successfully
* data:
* type: object
* properties:
* voiceCalls:
* type: array
* items:
* type: object
* 400:
* description: Missing required fields or invalid request.
* content:
* application/json:
* schema:
* type: object
* properties:
* status:
* type: string
* example: fail
* message:
* type: string
* example: missing required fields
* 403:
* description: Unauthorized request due to missing or invalid user authentication.
* content:
* application/json:
* schema:
* type: object
* properties:
* status:
* type: string
* example: fail
* message:
* type: string
* example: login first
*/
6 changes: 3 additions & 3 deletions docs/api/search.swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
* name: Search
* description: API for searching content across various spaces with optional filters and global search capabilities.
*/

/**
* @swagger
* /search-request:
* get:
* /search/search-request:
* post:
* summary: Perform a search across specified spaces with optional filters.
* tags: [Search]
* description: Allows users to search within specific spaces like chats, channels, and groups, apply filters, and enable global search for a broader scope.
Expand Down Expand Up @@ -155,6 +154,7 @@
* example: "An unexpected error occurred while processing the request."
*/


/**
* @swagger
* tags:
Expand Down
Loading
Loading