πŸš€ InternEdge β€” One Platform Endless Internships.

Aditya GaikwadAditya Gaikwad
3 min read
  • πŸ”₯ Seamless Supabase + Clerk Integration for Authentication- Backed Data Management

    🧠 Introduction

    InternEdge is a full-featured web application I built to deeply explore how Supabase β€” the open-source Firebase alternative β€” works in production environments, especially when integrated with Clerk for modern authentication. spin up Supabase, create a table, call an API β€” and you're done. But in real-world apps, authentication and access control (Row Level Security, RLS), and custom roles are crucial. That's why InternEdge was created.

    But beyond tech exploration, InternEdge was also built with a purpose:
    To solve the struggle of finding and managing internships, both for students and companies.


    ✨ Features

    Here’s what you can expect from internedge:

  • πŸ” Authentication with Clerk

  • πŸ§‘β€πŸŽ“ Students can explore, search, and apply for internships

  • 🏒 Companies can post, update, and manage internship listings

  • βœ‰οΈ Applications handled and stored securely with Supabase

  • πŸ›‘οΈ Row Level Security (RLS) to protect and isolate user data

  • βš™οΈ Role-based Access Control using Supabase Policies

  • 🎨 Minimal, clean UI for both applicant and recruiter sides

  • 🌐 Fully client-rendered with Vite and modern web tools


    πŸ› οΈ Tech Stack

    | Layer | Technology | | --- | --- | | Frontend | React, Shadcn Ui, Zod | | Auth | Clerk | | Backend DB | Node, Supabase | | Styling | Tailwind CSS | | Hosting | Vercel |


    πŸ§ͺ Why I Built This

    While building side projects, I realized I needed:

    1. A simple auth flow that works with third-party login and JWT access.

    2. A PostgreSQL backend with real-time capabilities.

    3. A playground to test Supabase RLS with actual auth claims from Clerk.

So I combined them and created internedge.

It helped me learn:

  • How to sync Clerk users to Supabase

  • How Supabase treats authenticated users

  • Setting up RLS policies from scratch

  • Managing JWT templates in Supabase

  • Connecting Vite with secure .env variables


πŸ“ Project Structure

    InternEdge/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ components/
    β”‚   β”œβ”€β”€ pages/
    β”‚   β”œβ”€β”€ utils/
    β”œβ”€β”€ .env
    β”œβ”€β”€ index.html
    β”œβ”€β”€ package.json
    β”œβ”€β”€ vite.config.js

βš™οΈ How to Install Locally

    git clone https://github.com/adiitxa/InternEdge.git
    cd internedge
    npm install
    npm run dev

🌍 Environment Variables

Create a .env file at the root of your project with the following:

    VITE_SUPABASE_URL=your_supabase_url
    VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
    VITE_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key

⚠️ Note: Never share your Supabase service_role key publicly. Only use anon for frontend.


πŸ” Clerk + Supabase Integration

Connecting Clerk with Supabase allows us to enforce RLS policies using the identity of the logged-in user.

Go to Clerk β†’ JWT Templates β†’ Add Template:

    InternEdge: supabase
    Template: 
    {
      "sub": "{{user.id}}",
      "email": "{{user.email_address}}"
    }

This lets Supabase extract the user's ID and email from Clerk's token.

  1. Enable RLS in Supabase

In Supabase:

  • Create tables like users, applications, internships

  • Turn on Row Level Security

  • Add policies like:

    sqlCopyEdit-- Allow authenticated users to read their own data
    CREATE POLICY "Users can view their own records"
      ON users
      FOR SELECT
      USING (auth.uid() = id);
  1. Configure Supabase to validate Clerk tokens

In Supabase settings β†’ Auth β†’ JWT:

  • Set JWT secret to your Clerk JWT secret

  • Update the JWT audience to authenticated

πŸ“˜ Supabase Docs - JWT Auth

πŸ“˜ Clerk Docs - Supabase Integration


πŸ§ͺ Testing the Flow

  • Sign in using Clerk’s UI (Google/Email/etc.)

  • Supabase should recognize the session via the JWT

  • Supabase policies will enforce access only for the logged-in user's data


🧡 Wrapping Up

This project gave me deep insights into:

  • Authentication flows using Clerk

  • Database-level access control with Supabase

  • Combining frontend security with backend logic


πŸ‘‰ GitHub Repo: https://github.com/adiitxa/InternEdge

0
Subscribe to my newsletter

Read articles from Aditya Gaikwad directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Aditya Gaikwad
Aditya Gaikwad