Skip to content

feat: add profile social fields, PATCH endpoint, and Stellar address validation - #91

Merged
OlaGreat merged 1 commit into
OlaGreat:mainfrom
playground-ogazboiz:feat/profile-social-fields
Mar 26, 2026
Merged

feat: add profile social fields, PATCH endpoint, and Stellar address validation#91
OlaGreat merged 1 commit into
OlaGreat:mainfrom
playground-ogazboiz:feat/profile-social-fields

Conversation

@ogazboiz

Copy link
Copy Markdown
Contributor

Summary

Schema Migration (#75)

  • Add email (unique), websiteUrl, twitterHandle, githubHandle to Profile model
  • Migration: 20260326000000_add_profile_social_fields

Seed Data (#76)

  • Update seed with demo social field values for stellar-dev profile

PATCH /profiles/:username (#78)

  • Accept displayName, bio, avatarUrl, email, websiteUrl, twitterHandle, githubHandle
  • Fields can be set to null to clear them
  • Zod validation: email format, https URL, Twitter handle (max 15, alphanumeric+underscore), GitHub handle (max 39, alphanumeric+hyphen)

Stellar Address Validation (#79)

  • Use StrKey.isValidEd25519PublicKey() from @stellar/stellar-sdk for full checksum validation
  • Applied to both POST /profiles and wallet address inputs
  • Rejects addresses that pass regex but have invalid checksum

5 new tests covering PATCH update, nullable fields, invalid formats, bad checksum rejection, and 404.

Closes #75
Closes #76
Closes #78
Closes #79

Test plan

  • npm run build — TypeScript compiles cleanly
  • CI: npm run db:migrate:deploy applies migration
  • CI: npm run test — all tests pass (existing + 5 new)
  • PATCH updates social fields and clears nullable ones
  • POST rejects invalid Stellar address checksum

…validation

Schema migration (OlaGreat#75):
- Add email (unique), websiteUrl, twitterHandle, githubHandle to Profile
- Migration: 20260326000000_add_profile_social_fields

Seed data (OlaGreat#76):
- Update seed with demo social field values

PATCH endpoint (OlaGreat#78):
- PATCH /profiles/:username accepts displayName, bio, avatarUrl,
  email, websiteUrl, twitterHandle, githubHandle
- Fields nullable (set to null to clear), validated with Zod
- Returns 400 for invalid formats, 404 for missing profile

Stellar address validation (OlaGreat#79):
- Use StrKey.isValidEd25519PublicKey for full checksum validation
- Applied to both POST /profiles and PATCH /profiles/:username
- Rejects addresses that pass regex but have invalid checksum

5 new tests added for PATCH, validation, and edge cases.

Closes OlaGreat#75
Closes OlaGreat#76
Closes OlaGreat#78
Closes OlaGreat#79
@vercel

vercel Bot commented Mar 26, 2026

Copy link
Copy Markdown

@ogazboiz is attempting to deploy a commit to the olamilekan's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Mar 26, 2026

Copy link
Copy Markdown

@ogazboiz Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Mar 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nova-support Ready Ready Preview, Comment Mar 26, 2026 3:37pm

@OlaGreat
OlaGreat merged commit 0287636 into OlaGreat:main Mar 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants