Skip to content

kunal834/Daplink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

253 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌐 DapLink

The AI-Powered Interactive Identity & Smart Routing Hub
πŸ€– AI Digital Twin β€’ πŸ”€ Smart Link Router β€’ 🎨 Context-Aware QR Engine β€’ πŸ’¬ Direct Chat β€’ πŸ—‚οΈ Interactive Landing Pages β€’ πŸ“Š Geo Analytics

Next.js Gemini API Tailwind CSS MongoDB Socket.io


πŸ“ Overview

DapLink is an AI-powered, context-responsive digital identity hub and smart routing platform designed for digital creators, professionals, and local businesses.

Unlike standard static link directories (e.g. Linktree), DapLink transforms creator bios into active conversational portals using custom-trained AI Digital Twins. It also features a Context-Aware Smart Redirect Router that turns simple links and QR codes into responsive action triggersβ€”redirecting scanners based on device type, time of day, or location.

Built with Next.js 15 (App Router), Tailwind CSS v4, Google Gemini API, MongoDB/Mongoose, and Socket.io, DapLink provides a premium user interface optimized for customer conversion and creator monetization.


πŸ”„ Recent Updates & Bug Fixes (Post-Handover)

Below is a detailed log of the structural enhancements, feature additions, and bug fixes implemented since taking over the project repository:

1. 🎨 Layout Template Studio & Card Customization (New Feature)

We built a robust, custom layout engine allowing creators to construct unique interactive designs for their link-in-bio:

  • Four Unique Layout Templates:
    • classic (Standard List): Centralized, elegant vertical flow of profile info, socials, and tab sections.
    • bento (Bento Grid): Modern dashboard grid deck containing user stats, bio, location, links, and updates.
    • split (Split Screen): Desktop-optimized split-view with a sticky left profile card and scrollable links/feed on the right.
    • minimal (Minimalist Card): Ultra-clean floating glassmorphic container set against dynamic backdrop glows.
  • Card Border & Panel Customization: Added visual style presets for profile panels, cards, and links:
    • glass (Glassmorphic): Frosted blur effects with subtle borders and micro-shadows.
    • flat (Flat Solid): Clean, high-contrast flat backgrounds.
    • glow (Neon Border): Vibrant, glowing borders and ambient shadow accents colored by the creator's theme.
  • Real-time Studio Workspace: Integrated Layout template selection and Card Border styles inside the Appearance tab in the dashboard editor (app/Dashboard/editProfile/page.js) with instant real-time synchronization in the mockup phone preview.
  • Dynamic Server/Client Public Profile Renderer: Optimized app/u/[handle]/page.js to dynamically resolve user layout preferences, applying accent colors, font styling, and card borders with full SEO support.

2. πŸ› Key Bug Fixes & Code Optimizations

We identified and resolved critical errors in the original project files:

  • Dashboard JSX Mismatches: Fixed a missing closing tag block inside the profile canvas editor component in page.js that caused layout page rendering to break.
  • Temporal Dead Zone Hoisting Error: Resolved a ReferenceError: Cannot access 'routeHandle' before initialization in the dynamic profile page page.js by hoisting route parameter initialization higher in the scope.
  • Next.js HMR Webpack Cache Corruption: Solved a Webpack cache corruption issue on Windows (Cannot find module './5873.js' / Unexpected end of JSON input) by migrating favicon.ico from dynamic routing (app/) to static serving (public/) and updating all layout/metadata icon paths to absolute roots.
  • Public Page Syntax Fixes: Fixed double-parenthesis/semicolon syntax termination (););) inside the return layout of page.js.

✨ Key Features

1. πŸ€– Interactive AI Digital Twin (Conversational Agent)

  • Real-Time Assistant Chat: Public profile pages /u/[handle] embed an AI conversational agent representing the profile owner.
  • Knowledge Customization: Train the AI on specific biographies, custom brand context, services, working hours, and targeted Q&A FAQs.
  • Interactive Resource Finder: The AI searches the owner's active links and offers clickable resource cards directly inside the conversation thread.
  • Dashboard Simulator: A floating preview mockup inside the creator's Dashboard lets owners test and interact with their twin in real-time.

2. πŸ”€ Context-Aware Smart Redirect Router

  • Device-Responsive Routing: Automatically detects user devices (iOS vs Android vs Desktop) and routes links to different destination URLs (e.g., routing to the App Store or Google Play Store).
  • Scheduled Time Ranges: Dynamically shifts link targets based on the time of the scan (e.g., directing tables in a cafe to a breakfast menu in the morning and a dinner menu in the evening).
  • Geographical Location Routing: Inspects incoming country headers (x-vercel-ip-country) to direct visitors to region-specific URLs or local landing pages.
  • Dynamic QR Codes: A single generated QR code can change behaviors on the fly based on these configured rules without requiring physical reprinting.

3. πŸ“± Dynamic Link-in-Bio Landing Page Builder (/app/Generate)

  • Multi-Step Onboarding Funnel: Choose handles, select themes, assign custom background patterns, and add digital links step-by-step.
  • Detailed Aesthetic Configuration: Change page fonts, custom accent colors, background styling (soft, glow, gradient, image), button border-radius, element blurs, and border formatting.
  • Public Profiles: Public-facing /u/[handle] endpoints with premium layouts, floating cards, social icons, custom bios, and connection triggers.

4. πŸ’¬ Live Socket-Powered Chat & Connections (/app/Dashboard/messages)

  • Instant Direct Messaging: Built-in messaging platform powered by Socket.io.
  • Follow-to-Message Integration: Network by searching the community, following profiles, and messaging connections directly.
  • Online Presence Indicators: Seamless client-server synchronization of active chat conversations.

5. πŸ“Š Rich Audience Analytics Dashboard (/app/Dashboard/analytics)

  • Geographical Mapping: D3-based interactive World Map (WorldMap.jsx) charting target viewer origins.
  • Visual Charting: Beautiful responsive layouts built with ECharts and Recharts for daily metrics, browser shares, operating systems, and device splits.
  • Traffic Ingress Logs: Audit tables detailing exact referrers, coordinates, timestamps, and IP parameters.

πŸ“‚ Project Directory Structure

daplink/
β”œβ”€β”€ app/                        # Next.js 15 App Router Directory
β”‚   β”œβ”€β”€ [code]/                 # Dynamic route handling short URL redirects (route.js)
β”‚   β”œβ”€β”€ api/                    # Server-side API endpoints & routes
β”‚   β”‚   β”œβ”€β”€ (Follow)/           # API endpoints to handle follow/unfollow operations & query statuses
β”‚   β”‚   β”œβ”€β”€ (UrlShortner)/      # API endpoints to manage database short link registrations
β”‚   β”‚   β”œβ”€β”€ (onboarding)/       # Handle check-ups and onboarding workflow progression
β”‚   β”‚   β”œβ”€β”€ ContactusApi/       # Handle customer inquiry submissions
β”‚   β”‚   β”œβ”€β”€ GetReview/          # Fetch platform testimonials
β”‚   β”‚   β”œβ”€β”€ Peoples/            # Search and fetch other DapLink creators
β”‚   β”‚   β”œβ”€β”€ Review/             # Review creation & publication
β”‚   β”‚   β”œβ”€β”€ Socket/             # Handlers and initializers for websockets
β”‚   β”‚   β”œβ”€β”€ Updatedetails/      # Profile modifications
β”‚   β”‚   β”œβ”€β”€ auth/               # Next-Auth settings and controllers
β”‚   β”‚   β”œβ”€β”€ backend/            # Utility controllers and server setups
β”‚   β”‚   β”œβ”€β”€ getDaplink/         # Fetch full profile and links configuration
β”‚   β”‚   β”œβ”€β”€ getQrcode/          # Retrieve generated user QR codes
β”‚   β”‚   β”œβ”€β”€ links/              # Main links management
β”‚   β”‚   β”œβ”€β”€ posthog/            # Analytics integrations
β”‚   β”‚   β”œβ”€β”€ qrcode/             # Custom QR code generation, updates & saves
β”‚   β”‚   └── theme/              # Personalized profile themes
β”‚   β”œβ”€β”€ About/                  # Static About DapLink page
β”‚   β”œβ”€β”€ Blog/                   # Blog page directory
β”‚   β”œβ”€β”€ Contact/                # Feedback and contact forms
β”‚   β”œβ”€β”€ Dashboard/              # Authenticated user dashboard section
β”‚   β”‚   β”œβ”€β”€ analytics/          # Rich analytics interface (ECharts, Recharts, WorldMap)
β”‚   β”‚   β”œβ”€β”€ bioPage/            # Link-in-bio personalization page
β”‚   β”‚   β”œβ”€β”€ community/          # Community connection listing page
β”‚   β”‚   β”œβ”€β”€ editProfile/        # User detail editing panel
β”‚   β”‚   β”œβ”€β”€ features/           # Showcase of creator features
β”‚   β”‚   β”œβ”€β”€ messages/           # Live chat client page (Socket.io-client)
β”‚   β”‚   β”œβ”€β”€ monetization/       # Monetization configurations (referred to as Monetize)
β”‚   β”‚   β”œβ”€β”€ mindset/            # High-productivity mindset hubs
β”‚   β”‚   └── settings/           # Account settings & credentials management
β”‚   β”œβ”€β”€ Docu/                   # Platform documentation and API references
β”‚   β”œβ”€β”€ Explorepeoples/         # Creator discovery directory (search, profiles, follows)
β”‚   β”œβ”€β”€ Generate/               # Multi-step link-in-bio generation funnel
β”‚   β”œβ”€β”€ Pricing/                # Tier packages page (Free vs Premium plans)
β”‚   β”œβ”€β”€ Products/               # DapLink products list
β”‚   β”œβ”€β”€ Templates/              # High-quality UI templates for bio profiles
β”‚   β”œβ”€β”€ Trust/                  # Trust, privacy policy & compliance documentation
β”‚   β”œβ”€β”€ u/                      # Public Creator Profiles
β”‚   β”‚   └── [handle]/           # Dynamic bio page rendering based on custom handle
β”‚   β”œβ”€β”€ globals.css             # Tailwind v4 configuration and global styling
β”‚   β”œβ”€β”€ layout.js               # Main layout wrapper injecting theme and auth context
β”‚   └── page.js                 # Landing index showcasing Hero, Showcase, Pricing, and Testimonials
β”‚
β”œβ”€β”€ Components/                 # Reusable React UI Components
β”‚   β”œβ”€β”€ DashboardComponents/    # Dedicated Dashboard layouts (Sidebar, Topbar, Tabs, WorldMap)
β”‚   β”œβ”€β”€ modals/                 # Modular popup overlays for forms, alerts, and settings
β”‚   β”œβ”€β”€ SkeletonScreen/         # Premium skeleton loaders for dashboard charts and lists
β”‚   β”œβ”€β”€ ui/                     # Reusable atomic elements (Cards, Reveal wrappers, buttons)
β”‚   β”œβ”€β”€ CalltoAction.js         # Direct user conversions layout
β”‚   β”œβ”€β”€ FeatureShowcase.js      # Beautiful animated grid of core abilities
β”‚   β”œβ”€β”€ Footer.js               # Styled comprehensive footer component
β”‚   β”œβ”€β”€ Navbar.js               # Premium floating navigation bar with dark mode integration
β”‚   β”œβ”€β”€ Realanalytics.js        # Showcase demo metrics for non-authenticated guests
β”‚   └── Testimonial.js          # Interactive user review carousel
β”‚
β”œβ”€β”€ context/                    # React Context State Management
β”‚   β”œβ”€β”€ Authenticate.js         # User session, login/registration tokens & state variables
β”‚   └── ThemeContext.js         # Global light/dark theme tracking and DOM modifications
β”‚
β”œβ”€β”€ lib/                        # Utility & Core Initialization Libraries
β”‚   β”œβ”€β”€ api/                    # Core API endpoints wrappers
β”‚   β”œβ”€β”€ auth.js                 # JWT-based local authentication methods
β”‚   β”œβ”€β”€ mongodb.js              # Highly optimized Mongoose/MongoDB connection pool config
β”‚   └── QueryProvider.js        # React-Query / TanStack Query client registration
β”‚
β”œβ”€β”€ models/                     # Mongoose Database Schemas
β”‚   β”œβ”€β”€ Contact.js              # Contact messages schema
β”‚   β”œβ”€β”€ Link.js                 # Creator Bio Profile schema (UserId, Handle, Links array, ThemeConfig)
β”‚   β”œβ”€β”€ Review.js               # Testimonial reviews database collection
β”‚   β”œβ”€β”€ ShortUrl.js             # Short URLs record schema (title, shortCode, originalUrl, click tracker)
β”‚   β”œβ”€β”€ Theme.js                # Custom visual presets
β”‚   β”œβ”€β”€ qrcode.js               # Custom QR Codes styles & logo configs schema
β”‚   └── user.js                 # User database collection schema (details, following, onboarding trackers)
β”‚
β”œβ”€β”€ utils/                      # Helper Scripts & Configurations
β”‚   β”œβ”€β”€ GenerateShortCode.js    # Logic for cryptographically robust short URL key generator
β”‚   └── Socket.js               # Server-side Socket.IO handler initializer
β”‚
β”œβ”€β”€ public/                     # Static media assets, icons, fonts, and maps
β”œβ”€β”€ middleware.js               # Next.js navigation guards protecting Dashboard pathways
β”œβ”€β”€ next.config.mjs             # Next.js compiler and target platform adjustments
β”œβ”€β”€ postcss.config.mjs          # PostCSS adjustments
β”œβ”€β”€ tailwind.config.js          # Extended styling presets
└── package.json                # Project dependencies, script configurations & workspace metadata

πŸ› οΈ Technology Stack

Layer Technologies Used Purpose
Core Architecture Next.js 15 (App Router), React 19, JavaScript (ESM) Complete frontend/backend framework
Database & ODM MongoDB, Mongoose Data persistence, modeling, and schemas
Real-time Engine Socket.io, Socket.io-client Direct chat channels and live connection state updates
Styling & Motion Tailwind CSS v4, PostCSS, Framer Motion High-profile visuals, dark mode toggles, micro-animations
Data Analytics D3.js, ECharts, Recharts, TopoJSON-client High-fidelity maps, graphical click telemetry, dashboards
Security & Auth NextAuth.js, JWT, BcryptJS, js-cookie Secure session management, password hashing, routing guards
UI Enhancements Canvas-confetti, Lucide-React, React-icons, React-hot-toast UI rewards, icons, and notifications

🏁 Setup & Installation

1. Prerequisites

Ensure you have Node.js (v18 or higher recommended) and MongoDB installed or access to a MongoDB Atlas cluster.

2. Clone the Repository & Install Dependencies

# Clone the repository
git clone <repository-url>
cd daplink

# Install all workspace dependencies
npm install

3. Environment Configuration

Create a .env.local file in the root directory and configure the following variables:

# Database Connection
MONGODB_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/daplink

# NextAuth & JWT Secrets
NEXTAUTH_SECRET=your_super_secret_nextauth_key
JWT_SECRET=your_super_secret_jwt_sign_key
NEXTAUTH_URL=http://localhost:3000

# Analytical Trackers (Optional)
NEXT_PUBLIC_POSTHOG_KEY=your_posthog_key
NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com

4. Running the Project

# Launch Next.js local development server
npm run dev

# Build for production
npm run build

# Start the compiled production build
npm run start

# Lint the codebase
npm run lint

🌟 Visual Theme & Design Systems

DapLink implements a premium, high-profile interface right out of the box:

  • Aurora Glowing Accents: Smooth backdrop gradients that shift over time (fixed inset-0 bg-purple-900/30...).
  • Glassmorphic Cards: High transparency blur layers (backdrop-blur-md) giving elements a premium frosted look.
  • Fluid Micro-Animations: Clean, spring-based Framer Motion transitions upon button hover, input focusing, and step shifts.
  • Seamless Dark Mode: Responsive global context theme transitions keeping layout brightness tailored to user settings.

About

Make your bio Suplastic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors