Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supabase and leetcode api #30

Merged
merged 7 commits into from
Jan 8, 2025

Conversation

momo-shogun
Copy link
Contributor

@momo-shogun momo-shogun commented Jan 8, 2025

Pull Request Template

Summary

This pull request introduces a signup form with integration for Supabase authentication and LeetCode stats fetching. The changes include implementing form validation, user registration, and storing additional user data (such as gender and LeetCode username) in a Supabase table. The code also ensures seamless user navigation to a dashboard post-registration.

Fixes # (issue) #5

Type of Change

Please mark [X] for applicable items:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Other (please describe):

Changes in Detail

  1. Signup Form:

    • Added a form with fields for name, email, password, LeetCode username, and gender.
    • Integrated @/components/ui components for styling and functionality.
  2. Supabase Integration:

    • Added Supabase auth.signUp logic to handle user registration.
    • Inserted additional user details (gender, name, LeetCode statistics) into the user_info table.
  3. LeetCode Stats Fetching:

    • Implemented a helper function (fetchLeetCodeStats) that fetches user data from the LeetCode API using Axios.
    • Stored stats such as ranking and problems solved in different categories (easy, medium, hard).
  4. Error Handling:

    • Displayed user-friendly error messages for API errors or validation failures.
  5. Routing:

    • Redirected users to the /dashboard route upon successful signup.
  6. Testing:

    • Tested the signup form validation.
    • Verified Supabase authentication and user information insertion.
    • Confirmed the accuracy of LeetCode API integration and data handling.

Testing

The following tests were performed:

  • Verified signup functionality with valid and invalid form inputs.
  • Tested API calls to the LeetCode and Supabase endpoints.
  • Ensured proper error handling for failed API responses.
  • Simulated multiple scenarios, including:
    • Missing or invalid LeetCode usernames.
    • Incorrect email/password formats.
    • Database insert errors.

Screenshots/Videos

Please attach relevant screenshots or videos demonstrating the changes.
demo video - https://drive.google.com/file/d/16Wz-tMQwp0Af94WvhZB6lCq1aFEt-Wqt/view?usp=sharing

Checklist

Please mark [X] for completed items:

  • My code follows the project's style guidelines.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation accordingly.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.

Additional Notes

  • Ensure that the /api/leetcode endpoint is properly deployed and returns the expected JSON structure.
  • The email redirect link (http://localhost:3000/dashboard) should be updated to the production URL before deployment.

Copy link

vercel bot commented Jan 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
leetcode-journal ❌ Failed (Inspect) Jan 8, 2025 3:05am

Copy link

github-actions bot commented Jan 8, 2025

Welcome, new contributor!

   Please make sure you've read our [Contributing Guide](README.md) and we look forward to reviewing your Pull request shortly ✨

Copy link

github-actions bot commented Jan 8, 2025

Welcome, new contributor!

   Please make sure you've read our [Contributing Guide](README.md) and we look forward to reviewing your Pull request shortly ✨

Copy link

github-actions bot commented Jan 8, 2025

Welcome, new contributor!

   Please make sure you've read our [Contributing Guide](README.md) and we look forward to reviewing your Pull request shortly ✨

Copy link

github-actions bot commented Jan 8, 2025

Welcome, new contributor!

   Please make sure you've read our [Contributing Guide](README.md) and we look forward to reviewing your Pull request shortly ✨

@momo-shogun
Copy link
Contributor Author

@yashksaini-coder need help with failing deployment

@yashksaini-coder
Copy link
Owner

okh let me check @momo-shogun

Copy link
Owner

@yashksaini-coder yashksaini-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supabase setup is proper, but the major problem is in the error handling part. that is throwing the errors. Although the supabase client setup is complete so the PR will be merged have you applied as a contributor on OS lead platform @momo-shogun

@yashksaini-coder yashksaini-coder merged commit a838750 into yashksaini-coder:main Jan 8, 2025
3 of 4 checks passed
@yashksaini-coder yashksaini-coder added SWOC officially part of SWOC season 5 Intermediate SWOC Level 2 issue Points Assigned The points have been assigned on OS Lead labels Jan 8, 2025
@momo-shogun
Copy link
Contributor Author

Yup I have applied and I also selected this project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Intermediate SWOC Level 2 issue Points Assigned The points have been assigned on OS Lead SWOC officially part of SWOC season 5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants