Alert: the db.js file doesn't run on start, if you get the error: Operation verifyids.insertOne() buffering timed out after 10000ms
Just restart the server, And access /api/verifyid and api/keyid. When you access the urls it will fix the error.
You can fix it to run on start tho. I forgot to do that.
This is an open-source key system built using Next.js and MongoDB, with Linkvertise integration for monetization.
To use this key system, follow these instructions:
-
Clone the repository to your local machine:
git clone https://github.com/WavaDev/key-system.git
-
Install dependencies by running:
npm install
-
Build the application:
npm run build
-
Start the application:
npm start
If you wish to make modifications to the code, you can run the development server:
npm run dev
Before running the application, ensure you edit the .env
file:
NEXTAUTH_URL=https://example.com
MONGODB_URI=YOUR_MONGODB_DATABASE_URL
Replace YOUR_MONGODB_DATABASE_URL
with your MongoDB database URL.
Also, edit the config.js
file:
const main_url = 'YOUR_MAIN_URL'; // The Main URL/Root URL, for example: https://example.com
const linkvertise_ID = 'YOUR_LINKVERTISE_ID'; // Your Linkvertise ID, required for monetization.
const adminWhitelist = ['YOUR_DISCORD_ID']; // Your Discord ID and other admins who have permissions to access the Admin Panel.
const DISCORD_CLIENT_ID = 'YOUR_DISCORD_CLIENT_ID'; // Your Discord Client ID for Discord Admin Login.
const DISCORD_CLIENT_SECRET = 'YOUR_DISCORD_CLIENT_SECRET'; // Your Discord Client Secret for Discord Admin Login.
const secret = 'YOUR_SECRET'; // For enhanced security, used for admin login with Discord.
const DISCORD_WEBHOOK_LOGIN = 'YOUR_DISCORD_WEBHOOK_LOGIN'; // Webhook URL for admin login logs.
const DISCORD_WEBHOOK_KEYSYSTEM_LOGS = 'YOUR_DISCORD_WEBHOOK_KEYSYSTEM_LOGS'; // Webhook URL for key system logs.
Replace placeholders with your actual values.
You can check if a key is valid by sending a GET request to the following URL:
https://example.com/api/keyids?keyid=[the key]
This application runs on port 3100
, and the admin panel is accessible at:
https://example.com/admin
To set up Discord authentication, add the callback URL in your Discord application settings:
https://example.com/api/auth/callback/discord
Contributions are welcome! If you'd like to contribute to this project, please fork the repository, make your changes, and submit a pull request.
This project is licensed under the MIT License.
Made with ❤️ by WavaDev using Next.js