Skip to content

Gyanthakur/Flip-Earn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

115 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlipEarn 🚀

Buy & sell social profiles — a full‑stack marketplace built with React, Tailwind, Clerk authentication, Prisma (Neon), ImageKit, Stripe, Nodemailer, Inngest, and more. A marketplace for buying and selling social profiles (Instagram, YouTube, TikTok, etc.) built with modern web technologies.

Flipearn flipearnbygyan1

🚀 FlipEarn

Vercel React Vite TailwindCSS Node Express Postgres Prisma Stripe Auth License



📸 Screenshots

🌐 User Interface

Hero Section Latest Listings
Hero Latest Listing
Plans Marketplace
Plans Marketplace
Messages My Listings
Messages My Listings
Listing Details My Orders
Listing Details My Orders
Footer
Footer

🛠️ Admin Panel

Admin Dashboard Verify Credentials
Admin Dashboard Verify Credentials
All Listings Admin Footer
All Listings Admin Footer
Footer

Table of Contents


About

FlipEarn is a full-stack marketplace platform that enables users to buy and sell social media profiles with secure authentication, payment processing, and admin verification. The application features a responsive frontend built with React and a robust backend powered by Express.js.


Key Features

  • Responsive UI with TailwindCSS
  • User Authentication via Clerk
  • Listings CRUD with media upload (create, edit, delete)
  • Advanced Filters sidebar (sticky, mobile modal)
  • Admin Dashboard for verification, credential changes, and transactions
  • Secure Payments via Stripe integration
  • Email Notifications using Nodemailer
  • Image Management through ImageKit
  • Background Tasks with Inngest
  • Real-time Features using WebSocket
  • Search & Filters for marketplace discovery

Tech Stack

Frontend

  • React 19 (Vite)
  • Tailwind CSS for styling
  • React Router DOM for routing
  • Redux Toolkit for state management
  • Clerk for authentication
  • Axios for API requests
  • react-toastify & react-hot-toast for notifications
  • lucide-react for icons

Backend

  • Node.js + Express server
  • Prisma ORM with PostgreSQL
  • Neon serverless PostgreSQL adapter
  • ImageKit for image uploads
  • Stripe for payments
  • Nodemailer for email notifications
  • Inngest for serverless background tasks
  • Multer for multipart form handling
  • WebSocket (ws) for real-time chat

Project Structure

FlipEarn/
├── client/
│   ├── public/
│   ├── src/
│   │   ├── app/
│   │   ├── assets/
│   │   ├── components/
│   │   │   ├── admin/
│   │   │   │   ├── AdminFooter.jsx
│   │   │   │   ├── AdminNavbar.jsx
│   │   │   │   ├── AdminSidebar.jsx
│   │   │   │   ├── AdminTitle.jsx
│   │   │   │   ├── CredentialChangeModal.jsx
│   │   │   │   ├── CredentialVerifyModal.jsx
│   │   │   │   ├── ListingDetailsModal.jsx
│   │   │   │   └── WithdrawalDetail.jsx
│   │   │   ├── ChatBox.jsx
│   │   │   ├── CredentialSubmission.jsx
│   │   │   ├── CTA.jsx
│   │   │   ├── FilterSidebar.jsx
│   │   │   ├── Footer.jsx
│   │   │   ├── Hero.jsx
│   │   │   ├── LatestListing.jsx
│   │   │   ├── ListingCard.jsx
│   │   │   ├── Logger.jsx
│   │   │   ├── Navbar.jsx
│   │   │   ├── Plans.jsx
│   │   │   ├── Projects.jsx
│   │   │   ├── StatCard.jsx
│   │   │   ├── Title.jsx
│   │   │   └── WithdrawModal.jsx
│   │   ├── configs/
│   │   ├── pages/
│   │   │   ├── admin/
│   │   │   │   ├── AllListings.jsx
│   │   │   │   ├── CredentialChange.jsx
│   │   │   │   ├── CredentialVerify.jsx
│   │   │   │   ├── Dashboard.jsx
│   │   │   │   ├── Layout.jsx
│   │   │   │   ├── Transactions.jsx
│   │   │   │   └── Withdrawal.jsx
│   │   │   ├── Home.jsx
│   │   │   ├── ListingDetails.jsx
│   │   │   ├── Loading.jsx
│   │   │   ├── ManageListing.jsx
│   │   │   ├── MarketPlace.jsx
│   │   │   ├── Messages.jsx
│   │   │   ├── MyListings.jsx
│   │   │   └── MyOrders.jsx
│   │   ├── App.jsx
│   │   ├── main.jsx
│   │   └── index.css
│   ├── .env
│   ├── package.json
│   └── vite.config.js
│
├── server/
│   ├── configs/
│   │   ├── imageKit.js
│   │   ├── multer.js
│   │   └── nodemailer.js
│   ├── controllers/
│   │   ├── adminController.js
│   │   ├── chatController.js
│   │   ├── listingController.js
│   │   └── stripeWebhook.js
│   ├── middlewares/
│   │   └── authMiddleware.js
│   ├── prisma/
│   │   └── schema.prisma
│   ├── routes/
│   │   ├── adminRoutes.js
│   │   ├── chatRoutes.js
│   │   └── listingRoutes.js
│   ├── server.js
│   ├── .env
│   └── package.json
│
└── README.md

Prerequisites

Before you begin, ensure you have the following installed and set up:

  • Node.js v18 or higher
  • npm or yarn package manager
  • Git for version control
  • Neon/PostgreSQL database account
  • Clerk account (authentication)
  • ImageKit account (image uploads)
  • Stripe account (payment processing)
  • SMTP credentials (for sending emails via Nodemailer or SendGrid)

Local Setup

Step 1: Clone the Repository

git clone https://github.com/Gyanthakur/Flip-Earn.git
cd Flip-Earn

Step 2: Frontend (Client) Setup

# Navigate to client directory
cd client

# Install dependencies
npm install

# Create .env file in client directory
### Add environment variables
.env  

# Start development server
npm run dev
  • The frontend will run on http://localhost:5173 by default.

Step 3: Backend (Server) Setup

# Navigate to server directory (from project root)
cd server

# Install dependencies
npm install

# Create .env file in server directory
# Add environment variables (see Environment Variables section)
nano .env  # or use your preferred editor

# Generate Prisma client
npx prisma generate

#push in database
npx prisma db push

# Start development server
npm run server

# Or start production server
npm start

The backend will run on the port specified in your .env file (default: 8000).

Step 4: Verify Setup

Open your browser and navigate to:


Environment Variables

Client (.env)

Create a .env file in the client/ directory:

VITE_BASE_URL=http://localhost:5000
VITE_CLERK_PUBLISHABLE_KEY=pk_xxx
VITE_IMAGEKIT_URL=https://ik.imagekit.io/your_id/
....... and many more variable

Note: Replace placeholder values with your actual credentials.

Server (.env)

Create a .env file in the server/ directory:

# Server Configuration
PORT=5000
NODE_ENV=development
FRONTEND_URL=http://localhost:5173

....... and many more variable

Important: Never commit .env files to version control. Add them to .gitignore.


Deployment

Frontend (Vercel - Recommended)

  1. Push code to GitHub
  2. Connect repository to Vercel
  3. Set environment variables in Vercel dashboard:
    • VITE_BACKEND_URL
    • VITE_ADMIN_EMAIL
    • VITE_CLERK_PUBLISHABLE_KEY
    • VITE_IMAGEKIT_URL
  4. Deploy with build command: npm run build
  5. Output directory: dist

Backend (Vercel/Render/Railway/Fly)

  1. Set all server environment variables in your deployment provider
  2. Ensure DATABASE_URL points to your production Neon database
  3. Run migrations before/after deployment:
npx prisma migrate deploy
  1. Deploy using your provider's CLI or dashboard

For Vercel Serverless:

  • Ensure webhooks (Stripe, etc.) are reachable
  • Consider using persistent hosting for background tasks

Database (Neon)

  1. Create a Neon project at https://console.neon.tech
  2. Get production DATABASE_URL
  3. Add to your backend deployment environment variables
  4. Run migrations in production

API Routes Overview

Base Routes

app.use("/api/inngest", serve({ client: inngest, functions }));
app.use("/api/listing", listingRouter);
app.use("/api/chat", chatRouter);
app.use("/api/admin", adminRouter);

Admin Routes (/api/admin)

GET   /isAdmin                         - Check admin status
GET   /dashboard                       - Get admin dashboard stats
GET   /all-listings                    - Get all listings (admin)
PUT   /change-status/:listingId        - Change listing status
GET   /unverified-listings             - Get unverified listings
GET   /credential/:listingId           - Get listing credentials
PUT   /verify-credential/:listingId    - Verify credentials
GET   /unchanged-listings              - Get unchanged listings
PUT   /change-credential/:listingId    - Update credentials
GET   /transactions                    - Get all transactions
GET   /withdrawl-requests              - Get withdrawal requests
PUT   /withdrawl-mark/:id              - Mark withdrawal as paid

Chat Routes (/api/chat)

POST /                - Create / get chat
GET  /user            - Get all user chats
POST /send-message    - Send a chat message

Listing Routes (/api/listing)

POST   /                          - Add new listing
PUT    /                          - Update listing
GET    /public                    - Get all public listings
GET    /user                      - Get user listings
PUT    /:id/status                - Toggle listing status
DELETE /:listingId                - Delete user listing
POST   /add-credential            - Add credentials
PUT    /featured/:id              - Mark listing as featured
GET    /user-orders               - Get user orders
POST   /withdraw                  - Withdraw amount
GET    /purchase-account/:listingId - Purchase account

Note: All protected routes require authentication middleware. Admin routes additionally require admin authorization.


Development Tips

  1. State Management: Use Redux for global state instead of local component state
  2. Security: Always validate admin permissions on backend, never trust frontend-only checks
  3. Images: Validate file sizes on both client and server
  4. Local Webhooks: Use stripe listen or ngrok to test Stripe webhooks locally:
stripe listen --forward-to localhost:5000/webhook
  1. Environment Variables: Keep .env files out of version control
  2. Database: Always run migrations after schema changes
  3. Linting: Run npm run lint before committing

Troubleshooting

Listings Not Showing

  • Verify backend server is running
  • Check VITE_BACKEND_URL in client .env
  • Inspect browser console and Network tab
  • Ensure CORS is properly configured

Authentication Issues

  • Verify Clerk API keys are correct
  • Check Clerk dashboard for allowed domains
  • Ensure Clerk middleware is properly installed

Database Errors

# Regenerate Prisma client
npx prisma generate

# Check DATABASE_URL format
# Verify database connection
npx prisma db push

Stripe Webhooks Not Firing

# For local development
stripe listen --forward-to localhost:8000/webhook

# Copy webhook signing secret to .env
STRIPE_WEBHOOK_SECRET=whsec_...

Port Already in Use

# Kill process on port (e.g., 8000)
lsof -ti:5000 | xargs kill -9  # macOS/Linux
netstat -ano | findstr :8000   # Windows

License

MIT © Gyan Pratap Singh


🎯 Contributors

👤 Gyan Pratap SinghDeveloper & Maintainer
📧 Contact: [email protected]
🔗 GitHub: @gyanthakur

🤝 Connect With Me

Typing


Thank you for checking out the Flip Earn project! Happy coding! 😊


⭐ Support

Give a ⭐ if you like this project!


Made with ❤️ by Gyan Pratap Singh

⭐ Show Some Love!

If you like this project, don't forget to leave a ⭐ Star on GitHub! 🚀

flipearnbygyan1 gps

About

Buy & sell social profiles — a full‑stack marketplace built with React, Tailwind, Clerk authentication, Prisma (Neon), ImageKit, Stripe, Nodemailer, Inngest, and more. A marketplace for buying and selling social profiles (Instagram, YouTube, TikTok, etc.) built with modern web technologies.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages