├── .gitignore ├── .sample.env ├── README.md ├── api ├── Schema │ ├── Smm │ │ ├── orders.js │ │ └── services.js │ ├── Sub4Sub │ │ ├── sub4suborders.js │ │ └── sub4subuser.js │ └── main │ │ ├── subscriptions.js │ │ ├── transiction.js │ │ └── user.js ├── config │ └── mongoose.js ├── modules │ ├── Auth.js │ ├── adding.js │ ├── services.js │ └── sub4sub.js └── routes │ ├── adding.js │ ├── admin.js │ ├── services.js │ ├── sub4sub.js │ └── users.js ├── app.js ├── package-lock.json ├── package.json └── vercel.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | .DS_Store -------------------------------------------------------------------------------- /.sample.env: -------------------------------------------------------------------------------- 1 | MONGO_ATLAS = "mongodb+srv://IshanSingla:Isnd@cluster.7n3viqu.mongodb.net/?retryWrites=true&w=majority" 2 | USER_VERIFICATION_TOKEN_SECRET = "dgfgpspdifgskdfngussj490385jsp8ms" 3 | EMAIL_USERNAME = "ishansingla40000@gmail.com" 4 | EMAIL_PASSWORD = "Is@290403" -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # InducedServerApis 2 | -------------------------------------------------------------------------------- /api/Schema/Smm/orders.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const OrdersSchema = mongoose.Schema({ 4 | _id: mongoose.Schema.Types.ObjectId, 5 | user: mongoose.Schema.Types.ObjectId, 6 | service: mongoose.Schema.Types.ObjectId, 7 | type: String, 8 | OrderId: String, 9 | price: Number, 10 | quantity: String 11 | }); 12 | 13 | module.exports = mongoose.model("orders", OrdersSchema); 14 | -------------------------------------------------------------------------------- /api/Schema/Smm/services.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const ServicesSchema = mongoose.Schema({ 4 | _id: mongoose.Schema.Types.ObjectId, 5 | type: String, 6 | link: String, 7 | key: String, 8 | serviceid: String, 9 | servicename: String, 10 | price: Number, 11 | min: Number, 12 | max: Number, 13 | description: { 14 | type: String, 15 | required: true, 16 | default: "" 17 | }, 18 | }); 19 | 20 | module.exports = mongoose.model("services", ServicesSchema); 21 | -------------------------------------------------------------------------------- /api/Schema/Sub4Sub/sub4suborders.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const OrdersSchema = mongoose.Schema({ 4 | _id: mongoose.Schema.Types.ObjectId, 5 | user: mongoose.Schema.Types.ObjectId, 6 | order: { 7 | type: Boolean, 8 | required: true, 9 | default: false, 10 | }, 11 | type: { 12 | type: String, 13 | required: true, 14 | default: "instagram follow", 15 | }, 16 | quantity: { 17 | type: Number, 18 | required: true, 19 | default: 0, 20 | }, 21 | link: { 22 | type: String, 23 | required: true, 24 | default: "", 25 | }, 26 | done: { 27 | type: Number, 28 | required: true, 29 | default: 0, 30 | }, 31 | }); 32 | 33 | module.exports = mongoose.model("sub4suborders", OrdersSchema); 34 | -------------------------------------------------------------------------------- /api/Schema/Sub4Sub/sub4subuser.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const OrdersSchema = mongoose.Schema({ 4 | _id: mongoose.Schema.Types.ObjectId, 5 | user: mongoose.Schema.Types.ObjectId, 6 | 7 | InstaCoins: { 8 | type: Number, 9 | required: true, 10 | default: 0, 11 | }, 12 | TelegramCoins: { 13 | type: Number, 14 | required: true, 15 | default: 0, 16 | }, 17 | telegram: { 18 | type: Array, 19 | required: true, 20 | default: [], 21 | }, 22 | instagram: { 23 | type: Array, 24 | required: true, 25 | default: [], 26 | }, 27 | }); 28 | 29 | module.exports = mongoose.model("sub4subuser", OrdersSchema); 30 | -------------------------------------------------------------------------------- /api/Schema/main/subscriptions.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const OrdersSchema = mongoose.Schema({ 4 | _id: mongoose.Schema.Types.ObjectId, 5 | user: mongoose.Schema.Types.ObjectId, 6 | servicename: String, 7 | price: Number, 8 | subscription: { 9 | type: Date, 10 | required: true, 11 | default: new Date() 12 | }, 13 | }); 14 | 15 | module.exports = mongoose.model("subscribtions", OrdersSchema); 16 | -------------------------------------------------------------------------------- /api/Schema/main/transiction.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const TransictionSchema = mongoose.Schema({ 4 | _id: mongoose.Schema.Types.ObjectId, 5 | user: mongoose.Schema.Types.ObjectId, 6 | ammount: { 7 | type: Number, 8 | required: true, 9 | default: 0, 10 | }, 11 | paymentmethod: { 12 | type: String, 13 | required: true, 14 | default: "", 15 | }, 16 | transictionid: { 17 | type: Number, 18 | required: true, 19 | default: 0, 20 | }, 21 | }); 22 | 23 | module.exports = mongoose.model("transiction", TransictionSchema); 24 | -------------------------------------------------------------------------------- /api/Schema/main/user.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const jwt = require('jsonwebtoken'); 3 | const UserSchema = mongoose.Schema({ 4 | _id: mongoose.Schema.Types.ObjectId, 5 | email: { 6 | type: String, 7 | required: true, 8 | default: "test@inducedofficial.com" 9 | }, 10 | name: { 11 | type: String, 12 | required: true, 13 | default: "" 14 | }, 15 | password: { 16 | type: String, 17 | required: true, 18 | default: "test@inducedofficial.com" 19 | }, 20 | ballence: { 21 | type: Number, 22 | required: true, 23 | default: 0 24 | }, 25 | orders: { 26 | type: Array, 27 | required: true, 28 | default: [] 29 | }, 30 | transiction: { 31 | type: Array, 32 | required: true, 33 | default: [] 34 | }, 35 | subscribtions: { 36 | type: Array, 37 | required: true, 38 | default: [] 39 | }, 40 | verified: { 41 | type: Boolean, 42 | required: true, 43 | default: false 44 | } 45 | }); 46 | UserSchema.methods.generateVerificationToken = function () { 47 | const user = this; 48 | const verificationToken = jwt.sign( 49 | { ID: user._id }, 50 | process.env.USER_VERIFICATION_TOKEN_SECRET, 51 | { expiresIn: "7d" } 52 | ); 53 | return verificationToken; 54 | }; 55 | module.exports = mongoose.model("users", UserSchema); -------------------------------------------------------------------------------- /api/config/mongoose.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | exports.main = mongoose 3 | .connect(process.env.MONGO_ATLAS, { 4 | useNewUrlParser: true, 5 | useUnifiedTopology: true, 6 | dbName: "main", 7 | }) 8 | .then(() => { 9 | console.log("Successfully connected to mongo."); 10 | }) 11 | .catch((err) => { 12 | console.log("Error connecting to mongo.", err); 13 | }); 14 | -------------------------------------------------------------------------------- /api/modules/Auth.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | const nodemailer = require("nodemailer"); 3 | const jwt = require("jsonwebtoken"); 4 | const bcrypt = require('bcrypt'); 5 | const User = require("../Schema/main/user.js"); 6 | const transporter = nodemailer.createTransport({ 7 | service: "Gmail", 8 | auth: { 9 | user: process.env.EMAIL_USERNAME, 10 | pass: process.env.EMAIL_PASSWORD, 11 | }, 12 | }); 13 | exports.signup = async (req, res) => { 14 | const { name, email, password } = req.body; 15 | if (!name) { 16 | return res.status(422).json({ msg: "name Required" }); 17 | } 18 | if (!email) { 19 | return res.status(422).json({ msg: "email Required" }); 20 | } 21 | if (!password) { 22 | return res.status(422).json({ msg: "password Required" }); 23 | } 24 | try { 25 | const existingUser = await User.findOne({ email }).exec(); 26 | if (existingUser) { 27 | return res.status(409).send({ 28 | message: "Email is already in use.", 29 | }); 30 | } 31 | const salt = await bcrypt.genSalt(12); 32 | const passwordHash = await bcrypt.hash(password, salt); 33 | 34 | const user = await new User({ 35 | _id: new mongoose.Types.ObjectId(), 36 | email: email, 37 | name: name, 38 | password: passwordHash, 39 | }).save(); 40 | 41 | const verificationToken = user.generateVerificationToken(); 42 | 43 | const url = `http://localhost:3000/api/verify/${verificationToken}`; 44 | 45 | return res.status(201).send({ 46 | message: `Sent a verification email to ${email}`, 47 | }); 48 | } catch (err) { 49 | return res.status(500).send(err); 50 | } 51 | }; 52 | exports.login = async (req, res) => { 53 | const { email, password } = req.body; 54 | 55 | if (!email) { 56 | return res.status(422).json({ msg: "email Required" }); 57 | } 58 | if (!password) { 59 | return res.status(422).json({ msg: "password Required" }); 60 | } 61 | const user = await User.findOne({ email: email }); 62 | if (!user) { 63 | return res.status(404).json({ msg: "Email Not Found" }); 64 | } 65 | const checkPassword = await bcrypt.compare(password, user.password); 66 | if (!checkPassword) { 67 | return res.status(422).json({ msg: "Password Invalid" }); 68 | } 69 | if (!user.verified) { 70 | return res.status(422).json({ msg: "Account not verified" }); 71 | } 72 | try { 73 | const secret = process.env.SECRET; 74 | const token = jwt.sign( 75 | { 76 | id: user._id, 77 | }, 78 | secret 79 | ); 80 | 81 | res.status(200).json({ msg: "Login Sucessfully", token }); 82 | } catch (error) { 83 | res.status(500).json({ 84 | msg: error, 85 | }); 86 | } 87 | }; 88 | 89 | exports.verify = async (req, res) => { 90 | const { token } = req.params; 91 | if (!token) { 92 | return res.status(422).send({ 93 | message: "Missing Token", 94 | }); 95 | } 96 | let payload = null; 97 | try { 98 | payload = jwt.verify(token, process.env.USER_VERIFICATION_TOKEN_SECRET); 99 | } catch (err) { 100 | return res.status(500).send(err); 101 | } 102 | try { 103 | const user = await User.findOne({ _id: payload.ID }).exec(); 104 | if (!user) { 105 | return res.status(404).send({ 106 | message: "User does not exists", 107 | }); 108 | } 109 | user.verified = true; 110 | await user.save(); 111 | return res.status(200).send({ 112 | message: "Account Verified", 113 | }); 114 | } catch (err) { 115 | return res.status(500).send(err); 116 | } 117 | }; 118 | 119 | 120 | // app.get("/user/:id", checkToken, async (req, res) => { 121 | // const id = req.params.id; 122 | 123 | // //// CHECK IF USER EXISTS /// 124 | // const user = await User.findById(id, "-password"); 125 | 126 | // if (!user) { 127 | // return res.status(404).json({ msg: "User not found" }); 128 | // } 129 | // res.status(200).json({ user }); 130 | // }); 131 | 132 | // function checkToken(req, res, next) { 133 | // const authHeader = req.headers["authorization"]; 134 | // const token = authHeader && authHeader.split(" ")[1]; 135 | 136 | // if (!token) { 137 | // return res.status(401).json({ msn: "Access Denied" }); 138 | // } 139 | 140 | // try { 141 | // const secret = process.env.SECRET; 142 | // jwt.verify(token, secret); 143 | 144 | // next(); 145 | // } catch (error) { 146 | // res.status(400).json({ msg: "Token Invalid" }); 147 | // } 148 | // } 149 | -------------------------------------------------------------------------------- /api/modules/adding.js: -------------------------------------------------------------------------------- 1 | const { Api, TelegramClient } = require("telegram"); 2 | const { StringSession } = require("telegram/sessions"); 3 | 4 | const apiId = 2392599; 5 | const apiHash = "7e14b38d250953c8c1e94fd7b2d63550"; 6 | 7 | clients={} 8 | 9 | exports.adding = async (req, res) => { 10 | var ish = null; 11 | console.log(req.body); 12 | try { 13 | const { stringSession, fromGroup, ToGroup, offset } = req.body; 14 | const client = new TelegramClient( 15 | new StringSession(stringSession), 16 | apiId, 17 | apiHash, 18 | { 19 | connectionRetries: 5, 20 | } 21 | ); 22 | 23 | try { 24 | await client.connect({ 25 | onError: (err) => (ish = "Account Login Failed"), 26 | }); 27 | var iss = (await client.getMe()).accessHash; 28 | Adding({ client, fromGroup, ToGroup, offset }); 29 | ish = "Login Sucessfull and start adding"; 30 | } catch (err) { 31 | ish = "Account Login Failed"; 32 | } 33 | } catch (err) { 34 | ish = err; 35 | } 36 | 37 | return res.status(200).send({ 38 | mess: ish, 39 | }); 40 | }; 41 | exports.login = async (req, res) => { 42 | const { phone } = req.body; 43 | if ("stringsession" in req.body) { 44 | try { 45 | const client = new TelegramClient( 46 | new StringSession(req.body.stringsession), 47 | apiId, 48 | apiHash, 49 | { 50 | connectionRetries: 5, 51 | } 52 | ); 53 | await client.connect(); 54 | var iss = (await client.getMe()).firstName; 55 | return res.send({ mess: "Login Sucessfully", firstName: iss }); 56 | } catch (err) {return res.send({ mess: "Login Unsucessfull" });} 57 | } else if ("code" in req.body) { 58 | try { 59 | await clients[phone].invoke( 60 | new Api.auth.SignIn({ 61 | phoneNumber: phone, 62 | phoneCodeHash: req.body.phoneCodeHash, 63 | phoneCode: req.body.code, 64 | }) 65 | ); 66 | } catch (err) { 67 | if (err.errorMessage === "SESSION_PASSWORD_NEEDED") { 68 | return res.send({ err: "SESSION_PASSWORD_NEEDED" }); 69 | } 70 | } 71 | } else if ("password" in req.body) { 72 | await clients[phone].signInWithPassword( 73 | { 74 | apiId: apiId, 75 | apiHash: apiHash, 76 | }, 77 | { 78 | password: req.body.password, 79 | onError: (err) => { 80 | throw err; 81 | }, 82 | } 83 | ); 84 | } else { 85 | if ("phone" in req.body) { 86 | clients[phone] = new TelegramClient( 87 | new StringSession(""), 88 | apiId, 89 | apiHash, 90 | {} 91 | ); 92 | await clients[phone].connect(); 93 | const result = await clients[phone].sendCode( 94 | { 95 | apiId: apiId, 96 | apiHash: apiHash, 97 | }, 98 | phone 99 | ); 100 | const phoneCodeHash = result.phoneCodeHash; 101 | return res.send({ phoneCodeHash, phone }); 102 | } 103 | } 104 | const session = await clients[phone].session.save(); 105 | await clients[phone].disconnect(); 106 | delete clients[phone]; 107 | return await res.send({ session: session,phone, }); 108 | }; 109 | 110 | async function Adding({ client, fromGroup, ToGroup, offset }) { 111 | try { 112 | await client.invoke( 113 | new Api.channels.JoinChannel({ 114 | channel: ToGroup, 115 | }) 116 | ); 117 | 118 | const result = await client.invoke( 119 | new Api.channels.GetParticipants({ 120 | channel: fromGroup, 121 | filter: new Api.ChannelParticipantsRecent({}), 122 | offset: offset, 123 | limit: 100, 124 | hash: 0, 125 | }) 126 | ); 127 | for await (const participant of result.users) { 128 | try { 129 | if (participant.username != null) { 130 | await client.invoke( 131 | new Api.channels.InviteToChannel({ 132 | channel: ToGroup, 133 | users: [participant.username], 134 | }) 135 | ); 136 | console.log(participant.firstName + " Added"); 137 | } 138 | } catch (err) { 139 | console.log(participant.firstName + " " + err.errorMessage); 140 | if (err.errorMessage == "PEER_FLOOD") { 141 | break; 142 | } else if (err.errorMessage == "FLOOD") { 143 | break; 144 | } 145 | } 146 | } 147 | console.log("Adding Done"); 148 | } catch (err) { 149 | console.log(err.errorMessage + " " + err); 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /api/modules/services.js: -------------------------------------------------------------------------------- 1 | const axios = require("axios"); 2 | const mongoose = require("mongoose"); 3 | 4 | const services = require("../Schema/Smm/services.js"); 5 | const orders = require("../Schema/Smm/orders.js"); 6 | const User = require("../Schema/main/user.js"); 7 | 8 | exports.adminadd = async (req, res) => { 9 | const { link, key } = req.body; 10 | axios.get(`${link}?key=${key}&action=services`).then((response) => { 11 | for (x of response.data) { 12 | add(x, link, key); 13 | return res.status(200).send({ mss: "Done" }); 14 | } 15 | }); 16 | }; 17 | async function add(x, link, key) { 18 | const user = await new services({ 19 | _id: new mongoose.Types.ObjectId(), 20 | type: x.category, 21 | serviceid: x.service, 22 | servicename: x.name, 23 | price: x.rate, 24 | min: x.min, 25 | max: x.max, 26 | description: x.name, 27 | link, 28 | key, 29 | }).save(); 30 | 31 | console.log(user); 32 | } 33 | 34 | exports.serviceslist = async (req, res) => { 35 | return res.status(200).send(await services.find({}).exec()); 36 | }; 37 | 38 | exports.addorder = async (req, res) => { 39 | const { id, url, quantity, uid } = req.body; 40 | 41 | const useddetails = await User.findOne({ _id: uid }).exec(); 42 | const Services = await services.findOne({ serviceid: id }).exec(); 43 | 44 | const payment = Number((Number(Services.price) * Number(quantity)) / 1000); 45 | 46 | if (useddetails.ballence - payment >= 0) { 47 | const response = await axios.get( 48 | `${Services.link}?key=${Services.key}&service=${Services.serviceid}&link=${url}&quantity=${quantity}&action=add` 49 | ); 50 | if (response.data.error) { 51 | return res.send({ 52 | response: { error: "Error in Smm Contact Owner" }, 53 | }); 54 | } else { 55 | const orderdetails = await new orders({ 56 | _id: new mongoose.Types.ObjectId(), 57 | user: useddetails._id, 58 | service: Services._id, 59 | type: Services.type, 60 | OrderId: response.data.order, 61 | price: payment, 62 | quantity: quantity, 63 | }).save(); 64 | const is = await User.findOneAndUpdate( 65 | { _id: useddetails._id }, 66 | { 67 | ballence: useddetails.ballence - payment, 68 | $push: { 69 | orders: orderdetails._id, 70 | }, 71 | }, 72 | { upsert: true } 73 | ); 74 | console.log(is); 75 | return res.send({ response: response.data }); 76 | } 77 | } else { 78 | return res.send({ 79 | response: { 80 | error: "Not enough funds on balance", 81 | ballence: useddetails.ballence, 82 | payment: payment, 83 | }, 84 | }); 85 | } 86 | }; 87 | -------------------------------------------------------------------------------- /api/modules/sub4sub.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | const axios = require("axios"); 3 | 4 | exports.InstaLogin = async (req, res) => { 5 | const { username, password } = req.body; 6 | try { 7 | const response = await axios.post( 8 | "https://www.instagram.com/accounts/login/ajax/", 9 | new URLSearchParams({ 10 | username: username, 11 | enc_password: "#PWD_INSTAGRAM_BROWSER:0:&:" + password, 12 | }), 13 | { 14 | headers: { 15 | accept: "*/*", 16 | "accept-encoding": "gzip, deflate, br", 17 | "accept-language": "en-US,en;q=0.9", 18 | origin: "https://www.instagram.com", 19 | referer: "https://www.instagram.com/", 20 | "sec-ch-ua": 21 | '".Not/A)Brand";v="99", "Google Chrome";v="103", "Chromium";v="103"', 22 | "sec-ch-ua-mobile": "?0", 23 | "sec-ch-ua-platform": '"macOS"', 24 | "sec-fetch-dest": "empty", 25 | "sec-fetch-mode": "cors", 26 | "sec-fetch-site": "same-site", 27 | "user-agent": 28 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.62 Safari/537.36", 29 | "x-asbd-id": "198387", 30 | }, 31 | } 32 | ); 33 | var mess; 34 | const cookies = response.cookies; 35 | const data = response.text; 36 | if (data.userId) { 37 | mess = { 38 | message: "Login Sucessfull", 39 | login: `${cookies.sessionid}:${cookies.csrftoken}:${cookies.ds_user_id}:${username.user}`, 40 | }; 41 | } else if (data.checkpoint_required) { 42 | mess = { 43 | message: "Login CheckPoint", 44 | }; 45 | } else { 46 | mess = { 47 | message: "Error Password Or User", 48 | }; 49 | } 50 | return res.status(200).send(mess); 51 | } catch (err) { 52 | return res.status(500).send(err); 53 | } 54 | }; 55 | 56 | 57 | exports.InstaFollow = async (req, res) => { 58 | const { username, password } = req.body; 59 | try { 60 | const response = await axios.post( 61 | "https://www.instagram.com/accounts/login/ajax/", 62 | new URLSearchParams({ 63 | username: username, 64 | enc_password: "#PWD_INSTAGRAM_BROWSER:0:&:" + password, 65 | }), 66 | { 67 | headers: { 68 | accept: "*/*", 69 | "accept-encoding": "gzip, deflate, br", 70 | "accept-language": "en-US,en;q=0.9", 71 | origin: "https://www.instagram.com", 72 | referer: "https://www.instagram.com/", 73 | "sec-ch-ua": 74 | '".Not/A)Brand";v="99", "Google Chrome";v="103", "Chromium";v="103"', 75 | "sec-ch-ua-mobile": "?0", 76 | "sec-ch-ua-platform": '"macOS"', 77 | "sec-fetch-dest": "empty", 78 | "sec-fetch-mode": "cors", 79 | "sec-fetch-site": "same-site", 80 | "user-agent": 81 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.62 Safari/537.36", 82 | "x-asbd-id": "198387", 83 | }, 84 | } 85 | ); 86 | var mess; 87 | const cookies = response.cookies; 88 | const data = response.text; 89 | if (data.userId) { 90 | mess = { 91 | message: "Login Sucessfull", 92 | login: `${cookies.sessionid}:${cookies.csrftoken}:${cookies.ds_user_id}:${username.user}`, 93 | }; 94 | } else if (data.checkpoint_required) { 95 | mess = { 96 | message: "Login CheckPoint", 97 | }; 98 | } else { 99 | mess = { 100 | message: "Error Password Or User", 101 | }; 102 | } 103 | return res.status(200).send(mess); 104 | } catch (err) { 105 | return res.status(500).send(err); 106 | } 107 | }; 108 | 109 | 110 | exports.InstaCheck = async (req, res) => { 111 | const { username, password } = req.body; 112 | try { 113 | const response = await axios.post( 114 | "https://www.instagram.com/accounts/login/ajax/", 115 | new URLSearchParams({ 116 | username: username, 117 | enc_password: "#PWD_INSTAGRAM_BROWSER:0:&:" + password, 118 | }), 119 | { 120 | headers: { 121 | accept: "*/*", 122 | "accept-encoding": "gzip, deflate, br", 123 | "accept-language": "en-US,en;q=0.9", 124 | origin: "https://www.instagram.com", 125 | referer: "https://www.instagram.com/", 126 | "sec-ch-ua": 127 | '".Not/A)Brand";v="99", "Google Chrome";v="103", "Chromium";v="103"', 128 | "sec-ch-ua-mobile": "?0", 129 | "sec-ch-ua-platform": '"macOS"', 130 | "sec-fetch-dest": "empty", 131 | "sec-fetch-mode": "cors", 132 | "sec-fetch-site": "same-site", 133 | "user-agent": 134 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.62 Safari/537.36", 135 | "x-asbd-id": "198387", 136 | }, 137 | } 138 | ); 139 | var mess; 140 | const cookies = response.cookies; 141 | const data = response.text; 142 | if (data.userId) { 143 | mess = { 144 | message: "Login Sucessfull", 145 | login: `${cookies.sessionid}:${cookies.csrftoken}:${cookies.ds_user_id}:${username.user}`, 146 | }; 147 | } else if (data.checkpoint_required) { 148 | mess = { 149 | message: "Login CheckPoint", 150 | }; 151 | } else { 152 | mess = { 153 | message: "Error Password Or User", 154 | }; 155 | } 156 | return res.status(200).send(mess); 157 | } catch (err) { 158 | return res.status(500).send(err); 159 | } 160 | }; -------------------------------------------------------------------------------- /api/routes/adding.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const adding = require('../modules/adding'); 4 | router.post('/adding', adding.adding); 5 | router.post('/login', adding.login); 6 | 7 | module.exports = router; -------------------------------------------------------------------------------- /api/routes/admin.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanSingla/ExpressJsProjects/1ba1dc7fd4264211f59d0381fdade39cdb865dd8/api/routes/admin.js -------------------------------------------------------------------------------- /api/routes/services.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const services = require('../modules/services.js'); 4 | router.post('/admin/add', services.adminadd); 5 | router.post('/serviceslist', services.serviceslist); 6 | router.post('/addorder', services.addorder); 7 | // router.post('/admin/remove', services.login); 8 | // router.get('/serviceslist', services.verify); 9 | // router.get('/orderlist', services.verify); 10 | // router.get('/order/:id', services.verify); 11 | module.exports = router; -------------------------------------------------------------------------------- /api/routes/sub4sub.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const adding = require('../modules/sub4sub'); 4 | router.post('/InstaLogin', adding.InstaLogin); 5 | router.post('/InstaFollow', adding.InstaFollow); 6 | router.post('/InstaCheck', adding.InstaCheck); 7 | 8 | module.exports = router; -------------------------------------------------------------------------------- /api/routes/users.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const UserController = require('../modules/Auth.js'); 4 | router.post('/signup', UserController.signup); 5 | router.post('/login', UserController.login); 6 | router.get('/verify/:id', UserController.verify); 7 | module.exports = router; -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | require("dotenv").config(); 2 | const express = require("express"); 3 | const db = require("./api/config/mongoose"); 4 | 5 | const app = express(); 6 | const PORT = Number(21); 7 | app.use(express.json()); 8 | 9 | app.get("/", (req, res) => { 10 | res.status(200).send("Welcome to InducedApis"); 11 | }); 12 | app.use("/auth", require("./api/routes/users.js")); 13 | app.use("/adding", require("./api/routes/adding.js")); 14 | app.use("/services", require("./api/routes/services.js")); 15 | app.use("/sub4sub", require("./api/routes/sub4sub")); 16 | app.listen(PORT, () => { 17 | console.log("Listening on port: " + PORT); 18 | }); 19 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "InducedServer", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "nodemon app.js" 9 | }, 10 | "keywords": [], 11 | "author": "Ishan Singla", 12 | "license": "ISC", 13 | "dependencies": { 14 | "axios": "^0.27.2", 15 | "bcrypt": "^5.0.1", 16 | "ddos": "^0.2.1", 17 | "dotenv": "^16.0.1", 18 | "express": "^4.18.1", 19 | "jsonwebtoken": "^8.5.1", 20 | "mongoose": "^6.4.0", 21 | "nodemailer": "^6.7.5", 22 | "telegram": "^2.9.2" 23 | }, 24 | "devDependencies": { 25 | "nodemon": "^2.0.16" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": [ 3 | { 4 | "src": "app.js", 5 | "use": "@vercel/node" 6 | } 7 | ], 8 | "routes": [ 9 | { 10 | "src": "/(.*)", 11 | "dest": "app.js" 12 | } 13 | ] 14 | } 15 | --------------------------------------------------------------------------------