Thanks to visit codestin.com
Credit goes to github.com

Skip to content

mithun50/NexGen_Website

Β 
Β 

Repository files navigation

πŸš€ NextGenXplorer

Charting the course of tomorrow's technology, today.

NPM Version License Netlify Status Next.js Tailwind CSS TypeScript Firebase

A modern, full-featured digital think tank and media hub exploring the future of technology

Live Demo β€’ Report Bug β€’ Request Feature


πŸ“‹ Table of Contents


🎯 About

NextGenXplorer is a cutting-edge digital platform that decodes the future of technology. We dissect and debate technological forcesβ€”from artificial intelligence to quantum computingβ€”that are actively reshaping our world and defining the next chapter of human history.

Our Mission

To produce visually striking, deeply researched content that demystifies complex technology and provokes critical thought about our digital future.


✨ Features

🎬 Video Content Management

  • Dynamic video archives powered by Firebase Firestore
  • Automatic YouTube metadata fetching (titles, thumbnails, descriptions)
  • Public/Private video visibility controls
  • Related links for each video
  • Responsive video grid layout

πŸ“± Apps Distribution

  • Dedicated apps page for software distribution
  • Support for external hosting (MediaFire, Google Drive, GitHub)
  • Logo and download URL management
  • Full CRUD operations via admin panel

πŸ‘€ Visitor Analytics

  • Real-time visitor tracking
  • Session-based counting (prevents duplicates)
  • Admin dashboard with statistics
  • Firebase-powered analytics storage

πŸ” Secure Admin Panel

  • JWT-based authentication
  • Protected API routes
  • Video management (add, edit, delete, visibility toggle)
  • App management (add, edit, delete)
  • Visitor statistics dashboard

🎨 Modern UI/UX

  • Dark/Light theme support
  • Fully responsive design (mobile-first)
  • Smooth animations and transitions
  • Accessible components (ARIA compliant)
  • ShadCN UI component library

πŸ”— Social Integration

  • Dynamic social media links
  • Author profiles
  • Contact form integration
  • Multiple platform support

πŸ› οΈ Tech Stack

Frontend

Backend & Database

Development Tools

Deployment & Hosting


πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Firebase account and project
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/mithun50/NexGen_Website.git
    cd NexGen_Website
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp .env.example .env

    Edit .env and add your Firebase credentials (see Environment Setup)

  4. Run development server

    npm run dev
  5. Open in browser Navigate to http://localhost:9002

Available Scripts

npm run dev          # Start development server
npm run build        # Build for production
npm start            # Start production server
npm run lint         # Run ESLint
npm run typecheck    # Run TypeScript type checking

βš™οΈ Environment Setup

Create a .env file in the root directory with the following variables:

πŸ”‘ Admin Authentication

ADMIN_PASSWORD=your_secure_admin_password
JWT_SECRET=your_jwt_secret_key_here

Generate JWT Secret:

node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

πŸ”₯ Firebase Configuration

Client-Side (Public - Safe to expose)

NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=your_measurement_id

Server-Side (Private - Keep secure)

FIREBASE_PROJECT_ID=your_project_id
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
FIREBASE_CLIENT_EMAIL=your_service_account@your_project.iam.gserviceaccount.com

Alternative: Use service account JSON

FIREBASE_SERVICE_ACCOUNT_JSON='{"type":"service_account","project_id":"..."}'

πŸ“ Project Structure

NexGen_Website/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                      # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ (pages)/
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx          # Home page
β”‚   β”‚   β”‚   β”œβ”€β”€ about/            # About page
β”‚   β”‚   β”‚   β”œβ”€β”€ apps/             # Apps distribution page
β”‚   β”‚   β”‚   β”œβ”€β”€ contact/          # Contact page
β”‚   β”‚   β”‚   β”œβ”€β”€ socials/          # Social links page
β”‚   β”‚   β”‚   β”œβ”€β”€ youtube/          # Video archives
β”‚   β”‚   β”‚   └── admin/            # Admin panel
β”‚   β”‚   β”œβ”€β”€ api/                  # API Routes
β”‚   β”‚   β”‚   β”œβ”€β”€ apps/             # Apps CRUD operations
β”‚   β”‚   β”‚   β”œβ”€β”€ videos/           # Video management
β”‚   β”‚   β”‚   β”œβ”€β”€ stats/            # Visitor analytics
β”‚   β”‚   β”‚   └── auth/             # Authentication
β”‚   β”‚   β”œβ”€β”€ layout.tsx            # Root layout
β”‚   β”‚   └── globals.css           # Global styles
β”‚   β”œβ”€β”€ components/               # React components
β”‚   β”‚   β”œβ”€β”€ ui/                   # ShadCN UI components
β”‚   β”‚   β”œβ”€β”€ layout/               # Layout components
β”‚   β”‚   β”‚   β”œβ”€β”€ navbar.tsx
β”‚   β”‚   β”‚   └── footer.tsx
β”‚   β”‚   β”œβ”€β”€ auth/                 # Auth components
β”‚   β”‚   └── visitor-tracker.tsx   # Analytics
β”‚   β”œβ”€β”€ lib/                      # Utility libraries
β”‚   β”‚   β”œβ”€β”€ firebase.ts           # Firebase client
β”‚   β”‚   β”œβ”€β”€ firebase-admin.ts     # Firebase admin
β”‚   β”‚   β”œβ”€β”€ auth.ts               # Auth utilities
β”‚   β”‚   └── utils.ts              # Helper functions
β”‚   β”œβ”€β”€ hooks/                    # Custom React hooks
β”‚   └── data/                     # Static data
β”‚       └── content.json          # Site content
β”œβ”€β”€ public/                       # Static assets
β”œβ”€β”€ .env                          # Environment variables
β”œβ”€β”€ next.config.js                # Next.js configuration
β”œβ”€β”€ tailwind.config.ts            # Tailwind configuration
β”œβ”€β”€ tsconfig.json                 # TypeScript configuration
└── package.json                  # Dependencies

πŸ“ Content Management

Static Content (content.json)

Manage site-wide content like channel info, social links, and author details:

{
  "channelInfo": {
    "name": "NextGenXplorer",
    "goal": "Exploring the future of technology",
    "about": "A digital think tank dedicated to..."
  },
  "socials": [
    {
      "name": "YouTube",
      "url": "https://youtube.com/@nextgenxplorer",
      "handle": "@nextgenxplorer"
    }
  ],
  "authors": [
    {
      "name": "Your Name",
      "url": "https://instagram.com/yourhandle",
      "handle": "@yourhandle"
    }
  ]
}

Dynamic Content (Firestore)

Videos Collection

Videos are stored in Firebase Firestore under the videos collection:

Document Structure:

{
  id: string;                    // Auto-generated
  youtubeUrl: string;            // Full YouTube URL
  youtubeId: string;             // Extracted video ID
  title: string;                 // Fetched from YouTube
  description: string;           // Fetched from YouTube
  thumbnailUrl: string;          // Max resolution thumbnail
  relatedLinks: Array<{
    label: string;
    url: string;
  }>;
  isPublic: boolean;             // Visibility flag
  createdAt: Timestamp;          // Creation date
}

Apps Collection

Apps are stored in the apps collection:

Document Structure:

{
  id: string;                    // Auto-generated
  name: string;                  // App name
  description: string;           // App description
  logoUrl: string;               // Logo image URL
  downloadUrl: string;           // Download link
  createdAt: Timestamp;          // Creation date
  updatedAt?: Timestamp;         // Last update
}

Stats Collection

Visitor statistics are stored in stats/visits:

{
  count: number;                 // Total visitor count
}

πŸ” Admin Panel

Access the admin panel at /admin after logging in at /login.

Features

πŸ“Š Dashboard

  • Real-time visitor statistics
  • Quick overview of content

🎬 Video Management

  • Add Videos: Paste YouTube URL, add related links, set visibility
  • Edit Videos: Modify related links and visibility
  • Delete Videos: Remove videos from archive
  • Auto-fetch: Automatically retrieves video metadata

πŸ“± App Management

  • Add Apps: Name, description, logo URL, download URL
  • Edit Apps: Update app information and links
  • Delete Apps: Remove apps from distribution

Authentication Flow

sequenceDiagram
    participant User
    participant Login Page
    participant API
    participant Firebase

    User->>Login Page: Enter password
    Login Page->>API: POST /api/auth/login
    API->>API: Verify password
    API->>User: Set JWT cookie
    User->>Admin Panel: Access /admin
    Admin Panel->>API: Request with cookie
    API->>API: Verify JWT
    API->>Firebase: Fetch data
    Firebase-->>API: Return data
    API-->>Admin Panel: Display data
Loading

πŸ”Œ API Reference

Videos API

GET /api/videos

Fetch videos (public or all for admin)

Response:

[
  {
    "id": "video123",
    "youtubeUrl": "https://youtube.com/watch?v=...",
    "title": "Video Title",
    "thumbnailUrl": "https://...",
    "relatedLinks": [],
    "isPublic": true
  }
]

POST /api/videos

Add new video (admin only)

Request:

{
  "youtubeUrl": "https://youtube.com/watch?v=...",
  "relatedLinks": [{"label": "Link", "url": "https://..."}],
  "isPublic": true
}

DELETE /api/videos

Delete video (admin only)

Request:

{
  "id": "video123"
}

Apps API

GET /api/apps

Fetch all apps (public)

POST /api/apps

Add new app (admin only)

Request:

{
  "name": "My App",
  "description": "App description",
  "logoUrl": "https://...",
  "downloadUrl": "https://..."
}

PUT /api/apps

Update app (admin only)

Request:

{
  "id": "app123",
  "name": "Updated Name",
  "description": "Updated description",
  "logoUrl": "https://...",
  "downloadUrl": "https://..."
}

DELETE /api/apps

Delete app (admin only)

Stats API

GET /api/stats

Get visitor count (admin only)

POST /api/stats

Increment visitor count (public)


🚒 Deployment

Netlify (Recommended)

  1. Connect Repository

    • Link your GitHub repository to Netlify
  2. Configure Build Settings

    [build]
      command = "npm run build"
      publish = ".next"
  3. Set Environment Variables

    • Add all .env variables in Netlify dashboard
  4. Deploy

    • Push to main branch triggers automatic deployment

Vercel Alternative

npm install -g vercel
vercel --prod

🀝 Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Commit your changes
    git commit -m 'Add amazing feature'
  4. Push to branch
    git push origin feature/amazing-feature
  5. Open a Pull Request

Contribution Guidelines

  • Follow TypeScript best practices
  • Maintain existing code style
  • Write meaningful commit messages
  • Test thoroughly before submitting
  • Update documentation as needed

πŸ“Š Architecture Diagrams

Visitor Tracking Flow

sequenceDiagram
    participant Browser
    participant VisitorTracker
    participant API
    participant Firestore

    Browser->>VisitorTracker: Load page
    VisitorTracker->>VisitorTracker: Check session storage
    alt Not counted
        VisitorTracker->>API: POST /api/stats
        API->>Firestore: Increment count
        Firestore-->>API: Success
        API-->>VisitorTracker: { success: true }
        VisitorTracker->>VisitorTracker: Mark as counted
    else Already counted
        VisitorTracker->>VisitorTracker: Skip tracking
    end
Loading

Admin Authentication Flow

sequenceDiagram
    participant Admin
    participant AdminPage
    participant API
    participant verifyAdmin
    participant Firestore

    Admin->>AdminPage: Access /admin
    AdminPage->>API: GET /api/stats
    API->>verifyAdmin: Verify JWT cookie
    alt Authorized
        API->>Firestore: Read stats
        Firestore-->>API: Return data
        API-->>AdminPage: Display data
    else Unauthorized
        API-->>AdminPage: 401 Error
        AdminPage->>AdminPage: Redirect to login
    end
Loading

πŸ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


πŸ™ Acknowledgments


πŸ“ž Support


Made with ❀️ by NextGenXplorer Team

⭐ Star us on GitHub if you find this project useful!

About

NexGen Website

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.6%
  • Other 1.4%