Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
76 changes: 56 additions & 20 deletions repo/.gitignore
Original file line number Diff line number Diff line change
@@ -1,42 +1,78 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Dependencies
node_modules
node_modules/
.pnp
.pnp.js

# Local env files
# Environment & Secret Files (NEVER COMMIT SENSITIVE DATA)
.env
.env*
!.env.example
!.env.example.txt
.env.local
.env.development.local
.env.test.local
.env.production.local

# Testing
coverage

# Turbo
.turbo
# Cloud & AWS Credentials
*.csv
credentials
credentials.ini
*.pem
*.key
*.cert
*.crt
*.pfx
*.p12
id_rsa
id_ed25519

# Vercel
.vercel
# Media Uploads & Temporary Recording Chunks
uploads/
uploads2/
**/uploads/
**/uploads2/
*.webm
*.mp4
*.mkv
*.wav
*.mp3

# Build Outputs
.next/
# Build & Compilation Outputs
dist/
**/dist/
build/
**/build/
out/
build
dist
.next/

# Turbo Cache
.turbo/

# Debug
# TypeScript Cache
*.tsbuildinfo

# Vercel & Deployment
.vercel/

# Logs & Debugging
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Misc
# Editor & OS Artifacts
.DS_Store
*.pem
Thumbs.db
.vscode/
.idea/
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# My Local Files
# Local Scratch / Temporary
old_apis.ts

scratch/
58 changes: 58 additions & 0 deletions repo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,61 @@ Learn more about the power of Turborepo:
- [Filtering](https://turborepo.com/docs/crafting-your-repository/running-tasks#using-filters)
- [Configuration Options](https://turborepo.com/docs/reference/configuration)
- [CLI Usage](https://turborepo.com/docs/reference/command-line-reference)


<!--


### Terminal 1: Run the App (Frontend, Backend, Web, & WebSocket)

In the root repository folder:

```powershell
cd "c:\Users\mohan\Documents\clone projects\Riverside\repo"
npm run dev
```

This single Turborepo command starts all 4 services:
- **Frontend (Vite UI)**: [http://localhost:5173](http://localhost:5173)
- **Web (Next.js)**: [http://localhost:3000](http://localhost:3000)
- **Backend API (Express)**: `http://localhost:3001`
- **WebSocket Layer**: `ws://localhost:8080`

---

### Terminal 2: Run the Background Worker (Video Merging)

Open a second terminal window:

```powershell
cd "c:\Users\mohan\Documents\clone projects\Riverside\repo\apps\backend-server\dist\workers"
node mergeWorker.js
```

*(Note: The merge worker connects to Redis at `localhost:6379` to process video upload jobs).*

---

### 📌 Quick Reference (If ever setting up on a fresh machine)
If you ever clone or rebuild from scratch, the full sequence is:
```powershell
# 1. Install root dependencies
npm install

# 2. Generate Prisma client & sync Supabase
cd packages/db
npx prisma generate
npx prisma db push
tsc -b
Copy-Item -Recurse -Force src\generated dist\

# 3. Start dev servers
cd ../..
npm run dev

# 4. Start worker (in a separate terminal)
cd apps/backend-server/dist/workers
node mergeWorker.js
```

-->
4 changes: 2 additions & 2 deletions repo/apps/backend-server/.env.example.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
JWT_SECRET=""

JWT_SECRET=
DATABASE_URL=

# AWS S3 STUFF
AWS_ACCESS_KEY_ID=
Expand Down
8 changes: 4 additions & 4 deletions repo/apps/backend-server/src/clients/S3_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ dotenv.config();

// Setting up AWS CLIENT FOR S3
export const s3 = new S3Client({
region:process.env.AWS_REGION!,
credentials:{
accessKeyId:process.env.AWS_ACCESS_KEY_ID!,
secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY!
region: process.env.AWS_REGION || "us-east-1",
credentials: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID || "dummy",
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY || "dummy"
}
})
8 changes: 6 additions & 2 deletions repo/apps/backend-server/src/routes/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ router.post('/create-session',authMiddleware,async(req:authRequest,res:Response)

res.status(200).json({"sessionid":session.id,"sessionCode":sessionCode});
return;
}catch(error){
res.status(400).json({msg:error});
}catch(error: any){
if (error?.code === "P2002") {
res.status(400).json({ msg: `A session named "${sessionName}" already exists. Please choose a different name.` });
return;
}
res.status(400).json({ msg: error?.message || "Failed to create session" });
return;
}
});
Expand Down
1 change: 0 additions & 1 deletion repo/apps/backend-server/tsconfig.tsbuildinfo

This file was deleted.

33 changes: 10 additions & 23 deletions repo/apps/frontend/src/api/api.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import axios from "axios";

const token = localStorage.getItem("JWT");

const getAuthHeader = () => ({
Authorization: `Bearer ${localStorage.getItem("JWT")}`,
});

// Session api's
export async function fetchAllSessions() {
const response = await axios.get(
`http://localhost:3001/api/v1/sessions/get-all-sessions`,
{
headers: {
Authorization: `Bearer ${token}`,
},
headers: getAuthHeader(),
}
);
return response;
Expand All @@ -21,9 +20,7 @@ export async function createSession(sessionName: string) {
`http://localhost:3001/api/v1/sessions/create-session`,
{ sessionName },
{
headers: {
Authorization: `Bearer ${token}`,
},
headers: getAuthHeader(),
}
);
return response;
Expand All @@ -32,9 +29,7 @@ export async function createSession(sessionName: string) {
export async function joinSession(sessionCode:string|null){

const response = await axios.post(`http://localhost:3001/api/v1/sessions/joinSession`,{sessionCode},{
headers:{
Authorization:`Bearer ${token}`
}
headers: getAuthHeader()
});

return response;
Expand All @@ -43,9 +38,7 @@ export async function joinSession(sessionCode:string|null){

export async function getSession(sessionCode:string|null){
const response = await axios.get(`http://localhost:3001/api/v1/sessions/get-session/${sessionCode}`,{
headers:{
Authorization:`Bearer ${token}`
}
headers: getAuthHeader()
})
console.log(response.data.session.tracks);

Expand All @@ -71,19 +64,15 @@ export async function signUp(name:string,email:string,password:string){
// Nsender & NReceiver api's
export async function sendChunksToBackend(formData:any){
const response = await axios.post(`http://localhost:3001/api/v1/recordings/chunks`, formData, {
headers: {
Authorization: `Bearer ${token}`
}
headers: getAuthHeader()
});
return response;
}

export async function sendFinalCallToEndOfRecordingApi(roomName:string,userType:string,sessionId:string){
const response = await axios.post(`http://localhost:3001/api/v1/recordings/merge-upload-s3`,
{ sessionName: roomName,userType,sessionId }, {
headers: {
Authorization: `Bearer ${token}`
}
headers: getAuthHeader()
});
return response;
}
Expand All @@ -92,9 +81,7 @@ export async function sendFinalCallToEndOfRecordingApi(roomName:string,userType:
export async function getAllVideosApi(sessionId:string){
const response = await axios.get(`http://localhost:3001/api/v1/recordings/get-session-videos/${sessionId}`,
{
headers:{
Authorization: `Bearer ${token}`
}
headers: getAuthHeader()
}
);
return response;
Expand Down
Loading