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
2 changes: 2 additions & 0 deletions contributors/LevelSilence/Backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.env
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const BILLING_CYCLES = {
MONTHLY: "monthly",
YEARLY: "yearly",
};

const SUBSCRIPTION_CATEGORIES = {
ENTERTAINMENT: "entertainment",
EDUCATION: "education",
PRODUCTIVITY: "productivity",
UTILITIES: "utilities",
OTHER: "other",
};

const SUBSCRIPTION_STATUSES = {
ACTIVE: "active",
TRIAL: "trial",
CANCELLED: "cancelled",
EXPIRED: "expired",
};

const SUBSCRIPTION_SOURCES = {
MANUAL: "manual",
GMAIL: "gmail",
STRIPE: "stripe",
RAZORPAY: "razorpay",
};

module.exports = {
BILLING_CYCLES,
SUBSCRIPTION_CATEGORIES,
SUBSCRIPTION_STATUSES,
SUBSCRIPTION_SOURCES,
};
13 changes: 13 additions & 0 deletions contributors/LevelSilence/Backend/db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const mongoose = require("mongoose");

const connectDB = async () => {
try {
const connection = await mongoose.connect(process.env.MONGO_URI);
console.log(`MongoDB connected: ${connection.connection.host}`);
} catch (err) {
console.error("MongoDB connection error:", err.message);
process.exit(1);
}
};

module.exports = connectDB;
Loading