feat(profile): add profile page and transaction history closes #22 - #48
Merged
dark-sarge merged 2 commits intoAug 11, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request — User Profile & Transaction History (Closes #22)
Summary
Adds a
/profilepage for authenticated users showing account metadata and a filterable, paginated transaction history. Includes two new server endpoints (GET /api/profileandGET /api/profile/trades) and a new frontend route.Changes
Server
server/src/routes/profile.tsserver/src/index.ts/api/profilerouterserver/src/types/trade.tsbuyer_idandescrow_tx_hashfields that were present in DB but missing from the typeFrontend
frontend/app/profile/layout.tsxThemeTogglefrontend/app/profile/page.tsxAPI
GET /api/profileAuth required. Returns the user's masked phone, registration date, completed trade count, and Stellar public key.
{ "data": { "id": "uuid", "maskedPhone": "+234 *** *** 5678", "createdAt": "2025-01-15T10:00:00Z", "totalTradesCompleted": 4, "stellarPublicKey": "GABCD..." } }GET /api/profile/tradesAuth required. Returns the user's trade history (as seller or buyer).
Query params:
page— 1-based (default1)limit— items per page (default10, max50)status—All|Active|Locked|Completed|Cancelled(defaultAll){ "data": [ ...TradeOffer[] ], "pagination": { "page": 1, "limit": 10, "total": 23, "totalPages": 3 } }Frontend Features
Auth guard
useEffecton mount — redirects to/auth/signup?returnTo=/profileif no JWT is present.Account Details section
Three stat cards: masked phone number, member-since date, trades completed. Stellar public key shown below in a monospace block.
Transaction History section
smbreakpoint.Dark mode
All new components use
dark:Tailwind variants consistent with the rest of the app.Acceptance Criteria Checklist
/profiledisplays masked phone, registration date, total completed trades/auth/signupGET /api/profileandGET /api/profile/tradesTesting
/profilewhile unauthenticated — should redirect to/auth/signup?returnTo=/profile./profile— stats card shows your masked phone and member date./sell— it should appear in the history table.Related
closes #22