Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

108 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Live App GitHub


📖 Overview

Cognix is a premium, full-stack AI prompt sharing and marketplace platform for prompt engineers, creators, and AI enthusiasts. Users can discover, publish, bookmark, review, and monetize high-quality AI prompts for engines like ChatGPT, Claude, Gemini, and Midjourney — backed by Stripe payments, Better Auth, and MongoDB.

Live athttps://cognix-client.vercel.app


🛠️ Technologies Used

Frontend (client)

Technology Purpose
Next.js 14 (App Router) React framework
React UI library
Tailwind CSS Utility-first styling
Framer Motion Animations
Recharts Admin analytics charts
React Toastify Toast notifications
React Quill New Rich text / Markdown rendering
Stripe React Elements Payment checkout UI
html-to-image + jsPDF PDF export

Backend (server)

Technology Purpose
Node.js Runtime
Express.js HTTP server
MongoDB Database
Better Auth JWT + Google OAuth authentication
Stripe SDK Payment Intents API
express-rate-limit Brute-force protection

✨ Core Features

🔍 Search & Discovery

  • Global Dynamic Search — Real-time search across title, description, AI tool, and categories
  • Category & Engine Filters — Filter by AI engine (ChatGPT, Claude, Gemini, Midjourney) and domain category
  • Difficulty Filter — Beginner / Intermediate / Pro with URL parameter sync
  • Trending Algorithm — MongoDB aggregation combining copies + ratings for ranking
  • Infinite Scroll — Smooth feed browsing without page-based pagination

💸 Creator Earnings & Payout System

  • Dynamic Revenue Share — Creators earn 70% share from prompt copies & sales
  • Multi-Method Payouts — Configure Bank Transfer, PayPal, Wise, bKash, or Nagad details
  • Withdrawal Requests — Submit payout requests directly from Creator Analytics
  • Admin Payout Management — Admins can review, approve ("Mark as Paid"), or reject creator payout requests

🤖 AI Prompt Test Runner

  • Server-side Gemini Proxy — Bypass CORS and test prompts dynamically with any Gemini model (default: gemini-3.5-flash)
  • Dynamic Model Selection — Support for gemini-3.5-flash, gemini-3.5-pro, gemini-2.5-flash, etc.

🛡️ Security & Auth

  • Better Auth — Google OAuth with automatic account linking and JWT-based role control
  • Rate Limiting — Global and per-route brute-force protection
  • Role-Based Access — User, Creator, and Admin roles enforced on client and server
  • Master Admin Protection — Server-side guard prevents master admin deletion

💳 Monetization

  • Pro Builder Subscription — Stripe Elements checkout for premium tier upgrade
  • Transaction Logs — Admin-level paginated Stripe payment history

📊 Dashboards & Analytics

  • User Dashboard — Live stats: Unlocked Prompts, Library, Spend, Activity
  • Admin & Creator Analytics — Real-time DB metrics for users, prompts, copies, reviews, and revenue + 1-click CSV report export
  • Community Moderation — Report queue with Warn Creator, dismiss, and remove actions
  • Creator Follow System — Real database follows collection tracking creator audience

✨ Additional

  • PDF Export — Download prompt details as PDF
  • Prompt Forking — "Copy to Edit" for building on existing prompts
  • Global Error Boundary — Custom error.jsx prevents crashes on bad routing

📦 Dependencies

client/package.json (key deps)

Package Purpose
next, react, react-dom Core framework
better-auth Authentication client
@stripe/react-stripe-js, @stripe/stripe-js Stripe payment UI
recharts Admin charts
framer-motion Animations
react-quill-new Rich text editor
html-to-image, jspdf PDF export
react-toastify Notifications
tailwindcss Styling

server/package.json (key deps)

Package Purpose
express HTTP server
mongoose MongoDB ODM
better-auth Auth engine
stripe Payments
express-rate-limit Brute-force protection
cors, dotenv Cross-origin and env config

🚀 Run Locally

Prerequisites

  • Node.js v20.6 or higher
  • npm v9 or higher
  • MongoDB Atlas account

1 — Clone the repository

git clone https://github.com/iMoloy/cognix.git
cd cognix

2 — Backend Server Setup

cd server
npm install

Create server/.env:

NODE_ENV=development
PORT=5000
CLIENT_ORIGIN=http://localhost:3000
MONGODB_URI=mongodb+srv://<user>:<pass>@cluster.mongodb.net
DB_NAME=cognix_db

BETTER_AUTH_SECRET=your_super_secret_auth_key
BETTER_AUTH_URL=http://localhost:5000
GOOGLE_CLIENT_ID=your_google_oauth_client_id
GOOGLE_CLIENT_SECRET=your_google_oauth_client_secret

STRIPE_SECRET_KEY=your_stripe_secret_key

Start the server:

npm run dev

Runs on http://localhost:5000


3 — Frontend Client Setup

cd ../client
npm install

Create client/.env.local:

NEXT_PUBLIC_API_URL=http://localhost:5000
NEXT_PUBLIC_IMGBB_API_KEY=your_imgbb_api_key
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key

Start the client:

npm run dev

Runs on http://localhost:3000


Available Scripts (root workspace)

Command Description
npm run dev:client Start Next.js frontend
npm run dev:server Start Express backend
npm run build:client Build production frontend

🔗 Resources


Footer Made with ❤️ by Moloy Krishna Paul

About

A full-stack AI prompt marketplace named Cognix. Features prompt discovery, creator dashboards, reviews, payments, Better Auth security, analytics, and a modern Next.js frontend with a Node/Mongo backend.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages