├── .DS_Store ├── .gitignore ├── LICENSE ├── README.md ├── getAllFilePaths.js ├── index.js ├── jsdoc.json ├── local.netget ├── .gitignore ├── backend │ ├── local.netget.cli.js │ ├── package.json │ ├── proxy.js │ └── server.js └── frontend │ ├── .vite │ └── deps │ │ ├── _metadata.json │ │ └── package.json │ ├── README.md │ ├── eslint.config.js │ ├── index.html │ ├── package.json │ ├── public │ ├── bkUp │ │ ├── neurons-grey.png │ │ ├── neurons1.mp4 │ │ └── this.png │ ├── media.neurons.me.png │ ├── media │ │ ├── CLEAKER.png │ │ ├── CLEAKER_.webp │ │ ├── IMG_6033.png │ │ ├── IMG_6034.png │ │ ├── all-this │ │ │ ├── this.DOM.png │ │ │ ├── this.audio.png │ │ │ ├── this.dictionaries-bk.png │ │ │ ├── this.dictionaries.png │ │ │ ├── this.dir.bk.png │ │ │ ├── this.dir.png │ │ │ ├── this.dom.bk.png │ │ │ ├── this.env.png │ │ │ ├── this.file.bk.png │ │ │ ├── this.file.png │ │ │ ├── this.gui.png │ │ │ ├── this.img.png │ │ │ ├── this.me.png │ │ │ ├── this.pixel.bk.png │ │ │ ├── this.pixel.png │ │ │ ├── this.png │ │ │ ├── this.text.bk.png │ │ │ ├── this.text.png │ │ │ ├── this.url.bk.png │ │ │ ├── this.url.png │ │ │ ├── this.video.png │ │ │ └── this.wallet.png │ │ ├── all.this.png │ │ ├── cleaker.me.png │ │ ├── computer_terminal_with_complex_coding_and_networking_data_displayed_on_the_screen._The_screen_shows_various_elemen-removebg-preview.png │ │ ├── imgs │ │ │ └── PixelNauts │ │ │ │ └── pixelnaut.png │ │ ├── media.neurons.me.png │ │ ├── mlearning.studio.png │ │ ├── netget.png │ │ ├── neurons-grey.png │ │ ├── neurons-me.png │ │ ├── neurons.me.dev.png │ │ ├── neurons.mp4 │ │ ├── neurons1.mp4 │ │ └── this.png │ ├── neurons.me.png │ ├── neurons_me_og.png │ └── vite.svg │ ├── src │ ├── App.jsx │ ├── assets │ │ ├── networks.json │ │ ├── neurons.me.png │ │ └── react.svg │ ├── components │ │ ├── AppBar │ │ │ ├── NetGetAppBar.jsx │ │ │ └── NeuronsAppBar.jsx │ │ ├── Docs │ │ │ └── DocsMenu.jsx │ │ ├── Footer │ │ │ └── Footer.jsx │ │ ├── Layout │ │ │ └── Layout.jsx │ │ ├── MediaGrid │ │ │ ├── Login.jsx │ │ │ ├── MediaGrid.css │ │ │ └── MediaGrid.jsx │ │ ├── MediaProfile │ │ │ └── MediaProfile.jsx │ │ ├── Network │ │ │ ├── AddNetwork.jsx │ │ │ ├── DeleteNetwork.jsx │ │ │ └── NetworkGrid.jsx │ │ ├── Neurons │ │ │ ├── AboutNeurons.jsx │ │ │ ├── NeuronsLogo.jsx │ │ │ ├── PrivacyPolicy.jsx │ │ │ └── TermsAndConditions.jsx │ │ └── ProtectedRoutes.jsx │ ├── context │ │ └── ThemeContext.jsx │ ├── main.jsx │ ├── pages │ │ ├── Home.jsx │ │ ├── Media │ │ │ └── MediaPage.jsx │ │ └── WelcomeMedia │ │ │ ├── WelcomeNetget.jsx │ │ │ └── css │ │ │ ├── layerslider.css │ │ │ ├── show.css │ │ │ └── styles.css │ ├── styles.css │ └── themes │ │ └── theme.js │ └── vite.config.js ├── notes └── Concepts.md ├── package.json └── src ├── ejsApp ├── public │ ├── gateway.png │ ├── landOfTheFree.html │ ├── netgetPedal2.html │ ├── netgetX.html │ └── netgetXPedal.html ├── scripts │ └── postInstall.js └── views │ ├── DomainsAndHandlers.ejs │ ├── domainList.ejs │ ├── index.ejs │ ├── partials │ ├── addDomain.ejs │ ├── footer.ejs │ └── header.ejs │ └── pedal.ejs ├── htmls ├── cleaker.html └── qr.html ├── modules ├── Gets │ └── Gets.js ├── NetGetX │ ├── Domains │ │ ├── SSL │ │ │ ├── Certbot │ │ │ │ ├── certbot.js │ │ │ │ └── checkAndInstallCertbot.js │ │ │ ├── SSLCertificates.js │ │ │ ├── letsEncrypt │ │ │ │ └── letsEncrypt.js │ │ │ ├── selfSigned │ │ │ │ ├── certGenerator.js │ │ │ │ └── ssl.cli.js │ │ │ └── selfSignedCertificates.js │ │ ├── domains.cli.js │ │ ├── domainsOptions.js │ │ ├── handleErrors.js │ │ ├── selectedDomain.cli.js │ │ └── viewNginxConfig.js │ ├── NetGetX.cli.js │ ├── NetGetX_Settings.cli.js │ ├── OpenResty │ │ ├── openRestyInstallationOptions.cli.js │ │ ├── setNginxConfigFile.js │ │ └── verifyOpenRestyInstallation.js │ ├── config │ │ ├── NginxPaths.js │ │ ├── getConfig.js │ │ ├── i_DefaultNetGetX.js │ │ ├── xConfig.js │ │ └── x_StateAndConfig.js │ ├── mainServer │ │ ├── mainServer.cli.js │ │ ├── serverBlockConfigOptions.cli.js │ │ ├── setDefaultServerBlock.js │ │ ├── utils.js │ │ └── verifyServerBlock.js │ ├── notes.md │ └── xState.js ├── PortManagement │ └── portManagement.cli.js ├── Srvrs │ └── srvrs.cli.js ├── netget_MainMenu.cli.js └── utils │ ├── GETDirs.js │ ├── execShellCommand.js │ ├── handlePermissionErrorForEnsureDir.js │ ├── handlePermissions.js │ ├── ipUtils.js │ ├── localHosts.js │ ├── pathUtils.js │ └── promptForDomainAndEmail.js ├── netget.cli.js ├── netget.js ├── scripts ├── init_dirs.js ├── pathUtils.js └── postInstall.js └── sqlite ├── getConfig.js ├── migrate.js ├── migrateTable.js ├── updateCertificates.js └── utils_sqlite3.js /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ```gitignore 2 | # Logs 3 | logs 4 | *.log 5 | npm-debug.log* 6 | yarn-debug.log* 7 | yarn-error.log* 8 | pnpm-debug.log* 9 | lerna-debug.log* 10 | 11 | # Private Keys 12 | *.pem 13 | privkey.pem 14 | 15 | # Dependency directories 16 | node_modules/ 17 | 18 | # Dependency lock files 19 | package-lock.json 20 | yarn.lock 21 | 22 | # OS generated files 23 | .DS_Store 24 | 25 | # Build output 26 | dist/ 27 | dist-ssr/ 28 | 29 | # Local environment files 30 | *.local 31 | .env 32 | 33 | # Ignore all .env files 34 | .env* 35 | 36 | # Editor directories and files 37 | .vscode/* 38 | !.vscode/extensions.json 39 | .idea/ 40 | *.suo 41 | *.ntvs* 42 | *.njsproj 43 | *.sln 44 | *.sw? 45 | ``` 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 netget neurons.me 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | netget 2 | 3 | # NetGet 4 | > **Build, Expose, Route — Effortlessly.** 5 | --- 6 | 7 | ## **Global Installation - (System-wide CLI)** 8 | Global installation sets up **NetGet** system-wide, providing access to its **Command Line Interface (CLI)** for configuring network routes and exposing services. 9 | 10 | **Installation:** 11 | 12 | > **Compatible with Unix-based systems (Linux, macOS).** 13 | 14 | ```bash 15 | npm i -g netget 16 | ``` 17 | 18 | **Start NetGet on your Terminal by running:** 19 | 20 | ```bash 21 | netget 22 | ``` 23 | 24 | ### 🔧 Key Features Version 2.6.x 25 | - **Expose** your IP securely via **HTTPS** 26 | - **Manage** multiple domains and **SSL certificates** 27 | - **Route** HTTPS requests to **internal services** 28 | - **Serve** static content via **HTTPS** 29 | - **Port management** and built-in diagnostics 30 | - **Wildcard certificates** and **subdomain support** 31 | 32 | ------ 33 | 34 | netget 35 | 36 | ## **Flow Overview** 37 | 38 | When **NetGet** is installed on your server, it binds to your **public IP** and starts listening for **HTTP** and **HTTPS** traffic. 39 | 40 | You use the NetGet **CLI** to register your **domains and subdomains**, specifying where each one should route — either to an internal service (via port) or to a static folder. 41 | 42 | All incoming requests are: 43 | 44 | - Automatically redirected from **HTTP to HTTPS** for secure connections. 45 | - Matched against the **registered domains**. 46 | - Routed to the appropriate **port** or **static content** you’ve defined. 47 | 48 | NetGet also manages your **SSL certificates**, issuing and renewing them automatically so you don’t have to worry about HTTPS setup. 49 | 50 | ### Example Use Case 51 | Suppose you own example.com, and you want to: 52 | 53 | 1. Route https://example.com to a **static folder** serving a React web interface. 54 | 2. Point api.example.com to a **backend service** exposing your API. 55 | 56 | With **NetGet**, you can manage this — and **as many domains and subdomains as needed** — from a single interface. 57 | 58 | Simply point your domain(s) to your server’s IP address, then use the NetGet CLI to: 59 | 60 | - Route **example.com** to your React build directory. 61 | - Forward **api.example.com** to the port where your API is running. 62 | 63 | **NetGet will automatically handle SSL certificates** for all configured endpoints. 64 | 65 | > Just ensure your applications are actively running on the ports defined in NetGet — it will take care of the routing, HTTPS encryption, and traffic flow. 66 | 67 | ------ 68 | 69 | ## **Port Management** 70 | NetGet includes a built-in **Port Management** module to help you monitor, inspect, and free up ports directly from the CLI. 71 | 72 | **To access:** 73 | ```bash 74 | netget 75 | ``` 76 | 77 | Navigate to **Port Management** using the arrow keys. 78 | 79 | ### Available Actions: 80 | - **Inspect Port**: See which process is using a specific port, with PID and service info. 81 | - **Kill Process on Port**: Free a blocked or stuck port by terminating the process. 82 | 83 | Gain full visibility and control over your device’s port allocation and traffic routing. 84 | 85 | ------ 86 | 87 | ## **Summary** 88 | Whether you're a solo developer or managing infrastructure at scale, **NetGet** provides a unified way to expose local services, manage traffic, and build modular, decentralized architectures — with ease, flexibility, and security. 89 | 90 | ------ 91 | 92 | ## By Neurons.me 93 | ### Contribution 94 | Interested in collaborating or improving NetGet? We'd love your input. 95 | ### License & Policies 96 | **License**: MIT (see LICENSE) 97 | 98 | [https://www.neurons.me](https://www.neurons.me/) 99 | 100 | [Terms](https://docs.neurons.me/terms-and-conditions) | [Privacy](https://docs.neurons.me/privacy-policy) 101 | 102 | neurons.me logo 103 | -------------------------------------------------------------------------------- /getAllFilePaths.js: -------------------------------------------------------------------------------- 1 | import { readdirSync, statSync } from 'fs'; 2 | import { join } from 'path'; 3 | 4 | /** 5 | * Recursively get all file paths in a directory 6 | * @param {string} dir - The directory to read 7 | * @param {Array} fileList - The list of file paths 8 | * @returns {Array} - The list of file paths 9 | */ 10 | function getAllFilePaths(dir, fileList = []) { 11 | const files = readdirSync(dir); 12 | 13 | files.forEach(file => { 14 | const filePath = join(dir, file); 15 | if (statSync(filePath).isDirectory()) { 16 | fileList = getAllFilePaths(filePath, fileList); 17 | } else { 18 | fileList.push(filePath); 19 | } 20 | }); 21 | 22 | return fileList; 23 | } 24 | 25 | const directoryPath = '../../../../../../Sandbox/dev_tools/assets/better-docs/tmpl'; 26 | const paths = getAllFilePaths(directoryPath); 27 | 28 | console.log(paths); 29 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | import NetGet from './src/netget.js'; 4 | import { verifyInitialization } from './src/scripts/init_dirs.js'; 5 | export { defaultHandler } from './src/routes/defaultHandlers.js'; 6 | // Verify directory initialization 7 | const getInit = verifyInitialization(); 8 | let get = "undefined"; 9 | if (!getInit) { 10 | get = "undefined"; 11 | console.error("no .get set."); 12 | } else { 13 | get = "getset" 14 | console.log(".get set."); 15 | } 16 | export default NetGet; 17 | console.log("NetGet Loaded v2.5;"); 18 | -------------------------------------------------------------------------------- /jsdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": { 3 | "include": [ 4 | "./README.md", 5 | 6 | "./index.js", 7 | 8 | "./src/modules/NetGetX/NetGetX.cli.js", 9 | "./src/modules/NetGetX/NetGetX_Settings.cli.js", 10 | 11 | "./src/modules/NetGetX/config/getConfig.js", 12 | "./src/modules/NetGetX/config/i_DefaultNetGetX.js", 13 | "./src/modules/NetGetX/config/NginxPaths.js", 14 | "./src/modules/NetGetX/config/xConfig.js", 15 | 16 | "./src/modules/NetGetX/Domains/SSL/Certbot/certbot.js", 17 | "./src/modules/NetGetX/Domains/SSL/Certbot/checkAndInstallCertbot.js", 18 | "./src/modules/NetGetX/Domains/SSL/letsEncrypt/letsEncrypt.js", 19 | "./src/modules/NetGetX/Domains/SSL/selfSigned/certGenerator.js", 20 | "./src/modules/NetGetX/Domains/SSL/selfSigned/ssl.cli.js", 21 | "./src/modules/NetGetX/Domains/SSL/selfSignedCertificates.js", 22 | "./src/modules/NetGetX/Domains/SSL/SSLCertificates.js", 23 | "./src/modules/NetGetX/Domains/domains.cli.js", 24 | "./src/modules/NetGetX/Domains/domainsOptions.js", 25 | "./src/modules/NetGetX/Domains/handleErrors.js", 26 | "./src/modules/NetGetX/Domains/selectedDomain.cli.js", 27 | "./src/modules/NetGetX/Domains/viewNginxConfig.js", 28 | 29 | "./src/modules/NetGetX/mainServer/mainServer.cli.js", 30 | "./src/modules/NetGetX/mainServer/serverBlockConfigOptions.cli.js", 31 | "./src/modules/NetGetX/mainServer/setDefaultServerBlock.js", 32 | "./src/modules/NetGetX/mainServer/utils.js", 33 | "./src/modules/NetGetX/mainServer/verifyServerBlock.js", 34 | "./src/modules/NetGetX/OpenResty/openRestyInstallationOptions.cli.js", 35 | "./src/modules/NetGetX/OpenResty/setNginxConfigFile.js", 36 | "./src/modules/NetGetX/OpenResty/verifyOpenRestyInstallation.js", 37 | 38 | "./src/modules/NetGetX/xState.js", 39 | 40 | "./src/modules/PortManagement/portManagement.cli.js", 41 | 42 | "./src/modules/Srvrs/srvrs.cli.js", 43 | 44 | "./src/modules/utils/GETDirs.js", 45 | "./src/modules/utils/execShellCommand.js", 46 | "./src/modules/utils/handlePermissionErrorForEnsureDir.js", 47 | "./src/modules/utils/handlePermissions.js", 48 | "./src/modules/utils/ipUtils.js", 49 | "./src/modules/utils/pathUtils.js", 50 | "./src/modules/utils/promptForDomainAndEmail.js", 51 | 52 | "./src/modules/netget_MainMenu.cli.js", 53 | 54 | "./src/netget.cli.js", 55 | "./src/netget.js"] 56 | }, 57 | "opts": { 58 | "destination": "/mnt/neuroverse/https-neurons/subDomains/docs/public/netget", 59 | "template": "/mnt/neuroverse/Sandbox/better-docs/", 60 | "readme": "./README.md" 61 | }, 62 | "templates": { 63 | "cleverLinks": false, 64 | "monospaceLinks": false, 65 | "search": true, 66 | "default": { 67 | "staticFiles": { 68 | "include": ["./README.md"] 69 | } 70 | }, 71 | "tags": { 72 | "allowUnknownTags": true, 73 | "dictionaries": ["jsdoc"] 74 | }, 75 | "better-docs": { 76 | "name": "NetGet", 77 | "title": "NetGet Documentation", 78 | "css": "styles/app.min.css", 79 | "trackingCode": "...", 80 | "hideGenerator": false, 81 | "navLinks": [ 82 | { 83 | "label": "All.This", 84 | "href": "https://docs.neurons.me/all.this/" 85 | }, 86 | { 87 | "label": "Neurons.me", 88 | "href": "https://neurons.me" 89 | }, 90 | { 91 | "label": "Github", 92 | "href": "https://github.com/neurons-me/all.this" 93 | } 94 | ] 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /local.netget/.gitignore: -------------------------------------------------------------------------------- 1 | ```gitignore 2 | # Logs 3 | logs 4 | *.log 5 | npm-debug.log* 6 | yarn-debug.log* 7 | yarn-error.log* 8 | pnpm-debug.log* 9 | lerna-debug.log* 10 | 11 | # Private Keys 12 | *.pem 13 | privkey.pem 14 | 15 | # Dependency directories 16 | node_modules/ 17 | 18 | # Dependency lock files 19 | package-lock.json 20 | yarn.lock 21 | 22 | # OS generated files 23 | .DS_Store 24 | 25 | # Build output 26 | dist/ 27 | dist-ssr/ 28 | 29 | # Local environment files 30 | *.local 31 | .env 32 | 33 | # Ignore all .env files 34 | .env* 35 | 36 | # Editor directories and files 37 | .vscode/* 38 | !.vscode/extensions.json 39 | .idea/ 40 | *.suo 41 | *.ntvs* 42 | *.njsproj 43 | *.sln 44 | *.sw? 45 | ``` 46 | -------------------------------------------------------------------------------- /local.netget/backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "backend", 3 | "version": "1.0.0", 4 | "main": "server.js", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1", 7 | "start": "node server.js", 8 | "dev": "nodemon server.js", 9 | "prod": "NODE_ENV=production node server.js" 10 | }, 11 | "type": "module", 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "description": "", 16 | "dependencies": { 17 | "body-parser": "^1.20.3", 18 | "chalk": "^4.1.2", 19 | "cleaker": "^2.6.62", 20 | "cookie-parser": "^1.4.7", 21 | "cors": "^2.8.5", 22 | "dotenv-flow": "^4.1.0", 23 | "express": "^4.21.2", 24 | "express-session": "^1.18.1", 25 | "inquirer": "^8.2.4", 26 | "jsonwebtoken": "^9.0.2", 27 | "mongoose": "^8.13.1", 28 | "node-fetch": "^3.3.2", 29 | "open": "^8.4.0", 30 | "sqlite3": "^5.1.7" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /local.netget/backend/server.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs'; 2 | import path from 'path'; 3 | import express from 'express'; 4 | import cors from 'cors'; 5 | import jwt from 'jsonwebtoken'; 6 | import cookieParser from 'cookie-parser'; 7 | import bodyParser from 'body-parser'; 8 | import session from 'express-session'; 9 | import mongoose from 'mongoose'; 10 | import { fileURLToPath } from 'url'; 11 | 12 | const app = express(); 13 | 14 | app.use(express.json()); 15 | app.use(bodyParser.json()); 16 | app.use(cookieParser()); 17 | 18 | const port = process.env.PORT || 3001; 19 | const SECRET_KEY = 'fiij3oi4jris09dakp*koskff'; 20 | const __filename = fileURLToPath(import.meta.url); 21 | const __dirname = path.dirname(__filename); 22 | const logFilePath = path.join(__dirname, 'server.log'); 23 | const DB_PATH = "/opt/.get/domains.db"; 24 | 25 | const route = "http://localhost:5173"; 26 | 27 | // Logging middleware 28 | app.use((req, res, next) => { 29 | const log = `${new Date().toISOString()} - ${req.method} ${req.url}\n`; 30 | fs.appendFile(logFilePath, log, (err) => { 31 | if (err) console.error('Error writing to log file', err); 32 | }); 33 | next(); 34 | }); 35 | 36 | app.use( 37 | cors({ 38 | origin: route, 39 | credentials: true, 40 | methods: ["GET", "POST", "PUT", "DELETE"], 41 | allowedHeaders: ["Content-Type"] 42 | }) 43 | ); 44 | 45 | const verifyToken = (req, res, next) => { 46 | const token = req.cookies.token || req.headers.authorization?.split(" ")[1]; 47 | if (!token) return res.status(401).json({ message: "Acceso no autorizado" }); 48 | 49 | jwt.verify(token, process.env.JWT_SECRET, (err, user) => { 50 | if (err) return res.status(403).json({ message: "Token inválido" }); 51 | req.user = user; 52 | next(); 53 | }); 54 | }; 55 | 56 | app.options("*", (req, res) => { 57 | res.header("Access-Control-Allow-Origin", route); 58 | res.header("Access-Control-Allow-Credentials", "true"); 59 | res.header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE"); 60 | res.header("Access-Control-Allow-Headers", "Content-Type"); 61 | res.sendStatus(200); 62 | }); 63 | 64 | const users = [{ username: "admin", password: "1234", role: "admin" }, { username: "bren", password: "1234", role: "user" }]; 65 | 66 | // Configurar la sesión 67 | app.use( 68 | session({ 69 | secret: "your_secret_key", 70 | resave: false, 71 | saveUninitialized: false, 72 | cookie: { 73 | httpOnly: true, 74 | secure: false, 75 | samesite: "lax", 76 | maxAge: 30000, 77 | } 78 | }) 79 | ); 80 | 81 | app.post("/login", (req, res) => { 82 | const { username, password } = req.body; 83 | 84 | const user = users.find((u) => u.username === username && u.password === password); 85 | 86 | if (user) { 87 | const token = jwt.sign({ username }, SECRET_KEY, { expiresIn: "1h" }); 88 | res.cookie("token", token, { httpOnly: true, sameSite: "Strict" }); 89 | return res.json({ success: true }); 90 | } 91 | return res.status(401).json({ success: false, message: "Usuario o contraseña incorrectos" }); 92 | }); 93 | 94 | // Endpoint para obtener dominios desde la base de datos 95 | app.get("/domains", (req, res) => { 96 | const Domain = mongoose.model('Domain', new mongoose.Schema({ 97 | domain: String, 98 | email: String, 99 | sslMode: String, 100 | target: String, 101 | type: String, 102 | projectPath: String, 103 | owner: String, 104 | })); 105 | 106 | Domain.find({}, (err, domains) => { 107 | if (err) { 108 | console.error("Error al obtener los dominios:", err.message); 109 | return res.status(500).json({ error: "Error interno del servidor" }); 110 | } 111 | res.json(domains); 112 | }); 113 | }); 114 | 115 | 116 | app.put("/update-domain", (req, res) => { 117 | const { domain, updatedFields } = req.body; 118 | 119 | if (!domain || !updatedFields) { 120 | return res.status(400).json({ error: "Missing required fields" }); 121 | } 122 | 123 | const Domain = mongoose.model('Domain', new mongoose.Schema({ 124 | domain: String, 125 | email: String, 126 | sslMode: String, 127 | target: String, 128 | type: String, 129 | projectPath: String, 130 | owner: String, 131 | })); 132 | 133 | Domain.findOneAndUpdate({ domain }, updatedFields, { new: true }, (err, updatedDomain) => { 134 | if (err) { 135 | console.error("Error updating domain:", err.message); 136 | return res.status(500).json({ error: "Database update failed" }); 137 | } 138 | res.json({ success: true, message: "Domain updated successfully", updatedDomain }); 139 | }); 140 | }); 141 | 142 | app.post("/logout", (req, res) => { 143 | res.clearCookie("token", { httpOnly: true, sameSite: "Strict" }); // Clear authentication cookie 144 | req.session.destroy(); // Si usas sesiones 145 | res.json({ success: true, message: "Logged out successfully" }); 146 | }); 147 | 148 | // Rutas protegidas 149 | app.post('/update-db', verifyToken, (req, res) => { 150 | // Lógica para modificar la base de datos 151 | res.json({ message: 'Base de datos actualizada' }); 152 | }); 153 | 154 | // Initiate server 155 | app.listen(port, () => { 156 | console.log(`Server running at ${route}:${port}`); 157 | }); -------------------------------------------------------------------------------- /local.netget/frontend/.vite/deps/_metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "hash": "e8edd04a", 3 | "configHash": "46a3bc44", 4 | "lockfileHash": "e3b0c442", 5 | "browserHash": "f37837a6", 6 | "optimized": {}, 7 | "chunks": {} 8 | } -------------------------------------------------------------------------------- /local.netget/frontend/.vite/deps/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module" 3 | } 4 | -------------------------------------------------------------------------------- /local.netget/frontend/README.md: -------------------------------------------------------------------------------- 1 | # React + Vite 2 | 3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. 4 | 5 | Currently, two official plugins are available: 6 | 7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh 8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh 9 | -------------------------------------------------------------------------------- /local.netget/frontend/eslint.config.js: -------------------------------------------------------------------------------- 1 | import js from '@eslint/js' 2 | import globals from 'globals' 3 | import react from 'eslint-plugin-react' 4 | import reactHooks from 'eslint-plugin-react-hooks' 5 | import reactRefresh from 'eslint-plugin-react-refresh' 6 | 7 | export default [ 8 | { ignores: ['dist'] }, 9 | { 10 | files: ['**/*.{js,jsx}'], 11 | languageOptions: { 12 | ecmaVersion: 2020, 13 | globals: globals.browser, 14 | parserOptions: { 15 | ecmaVersion: 'latest', 16 | ecmaFeatures: { jsx: true }, 17 | sourceType: 'module', 18 | }, 19 | }, 20 | settings: { react: { version: '18.3' } }, 21 | plugins: { 22 | react, 23 | 'react-hooks': reactHooks, 24 | 'react-refresh': reactRefresh, 25 | }, 26 | rules: { 27 | ...js.configs.recommended.rules, 28 | ...react.configs.recommended.rules, 29 | ...react.configs['jsx-runtime'].rules, 30 | ...reactHooks.configs.recommended.rules, 31 | 'react/jsx-no-target-blank': 'off', 32 | 'react-refresh/only-export-components': [ 33 | 'warn', 34 | { allowConstantExport: true }, 35 | ], 36 | }, 37 | }, 38 | ] 39 | -------------------------------------------------------------------------------- /local.netget/frontend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | local.netget 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /local.netget/frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "loca.netget", 3 | "private": true, 4 | "version": "0.0.1", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint .", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "@emotion/react": "^11.14.0", 14 | "@emotion/styled": "^11.14.0", 15 | "@mui/icons-material": "^6.4.7", 16 | "@mui/material": "^6.4.7", 17 | "@mui/x-data-grid": "^7.27.3", 18 | "axios": "^1.7.9", 19 | "react": "^18.3.1", 20 | "react-dom": "^18.3.1", 21 | "react-router-dom": "^7.3.0", 22 | "terser": "^5.39.0" 23 | }, 24 | "devDependencies": { 25 | "@eslint/js": "^9.17.0", 26 | "@types/react": "^18.3.18", 27 | "@types/react-dom": "^18.3.5", 28 | "@vitejs/plugin-react": "^4.3.4", 29 | "eslint": "^9.17.0", 30 | "eslint-plugin-react": "^7.37.2", 31 | "eslint-plugin-react-hooks": "^5.0.0", 32 | "eslint-plugin-react-refresh": "^0.4.16", 33 | "globals": "^15.14.0", 34 | "vite": "^6.0.5" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /local.netget/frontend/public/bkUp/neurons-grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/bkUp/neurons-grey.png -------------------------------------------------------------------------------- /local.netget/frontend/public/bkUp/neurons1.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/bkUp/neurons1.mp4 -------------------------------------------------------------------------------- /local.netget/frontend/public/bkUp/this.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/bkUp/this.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media.neurons.me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media.neurons.me.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/CLEAKER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/CLEAKER.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/CLEAKER_.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/CLEAKER_.webp -------------------------------------------------------------------------------- /local.netget/frontend/public/media/IMG_6033.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/IMG_6033.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/IMG_6034.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/IMG_6034.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.DOM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.DOM.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.audio.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.dictionaries-bk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.dictionaries-bk.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.dictionaries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.dictionaries.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.dir.bk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.dir.bk.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.dir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.dir.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.dom.bk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.dom.bk.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.env.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.env.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.file.bk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.file.bk.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.file.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.gui.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.img.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.me.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.pixel.bk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.pixel.bk.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.pixel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.pixel.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.text.bk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.text.bk.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.text.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.url.bk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.url.bk.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.url.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.video.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all-this/this.wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all-this/this.wallet.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/all.this.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/all.this.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/cleaker.me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/cleaker.me.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/computer_terminal_with_complex_coding_and_networking_data_displayed_on_the_screen._The_screen_shows_various_elemen-removebg-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/computer_terminal_with_complex_coding_and_networking_data_displayed_on_the_screen._The_screen_shows_various_elemen-removebg-preview.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/imgs/PixelNauts/pixelnaut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/imgs/PixelNauts/pixelnaut.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/media.neurons.me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/media.neurons.me.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/mlearning.studio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/mlearning.studio.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/netget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/netget.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/neurons-grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/neurons-grey.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/neurons-me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/neurons-me.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/neurons.me.dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/neurons.me.dev.png -------------------------------------------------------------------------------- /local.netget/frontend/public/media/neurons.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/neurons.mp4 -------------------------------------------------------------------------------- /local.netget/frontend/public/media/neurons1.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/neurons1.mp4 -------------------------------------------------------------------------------- /local.netget/frontend/public/media/this.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/media/this.png -------------------------------------------------------------------------------- /local.netget/frontend/public/neurons.me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/neurons.me.png -------------------------------------------------------------------------------- /local.netget/frontend/public/neurons_me_og.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/public/neurons_me_og.png -------------------------------------------------------------------------------- /local.netget/frontend/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /local.netget/frontend/src/App.jsx: -------------------------------------------------------------------------------- 1 | // frontend/src/App.jsx 2 | import React from 'react'; 3 | import { BrowserRouter as Router, Route, Routes, Navigate } from 'react-router-dom'; 4 | import MediaPage from './pages/Media/MediaPage'; // Layout for most pages 5 | import WelcomeNetget from './pages/WelcomeMedia/WelcomeNetget'; // Hero Section Page 6 | import Login from './components/MediaGrid/Login'; // Media Grid 7 | import TermsAndConditions from './components/Neurons/TermsAndConditions'; // Terms 8 | import PrivacyPolicy from './components/Neurons/PrivacyPolicy'; // Privacy 9 | import NetworkGrid from './components/Network/NetworkGrid'; // Network Grid 10 | import Home from './pages/Home'; // Home Page 11 | import AddNetwork from './components/Network/AddNetwork'; // Add Network Component 12 | import ProtectedRoute from './components/ProtectedRoutes'; // Protected Route Component 13 | import DeleteNetwork from './components/Network/DeleteNetwork'; // Delete Network Component 14 | 15 | const App = () => { 16 | 17 | return ( 18 | 19 | 20 | {/* WelcomeMedia as a standalone page */} 21 | } /> 22 | {/* Media Grid wrapped with MediaPage */} 23 | 27 | 28 | 29 | } 30 | /> 31 | 32 | 36 | 37 | 38 | } 39 | /> 40 | 41 | 45 | 46 | 47 | 48 | 49 | } 50 | /> 51 | 52 | 56 | 57 | 58 | 59 | 60 | } 61 | /> 62 | 63 | 67 | 68 | 69 | 70 | 71 | } 72 | /> 73 | 74 | {/* Terms and Conditions wrapped with MediaPage */} 75 | 79 | 80 | 81 | } 82 | /> 83 | 84 | {/* Privacy Policy wrapped with MediaPage */} 85 | 89 | 90 | 91 | } 92 | /> 93 | 94 | {/* Redirect example */} 95 | } 98 | /> 99 | 100 | 101 | ); 102 | }; 103 | 104 | export default App; -------------------------------------------------------------------------------- /local.netget/frontend/src/assets/networks.json: -------------------------------------------------------------------------------- 1 | { 2 | "networks": { 3 | "neget.site": { 4 | "name": "Neget", 5 | "description": "Neget is a social network that connects people with friends and others who work, study and live around them. People use Neget to keep up with friends, upload an unlimited number" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /local.netget/frontend/src/assets/neurons.me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neurons-me/netget/b0374b4806f000229c2e919ce9fffe997c694b40/local.netget/frontend/src/assets/neurons.me.png -------------------------------------------------------------------------------- /local.netget/frontend/src/assets/react.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /local.netget/frontend/src/components/AppBar/NetGetAppBar.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState, useRef, useEffect } from "react"; 2 | import { 3 | AppBar, 4 | Toolbar, 5 | Typography, 6 | IconButton, 7 | Avatar, 8 | Menu, 9 | MenuItem, 10 | Box, 11 | Button // Add Button import 12 | } from "@mui/material"; 13 | import MenuIcon from "@mui/icons-material/Menu"; 14 | import AccountCircleIcon from "@mui/icons-material/AccountCircle"; 15 | import { useNavigate } from "react-router-dom"; 16 | 17 | const NetGetAppBar = () => { 18 | const [anchorEl, setAnchorEl] = useState(null); 19 | const [showProfileMenu, setShowProfileMenu] = useState(false); 20 | const profileMenuRef = useRef(); 21 | const navigate = useNavigate(); 22 | 23 | // Handle Profile Menu Actions 24 | const handleProfileMenuOpen = (event) => { 25 | setAnchorEl(event.currentTarget); 26 | setShowProfileMenu(true); 27 | }; 28 | 29 | const handleProfileMenuClose = async () => { 30 | setAnchorEl(null); 31 | setShowProfileMenu(false); 32 | 33 | try { 34 | await fetch("https://api.netget.site/logout", { 35 | method: "POST", 36 | credentials: "include" // Ensures the cookie is included in the request 37 | }) 38 | .then(response => response.json()) 39 | .then(data => { 40 | console.log(data.message); 41 | navigate("/"); // Navigate to home page 42 | }) 43 | .catch(error => console.error("Error:", error)); 44 | } catch (error) { 45 | console.error("Error logging out:", error); 46 | } 47 | }; 48 | 49 | const handleLogout = () => { 50 | alert("Logging out..."); 51 | handleProfileMenuClose(); 52 | }; 53 | 54 | useEffect(() => { 55 | if (showProfileMenu) { 56 | document.addEventListener("mousedown", (event) => { 57 | if (profileMenuRef.current && !profileMenuRef.current.contains(event.target)) { 58 | setShowProfileMenu(false); 59 | } 60 | }); 61 | } 62 | return () => { 63 | document.removeEventListener("mousedown", handleProfileMenuClose); 64 | }; 65 | }, [showProfileMenu]); 66 | 67 | return ( 68 | 78 | 79 | {/* Left Side - Menu Icon */} 80 | 81 | 82 | 83 | 84 | {/* Center - App Title */} 85 | 86 | Local NetGet 87 | 88 | 89 | {/* Right Side - Profile Avatar and Networks Button */} 90 | 91 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | {/* Profile Menu */} 107 | 108 | Profile 109 | Logout 110 | 111 | 112 | ); 113 | }; 114 | 115 | export default NetGetAppBar; 116 | -------------------------------------------------------------------------------- /local.netget/frontend/src/components/AppBar/NeuronsAppBar.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { Link } from 'react-router-dom'; 3 | import { 4 | AppBar, 5 | Box, 6 | Toolbar, 7 | Typography, 8 | IconButton, 9 | Button, 10 | Menu, 11 | MenuItem, 12 | useMediaQuery, 13 | } from '@mui/material'; 14 | import MenuIcon from '@mui/icons-material/Menu'; 15 | import HomeIcon from '@mui/icons-material/Home'; 16 | 17 | // const pages = [ 18 | // { title: 'All Domains', link: '/media' }, 19 | // ]; 20 | 21 | export default function NeuronsAppBar() { 22 | const [anchorElNav, setAnchorElNav] = useState(null); 23 | const isMobile = useMediaQuery('(max-width:987px)'); 24 | 25 | // Menu handlers 26 | const handleOpenNavMenu = (event) => setAnchorElNav(event.currentTarget); 27 | const handleCloseNavMenu = () => setAnchorElNav(null); 28 | 29 | return ( 30 | <> 31 | 40 | 47 | {/* Logo Section */} 48 | 49 | 57 | neurons.me 62 | 63 | 73 | local.netget 74 | 75 | 76 | 77 | {/* Desktop Links */} 78 | {!isMobile && ( 79 | 87 | {/* Home Icon */} 88 | 96 | 97 | 98 | 99 | )} 100 | 101 | {/* Mobile Menu Icon (Right-Aligned) */} 102 | {isMobile && ( 103 | 109 | 110 | 111 | )} 112 | 113 | 114 | 115 | {/* Adjust Main Content */} 116 | {/* This pushes the content below the AppBar */} 117 | {/* Your main content goes here */} 118 | 119 | 120 | {/* Mobile Menu */} 121 | 139 | {/* 140 | 149 | {page.title} 150 | 151 | */} 152 | 153 | 164 | Home 165 | 166 | 167 | 168 | 169 | ); 170 | } -------------------------------------------------------------------------------- /local.netget/frontend/src/components/Docs/DocsMenu.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Box, Grid, Typography, Card, CardActionArea, CardContent } from "@mui/material"; 3 | 4 | // Define menu items with images and explicit links 5 | const menuItems = [ 6 | { 7 | title: "All.This", 8 | description: "A collection of modular tools.", 9 | image: "/media/all.this.png", // Replace with the actual image path 10 | link: "/all-this", // Explicit link 11 | }, 12 | { 13 | title: "i.mLearning", 14 | description: "Machine learning simplified.", 15 | image: "/media/mlearning.studio.png", // Replace with the actual image path 16 | link: "/i-mlearning", // Explicit link 17 | }, 18 | { 19 | title: "neurons.me", 20 | description: "Framework for neural networks.", 21 | image: "/media/neurons.me.dev.png", // Replace with the actual image path 22 | link: "/neurons-me", // Explicit link 23 | }, 24 | { 25 | title: "Cleaker", 26 | description: "Decentralized identity solutions.", 27 | image: "/media/cleaker.me.png", // Replace with the actual image path 28 | link: "/cleaker", // Explicit link 29 | }, 30 | { 31 | title: "NetGet", 32 | description: "Secure connection manager.", 33 | image: "/media/netget.png", // Replace with the actual image path 34 | link: "/netget", // Explicit link 35 | }, 36 | ]; 37 | 38 | const DocsMenu = () => { 39 | return ( 40 | 47 | {/* Title */} 48 | 59 | Explore Documentation 60 | 61 | 62 | {/* Grid of Items */} 63 | 64 | {menuItems.map((item, index) => ( 65 | 72 | 85 | {/* Use explicit link */} 86 | 87 | 97 | {/* Add the image */} 98 | 111 | 112 | {/* Title */} 113 | 121 | {item.title} 122 | 123 | 124 | {/* Description */} 125 | 132 | {item.description} 133 | 134 | 135 | 136 | 137 | 138 | ))} 139 | 140 | 141 | ); 142 | }; 143 | 144 | export default DocsMenu; 145 | -------------------------------------------------------------------------------- /local.netget/frontend/src/components/Footer/Footer.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Box, Typography, Link, useTheme } from "@mui/material"; 3 | import InstagramIcon from "@mui/icons-material/Instagram"; 4 | import GitHubIcon from "@mui/icons-material/GitHub"; 5 | 6 | const Footer = () => { 7 | const theme = useTheme(); 8 | 9 | return ( 10 | 27 | 35 | {/* Icons Section */} 36 | 37 | window.open("https://instagram.com/neurons.me", "_blank")} 45 | /> 46 | window.open("https://github.com/neurons-me", "_blank")} 54 | /> 55 | 56 | 57 | 58 | {/* Neurons.me Section */} 59 | 73 | neurons.me 74 | 75 | 76 | {/* Links Section */} 77 | 78 | 89 | Terms of Use 90 | 91 | 102 | Privacy Policy 103 | 104 | 115 | Docs 116 | 117 | 128 | Glossary 129 | 130 | 131 | 132 | 133 | {/* Logo Section */} 134 | 135 | 136 | neurons.me logo 141 | 142 | 143 | 144 | ); 145 | }; 146 | 147 | export default Footer; -------------------------------------------------------------------------------- /local.netget/frontend/src/components/Layout/Layout.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Box } from "@mui/material"; 3 | import NeuronsAppBar from "../AppBar/NeuronsAppBar"; 4 | import Footer from "../Footer/Footer"; 5 | 6 | const Layout = ({ children }) => { 7 | return ( 8 | 16 | 17 | 23 | {children} 24 | 25 |