Developer-DAO / DAO-job-board

A job board connecting DAOs with talent.
https://devdao-job-board.vercel.app/
82 stars 34 forks source link

Hook up forms to database #76

Open carlomigueldy opened 2 years ago

carlomigueldy commented 2 years ago

🔍 Overview

While @angeljgomezc is wrapping up the UI for the forms on job posting creation, user profile, gig posting or etc. Thought it'll be good to plan things out here and to give some context on what I can recommend the approach to take to make it easier to contribute into the project. I have already defined types into client/types which y'all can use it however an updated type definitions for it will be created soon, a PR will be ready in a few minutes at the time of writing this.

I suggest that you take 1 form to hook it up to database and that's for a single PR, and let me know if you're working on that so I can mark it in there so we don't duplicate some work

🔱 Hook

I have created a useSupabase hook where it is a wrapper for the Supabase client and it kinda acts like a repository for CRUD operations but feel free to use just the plain Supabase client instead if you prefer it that way or the hook does not allow you to do certain actions.

There's a usage guide written usign jsDoc as per recommendation from @with-heart which you can find here

📃 Forms

Here be list of types that you can use to guide you which attributes are being used.

The created_by attribute should take a value of the wallet address of the currently authenticated user. Details in this PR #64 regarding how authentication is handled using wallet.

Example usage

const jobRepository = useSupabase<Job>('jobs');

async function submit(payload: JobForm) {
  await jobRepository.create<JobForm>(payload)
}

Note: The types mentioned might not be available yet on main branch until this PR #77 is merged in.


💡 Should you have any problems or something is not clear feel free to reach out to me on Discord or comment down below and I'll help clarify things to you or point a direction so it'll be much easier to contribute to this project :)

shindeajinkya commented 2 years ago

will take this up

4gnle commented 2 years ago

Awesome! Let's wait for the Forms to be fully available and ready for the hook-up. Also, we will probably need a re-do of the database models beforehand. SO, let's get that done before we connect anything.

Having said that, there will be two forms to tackle:

  1. /create-profile = all the info developers need to create their profiles.
  2. /post-job = all the info recruiters need to create a job post

Which one will you take?

carlomigueldy commented 2 years ago

Awesome! Let's wait for the Forms to be fully available and ready for the hook-up. Also, we will probably need a re-do of the database models beforehand. SO, let's get that done before we connect anything.

Sounds good, I'm gonna create a PR and update here in this issue for the progress or whenever it's merged

shindeajinkya commented 2 years ago

Awesome! Let's wait for the Forms to be fully available and ready for the hook-up. Also, we will probably need a re-do of the database models beforehand. SO, let's get that done before we connect anything.

Having said that, there will be two forms to tackle:

  1. /create-profile = all the info developers need to create their profiles.
  2. /post-job = all the info recruiters need to create a job post

Which one will you take?

Will go ahead with create-profile one

4gnle commented 2 years ago

Hey @PBillingsby you're working on this, right? Here's a beginner's guide that may help you out: https://supabase.com/docs/guides/with-nextjs