Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devmilon923/affiliate-url-generator
This project is an Affiliate URL Generator that allows users to create and track affiliate links. Users can input any URL, and the application generates an affiliate link, tracking the number of clicks and visit history.
https://github.com/devmilon923/affiliate-url-generator
ejs-templates express mogoose monogodb mvc-architecture nodejs
Last synced: 12 days ago
JSON representation
This project is an Affiliate URL Generator that allows users to create and track affiliate links. Users can input any URL, and the application generates an affiliate link, tracking the number of clicks and visit history.
- Host: GitHub
- URL: https://github.com/devmilon923/affiliate-url-generator
- Owner: devmilon923
- Created: 2024-10-14T07:58:31.000Z (23 days ago)
- Default Branch: main
- Last Pushed: 2024-10-16T07:48:04.000Z (21 days ago)
- Last Synced: 2024-10-17T23:49:18.588Z (19 days ago)
- Topics: ejs-templates, express, mogoose, monogodb, mvc-architecture, nodejs
- Language: JavaScript
- Homepage:
- Size: 3.37 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Affiliate URL Generator
This project is an Affiliate URL Generator that allows users to create and track affiliate links. Users can input any URL, and the application generates an affiliate link, tracking the number of clicks and visit history.
## Features
- **Generate Affiliate Links**: Users can enter any URL to create an affiliate link.
- **Track Clicks**: The application tracks how many times each affiliate link is clicked.
- **Visit History**: View all visit history for each affiliate link, including the original URL and the date of creation.
- **Content UI**: A user-friendly interface to interact with the application.
- **Login/Create**: Users can log in, create an account, and the link will follow them.
- **Role-Based Authentication**: Users can log in, create an account, and access links based on their roles.## Tech Stack
- **Node.js**: JavaScript runtime for building server-side applications.
- **Express.js**: Web framework for Node.js to build web applications.
- **MongoDB**: NoSQL database for storing affiliate link data.
- **Mongoose**: ODM (Object Data Modeling) library for MongoDB and Node.js, used for data modeling.## MVC Architecture
This project follows the Model-View-Controller (MVC) architectural pattern to separate concerns and improve code organization.
## Future Enhancements
- **WebSocket Render Functionality**: Currently not implemented but planned for future updates.
## Installation
1. Clone the repository:
```bash
git clone https://github.com/devmilon923/affiliate-url-generator.git2. Navigate to the project directory:
```bash
cd3. Install the dependencies:
```bash
npm install4. Set up your MongoDB connection in the connection.js file:
```bash
const mongoose = require("mongoose");async function dbConnect() {
return mongoose.connect(
"Your Database URL"
);
}
5. Add your private JWT token in service/service.js:
```bash
const privateKey = "Your Private Key";6. Start the server:
```bash
npm start## Role Add in your Route:
- **Update User Model**: Add one more field in your 'User' model.```bash
permission: {
type: String,
require: true,
default: "NORMAL",
},- **Modify Your Routes**: Use role(['ADMIN','USER']) currently this two are working but following our code you can change it easily (Recommended to add this role() middlewares before auth middlewares).
```bash
route.get("/", auth, role(["ADMIN", "USER"]), YourRouteController);