Skip to content

Commit 7e9b2bd

Browse files
committed
Remove unused code and fix docker volumes
1 parent 7231f62 commit 7e9b2bd

File tree

4 files changed

+9
-36
lines changed

4 files changed

+9
-36
lines changed

backend/user-service/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434

3535
4. A default admin account (`email: [email protected]` and `password: Admin@123`) wil be created. If you wish to change the default credentials, update them in `.env`. Alternatively, you can also edit your credentials and user profile after you have created the default account.
3636

37+
5. To view the contents stored in Redis,
38+
39+
1. Go to [http://localhost:5540](http://localhost:5540).
40+
41+
2. Click on "Add Redis Database".
42+
43+
3. Enter `host.internal.docker` as the Host.
44+
3745
## Running User Service without Docker
3846

3947
1. Open Command Line/Terminal and navigate into the `user-service` directory.

backend/user-service/tests/setup.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@ import mongoose from "mongoose";
22
import redisClient from "../config/redis";
33

44
beforeAll(async () => {
5-
// mongo = await MongoMemoryServer.create();
6-
// const mongoUri = mongo.getUri();
7-
8-
// if (mongoose.connection.readyState !== 0) {
9-
// await mongoose.disconnect();
10-
// }
11-
125
const mongoUri =
136
process.env.MONGO_URI_TEST || "mongodb://mongo:mongo@mongo:27017/";
147

@@ -27,10 +20,6 @@ afterEach(async () => {
2720
});
2821

2922
afterAll(async () => {
30-
// if (mongo) {
31-
// await mongo.stop();
32-
// }
33-
3423
await mongoose.connection.close();
3524
await redisClient.disconnect();
3625
});

backend/user-service/utils/mailer.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
import nodemailer from "nodemailer";
22
import dotenv from "dotenv";
3-
// import path from "path";
4-
// import { fileURLToPath } from "url";
5-
import { Options } from "nodemailer/lib/mailer";
6-
// import hbs from "nodemailer-express-handlebars";
73
import Handlebars from "handlebars";
84
import { ACCOUNT_VERIFICATION_TEMPLATE } from "./constants";
95

10-
// type ExtendedOptions = Options & {
11-
// template: string;
12-
// context: Record<string, unknown>;
13-
// };
14-
156
dotenv.config();
167

178
const SERVICE = process.env.SERVICE;
@@ -23,21 +14,6 @@ const transporter = nodemailer.createTransport({
2314
auth: { user: USER, pass: PASS },
2415
});
2516

26-
// const dirname = fileURLToPath(import.meta.url);
27-
28-
// transporter.use(
29-
// "compile",
30-
// hbs({
31-
// viewEngine: {
32-
// extname: ".hbs",
33-
// layoutsDir: path.resolve(path.dirname(dirname), "../templates/"),
34-
// defaultLayout: "",
35-
// },
36-
// viewPath: path.resolve(path.dirname(dirname), "../templates/"),
37-
// extName: ".hbs",
38-
// })
39-
// );
40-
4117
export const sendAccVerificationMail = async (
4218
to: string,
4319
subject: string,

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ services:
135135
networks:
136136
- peerprep-network
137137
volumes:
138-
- redis-insight-data:/db
138+
- redis-insight-data:/data
139139
depends_on:
140140
redis:
141141
condition: service_healthy

0 commit comments

Comments
 (0)