Skip to content

parijin0/CodeDesk

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

111 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

CodeDesk

CodeDesk is a full-stack web application designed to help developers and learners stay organized, track progress, and master coding platforms effectively. It brings together the best resources, educators, and structured question sheets in one clean and interactive interface.

Open Source

๐Ÿ“Š Project Insights

๐ŸŒŸ Stars ๐Ÿด Forks ๐Ÿ› Issues ๐Ÿ”” Open PRs ๐Ÿ”• Closed PRs ๐Ÿ› ๏ธ Languages ๐Ÿ‘ฅ Contributors
Stars Forks Issues Open PRs Closed PRs Languages Count Contributors Count

๐ŸŽฏ Open Source Programmes โญ

This project is now OFFICIALLY accepted for:

๐ŸŒŸ Exciting News...

๐Ÿš€ This project is now an official part of GirlScript Summer of Code โ€“ GSSoC'25! ๐Ÿ’ƒ๐ŸŽ‰๐Ÿ’ป We're thrilled to welcome contributors from all over India and beyond to collaborate, build, and grow. Letโ€™s make learning and career development smarter โ€“ together! ๐ŸŒŸ๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป

๐Ÿ‘ฉโ€๐Ÿ’ป GSSoC is one of Indiaโ€™s largest 3-month-long open-source programs that encourages developers of all levels to contribute to real-world projects ๐ŸŒ while learning, collaborating, and growing together. ๐ŸŒฑ

๐ŸŒˆ With mentorship, community support, and collaborative coding, it's the perfect platform for developers to:

โœจ Improve their skills ๐Ÿค Contribute to impactful projects ๐Ÿ† Get recognized for their work ๐Ÿ“œ Receive certificates and swag!

๐ŸŽ‰ I canโ€™t wait to welcome new contributors from GSSoC 2025 to this CodeDesk project family! Let's build, learn, and grow together โ€” one commit at a time. ๐Ÿ”ฅ๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป

๐Ÿ”ฎ Coming Soon: AI-Powered Performance Tracking! An intelligent system to analyze user activity and visualize progress with interactiveย graphs.

This monorepo contains two workspaces:

Directory Description
backend/ Node.js + Express + SUPABASE REST API boilerplate
client/ React + Vite + Tailwind CSS frontend skeleton

Prerequisites

  • Node.js โ‰ฅ 18
  • SUPABASE account with project name CodeDesk

Getting Started (Backend)

  1. cd backend
  2. Create .env and set at least:
    • SUPABASE_URL
    • SUPABASE_SERVICE_ROLE_KEY
    • optional for local: PORT=5000
  3. npm install
  4. npm run dev โ€“ starts API on http://localhost:5000
  5. Must run these below SQL commands to proper run this project. Good Luck !!

Supabase setup (SQL to run in Supabase SQL Editor)

Run these in order to create and secure user profile storage used by the backend.

  1. User profile table with Row Level Security (RLS)
-- (A) Profile data table
create table if not exists profiles (
  supabase_id uuid primary key,          -- matches auth.users.id
  first_name  text,
  last_name   text,
  bio         text,
  country     text,
  education         jsonb,
  achievements      jsonb,
  work_experience   jsonb,
  platforms         jsonb,
  avatar_url text,
  created_at timestamptz default now()
);

-- (B) Security: allow each user to read / update only their own row
alter table profiles enable row level security;

create policy "profiles owner can select"
  on profiles for select
  using (supabase_id = auth.uid());

create policy "profiles owner can update"
  on profiles for update
  using (supabase_id = auth.uid())
  with check (supabase_id = auth.uid());
  1. Auto create user profiles on signup (basic)
-- Automatically create a blank profile row whenever a user signs up
create or replace function public.handle_new_user()
returns trigger as $$
begin
  -- Insert only if it doesn't exist (defensive)
  insert into profiles (supabase_id)
    values (new.id)
    on conflict (supabase_id) do nothing;
  return new;
end;
$$ language plpgsql security definer;

-- Attach the trigger to auth.users INSERT
drop trigger if exists on_signup on auth.users;

create trigger on_signup
after insert on auth.users
for each row execute procedure public.handle_new_user();
  1. Auto create user profiles on signup (enhanced: split name into first/last)
-- Drop existing trigger and function
drop trigger if exists on_signup on auth.users;
drop function if exists public.handle_new_user();

-- Create updated function
create or replace function public.handle_new_user()
returns trigger as $$
begin
  insert into public.profiles (
    supabase_id,
    first_name,
    last_name,
    created_at
  ) values (
    new.id,
    split_part(new.raw_user_meta_data->>'name', ' ', 1),
    split_part(new.raw_user_meta_data->>'name', ' ', 2),
    now()
  );
  return new;
end;
$$ language plpgsql security definer;

-- Recreate trigger
create trigger on_signup
  after insert on auth.users
  for each row execute procedure public.handle_new_user();
  1. Recreate profiles table and policies (if needed)
-- Drop existing table and recreate with correct structure
drop table if exists public.profiles;

create table public.profiles (
  supabase_id uuid primary key references auth.users(id),
  first_name text,
  last_name text,
  bio text,
  country text,
  education jsonb default '[]'::jsonb,
  achievements jsonb default '[]'::jsonb,
  work_experience jsonb default '[]'::jsonb,
  platforms jsonb default '{}'::jsonb,
  avatar_url text,
  created_at timestamptz default now()
);

-- Set up RLS policies
alter table profiles enable row level security;

create policy "Public profiles are viewable by everyone."
  on profiles for select
  using ( true );

create policy "Users can insert their own profile."
  on profiles for insert
  with check ( auth.uid() = supabase_id );

create policy "Users can update own profile."
  on profiles for update
  using ( auth.uid() = supabase_id );
  1. Create table for workspace simply run this query in SQL editor
-- Create the table for sheets (if it doesn't exist)
CREATE TABLE IF NOT EXISTS public.sheets (
  id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
  title TEXT NOT NULL,
  description TEXT,
  created_by UUID REFERENCES auth.users(id),
  created_at TIMESTAMPTZ DEFAULT NOW() NOT NULL
);

-- Create the table for notes
CREATE TABLE public.notes (
  id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
  user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE NOT NULL,
  content TEXT,
  created_at TIMESTAMPTZ DEFAULT NOW() NOT NULL,
  updated_at TIMESTAMPTZ DEFAULT NOW() NOT NULL
);

-- Security: Enable Row Level Security (RLS) for notes
ALTER TABLE public.notes ENABLE ROW LEVEL SECURITY;

-- Security: Define policies so users can only access their own notes
CREATE POLICY "Users can manage their own notes."
  ON public.notes FOR ALL
  USING ( auth.uid() = user_id )
  WITH CHECK ( auth.uid() = user_id );

-- Create a join table for saved sheets
CREATE TABLE public.user_saved_sheets (
  user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE NOT NULL,
  sheet_id UUID REFERENCES public.sheets(id) ON DELETE CASCADE NOT NULL,
  saved_at TIMESTAMPTZ DEFAULT NOW() NOT NULL,
  PRIMARY KEY (user_id, sheet_id)
);

-- Security: Enable RLS for the join table
ALTER TABLE public.user_saved_sheets ENABLE ROW LEVEL SECURITY;

-- Security: Define policies for the join table
CREATE POLICY "Users can manage their own saved sheets."
  ON public.user_saved_sheets FOR ALL
  USING ( auth.uid() = user_id )
  WITH CHECK ( auth.uid() = user_id );

Getting Started (Frontend)

  1. cd client
  2. make .env file with VITE_SUPABASE_URL & VITE_SUPABASE_ANON_KEY & VITE_API_URL=http://localhost:3000
  3. npm install
  4. npm run dev โ€“ opens Vite dev server on http://localhost:3000

๐Ÿ™Œ Thank You, Contributors!

Thanks to these amazing people who have contributed to the CodeDesk project:

We love our contributors! If you'd like to help, please check out our CONTRIBUTE.md file for guidelines.

Show some Red Heart by starring this awesome repository!

๐Ÿ“ฌ Contact

For questions, suggestions, or collaboration, reach out via LinkedIn or open an issue!

๐Ÿ’ก Suggestions & Feedback

Feel free to open issues or discussions if you have any feedback, feature suggestions, or want to collaborate!

๐Ÿ“„ License

This project is licensed under the MIT License.

Glowing Star Give us a Star and let's make magic! Glowing Star

Project Admin:

Vipul Agarwal
Vipul Agarwal

๐Ÿ‘จโ€๐Ÿ’ป Developed By โค๏ธVipul Agarwal and contributorsโค๏ธ GitHub | LinkedIn

๐Ÿ” Back to Top

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 99.9%
  • Other 0.1%