Skip to content
Merged
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
11 changes: 11 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
MONGO_URI = mongodb://localhost:27017/PeerCall
PORT = 3000
JWT_SECRET = secret12peercall
FRONTEND_URL = http://localhost:5173

GITHUB_CLIENT_ID = put yours
GITHUB_CLIENT_SECRET put yours
GOOGLE_CLIENT_ID = put yours
GOOGLE_CLIENT_SECRET = put yours
GOOGLE_CALLBACK_URL = http://localhost:3000/api/auth/google/callback
GITHUB_CALLBACK_URL = http://localhost:3000/api/auth/github/callback
166 changes: 166 additions & 0 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"jsonwebtoken": "^9.0.2",
"mongodb": "^6.20.0",
"mongoose": "^8.19.2",
"passport": "^0.7.0",
"passport-github2": "^0.1.12",
"passport-google-oauth20": "^2.0.0",
"socket.io": "^4.8.1",
"zod": "^4.1.12"
},
Expand All @@ -27,10 +30,13 @@
"@types/express": "^5.0.3",
"@types/jsonwebtoken": "^9.0.10",
"@types/node": "^24.9.1",
"@types/passport": "^1.0.17",
"@types/passport-github2": "^1.2.9",
"@types/passport-google-oauth20": "^2.0.16",
"@types/socket.io": "^3.0.1",
"nodemon": "^3.1.10",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
"typescript": "^5.9.3"
}
}
}
12 changes: 11 additions & 1 deletion backend/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@ import authRoutes from "./routes/authRoutes.js";
import healthRoutes from "./routes/healthRoutes.js";
import { errorHandler } from "./middleware/errorHandler.js";
import roomRoutes from "./routes/roomRoutes.js";

import passport from "passport";
import "./utils/passport.js"
import cors from "cors";
dotenv.config();
const app = express();

app.use(express.json());

app.use(
cors({
origin: process.env.FRONTEND_URL || "http://localhost:5173",
credentials: true,
})
);
//initialize passport
app.use(passport.initialize());
// Routes
app.use("/api/auth", authRoutes);
app.use("/api/health", healthRoutes);
Expand Down
Loading
Loading