Skip to content

Latest commit

 

History

History
246 lines (203 loc) · 8.82 KB

LEARN.md

File metadata and controls

246 lines (203 loc) · 8.82 KB

NexMeet Project Setup

Kinde Auth Setup :

  • YT Video For Setup Kinde Kinde Auth Setup Video
  • Make Sure To Add Github, Facebook And Google Outh2.0 In Kinde

Make .env.local And Add Required Keys

KINDE_CLIENT_ID=<change this>
KINDE_CLIENT_SECRET=<change this>
KINDE_ISSUER_URL=<change this>
KINDE_SITE_URL=http://localhost:3000
KINDE_POST_LOGOUT_REDIRECT_URL=http://localhost:3000
KINDE_POST_LOGIN_REDIRECT_URL=http://localhost:3000/dashboard

Congrats! You Successfully Setup Kinde Auth

Set Up Your Database :

  • Go to Your Supabase Dashboard.
  • YT Video For Setup Supabase Supabase DB Setup
  • Select Your Project / Create A New One.
  • Navigate To The Project Settings In The Sidebar Of Your Newly Created Project.
  • Now Go To API Under CONFIGURATION Section.
  • Copy The URL And ANON-PUBLIC From This Tab And Paste In Your .env.local File Respectively.

Add Required Keys

NEXT_PUBLIC_SUPABASE_PASSWORD=
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=

NEXT_PUBLIC_BASE_URL=http://localhost:3000

Make Tables :

  • Go To Your Supabase Dashboard.
  • Select Your Project.
  • Navigate To The SQL Editor Tab In The Sidebar. SQL QUERY
  • Run The Following SQL Query:

Table For Event Details :

create table
  public.event_details (
    id uuid not null default gen_random_uuid (),
    created_at timestamp with time zone not null default now(),
    event_title text not null,
    event_description text not null,
    event_location text not null,
    event_registration_startdate timestamp with time zone not null,
    event_registration_enddate timestamp with time zone not null,
    team_size smallint not null default '1'::smallint,
    event_enddate timestamp with time zone not null,
    event_price text null default 'Free'::text,
    event_likes bigint null default '0'::bigint,
    event_formlink text not null,
    organizer_name text not null,
    organizer_email text not null,
    organizer_contact bigint not null,
    event_category text not null,
    event_tags text[] not null,
    event_social_links text[] not null,
    event_duration bigint not null,
    event_startdate timestamp with time zone not null,
    updated_at timestamp with time zone null default (now() at time zone 'utc'::text),
    constraint event_details_pkey primary key (id),
    constraint event_details_created_at_key unique (created_at),
    constraint event_details_event_title_key unique (event_title)
  ) tablespace pg_default;

Make Storage :

  • Navigate To The Storage In The Sidebar Of Your Newly Created Project.

  • Now Go To New Bucket And Create A Public Buckets Named event_image And event_space. STORAGE SETUP NEW BUCKET

  • Then Under The Buckets We Have CONFIGURATION Select Policies Make New Policy With For Full Customization For event_images And event_space With all Permissions. BUCKET POLICIES

Table For Event Images :

create table
  public.event_images (
    id uuid not null default gen_random_uuid (),
    created_at timestamp with time zone not null default now(),
    url text not null,
    event_id uuid not null,
    constraint event_images_pkey primary key (id),
    constraint event_images_event_id_fkey foreign key (event_id) references event_details (id)
  ) tablespace pg_default;

Table For Event comments :

create table public.comments (
    id uuid not null default gen_random_uuid (),
    created_at timestamp with time zone not null default now(),
    event_id uuid not null references public.event_details(id) on delete cascade,
    author text not null,
    text text not null,
    timestamp timestamp with time zone not null default now(),
    constraint comments_pkey primary key (id)
) tablespace pg_default;

Table For Event Participants :

create table
  public.event_participants (
    id uuid not null default gen_random_uuid (),
    created_at timestamp with time zone not null default now(),
    participant_name text not null,
    participant_email text not null,
    participant_contact bigint not null,
    event_id uuid not null,
    is_registered boolean null default false,
    is_approved boolean null,
    constraint event_participants_pkey primary key (id),
    constraint event_participants_event_id_fkey foreign key (event_id) references event_details (id)
  ) tablespace pg_default;

Table For Event Space :

create table
  public.event_space (
    id uuid not null default gen_random_uuid (),
    created_at timestamp with time zone not null default now(),
    name text not null,
    description text not null,
    location text not null,
    capacity bigint not null,
    price_per_hour bigint not null,
    owner_email character varying not null,
    updated_at timestamp with time zone null default (now() at time zone 'utc'::text),
    owner_contact bigint not null,
    availability boolean null default true,
    amenities text[] not null,
    space_likes bigint null default '0'::bigint,
    constraint event_space_pkey primary key (id),
    constraint event_space_name_key unique (name)
  ) tablespace pg_default;

Table For Event Space Img Vid :

create table
  public.event_space_img_vid (
    id uuid not null default gen_random_uuid (),
    created_at timestamp with time zone not null default now(),
    url text not null,
    event_space_id uuid not null,
    constraint event_space_img_vid_pkey primary key (id),
    constraint event_space_img_vid_event_space_id_fkey foreign key (event_space_id) references event_space (id)
  ) tablespace pg_default;

Table For Event Space Request :

create table
  public.event_space_request (
    id uuid not null default gen_random_uuid (),
    created_at timestamp with time zone not null default now(),
    organiser_id text not null,
    space_id uuid not null,
    request_date timestamp with time zone not null,
    status character varying not null default 'pending'::character varying,
    constraint event_space_request_pkey primary key (id),
    constraint event_space_request_space_id_fkey foreign key (space_id) references event_space (id)
  ) tablespace pg_default;

Table For Event Feedback Form:

CREATE TABLE public.event_feedback (
id uuid NOT NULL DEFAULT gen_random_uuid(),
event_id uuid NOT NULL REFERENCES public.event_details(id) ON DELETE CASCADE,
respondent_email TEXT NOT NULL,
enjoy_most TEXT NOT NULL,
organization_rating TEXT NOT NULL,
overall_satisfaction SMALLINT NOT NULL,
recommendation SMALLINT NOT NULL,
improvement TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
CONSTRAINT event_feedback_pkey PRIMARY KEY (id)
);

Table For Contact Submissions :

create table
  public.contact_submissions (
    id bigint generated by default as identity not null,
    created_at timestamp with time zone not null default now(),
    name text null,
    email text null,
    message text null,
    constraint contact_submissions_pkey primary key (id)
  ) tablespace pg_default;

Table for Checking event likes :

CREATE TABLE check_event_likes (
    eventId TEXT NOT NULL,
    userEmail TEXT NOT NULL,
    PRIMARY KEY (eventId, userEmail)
);
  • This Will Create A Table Named event_details, event_images, event_participants, event_space, event_space_img_vid, event_space_request,contact_submissions check_event_likes and all.

  • Navigate To The Authentication Tab In The Sidebar. TABLE POILICY

  • Now Go To Policies Under CONFIGURATION Section.

  • Create Policy for event_details, event_images, event_participants, event_space, event_space_img_vid, event_space_request, and contact_submissions check_event_likes With all Permissions.

Congrats! You Successfully Setup Your Database

Learn Whole Supabase (Optional) YT Platlist

⭐️ Support The Project!

If You Find This Project Helpful, Please Consider Giving It A Star On GitHub! Your Support Helps To Grow The Project And Reach More Contributors.