Skip to content

Commit 8b5b017

Browse files
committed
separate backend into 4 services.
1 parent f2a09ae commit 8b5b017

File tree

26 files changed

+10300
-1918
lines changed

26 files changed

+10300
-1918
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
/backend/node_modules
77
/QuestionService/node_modules
88
/QuestionService/javascript
9+
/AuthService/javascript
10+
/AuthService/node_modules
11+
/MatchingService/javascript
12+
/MatchingService/node_modules
13+
/UserService/node_modules
14+
/UserService/javascript
915
/backend/javascript
1016
/.pnp
1117
.pnp.js

backend/package-lock.json renamed to AuthService/package-lock.json

Lines changed: 1811 additions & 1888 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AuthService/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "backend",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"start": "ts-node ./src/index.ts",
7+
"dev": "concurrently \"npx tsc --watch\" \"nodemon -q ./src/index.ts\""
8+
},
9+
"dependencies": {
10+
"@types/cors": "^2.8.14",
11+
"cookie-parser": "~1.4.4",
12+
"cors": "^2.8.5",
13+
"debug": "~2.6.9",
14+
"dotenv": "^16.3.1",
15+
"express": "~4.16.1",
16+
"firebase": "^10.4.0",
17+
"http-errors": "~1.6.3"
18+
},
19+
"devDependencies": {
20+
"@types/express": "^4.17.18",
21+
"@types/node": "^20.7.1",
22+
"concurrently": "^8.2.1",
23+
"nodemon": "^3.0.1",
24+
"ts-node": "^10.9.1",
25+
"typescript": "^5.2.2"
26+
}
27+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

AuthService/src/index.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import express from "express";
2+
import cors from "cors";
3+
import {
4+
handleLogin,
5+
handleLogout,
6+
handleSignUp,
7+
} from "./auth/auth.controller";
8+
// import { Socket, Server } from 'socket.io';
9+
// import { initializeApp } from 'firebase/app';
10+
// import { getFirestore } from 'firebase/firestore';
11+
// import { firebaseConfig } from "./firebase/firebase.config";
12+
// import { Server as ServerHttp } from 'http';
13+
14+
const app = express();
15+
const port = 3003;
16+
app.use(cors());
17+
app.use(express.json());
18+
19+
app.get("/", (req, res) => {
20+
res.send("Hello World!");
21+
});
22+
23+
24+
app.post("/signup", handleSignUp);
25+
app.post("/login", handleLogin);
26+
app.delete("/logout", handleLogout);
27+
28+
29+
30+
// httpServer.listen(socketPort, () => {
31+
// console.log(`socket listening on port ${socketPort}`);
32+
// });
33+
34+
app.listen(port, () => {
35+
console.log(`Auth Service listening on port ${port}`);
36+
});

backend/tsconfig.json renamed to AuthService/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
},
1111
"include": ["./**/*.ts"],
1212
"exclue": ["node_modules"]
13-
}
13+
}

0 commit comments

Comments
 (0)