npm run dev- Navigate to
http://localhost:3000/ - You should see the landing page with "Stellar Ajo" branding
- Click "Sign In" or "Get Started" buttons to test navigation
- Register a new account at
/auth/register - After successful registration, you should be redirected to
/dashboard - Alternatively, login at
/auth/login
- Once authenticated, visit
/dashboard - You should see:
- Welcome message with your name
- 4 stat cards with loading skeletons initially
- Stats should populate after loading:
- Active Circles
- Total Members
- Total Contributed
- Total Withdrawn
- Search bar for filtering circles
- Status filter tabs (All, Active, Pending, Done)
- List of your circles
To verify stats update correctly:
- Create a new circle at
/circles/create - Return to dashboard - "Active Circles" should increment
- Make a contribution in a circle
- Return to dashboard - "Total Contributed" should update (after contribution is marked COMPLETED)
- Visit
/while logged in → should redirect to/dashboard - Visit
/dashboardwhile logged out → should redirect to/auth/login - Visit
/while logged out → should show landing page
Using curl (with your JWT token):
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:3000/api/statsExpected response:
{
"activeCircles": 2,
"totalContributed": 100.50,
"contributionCount": 5,
"totalMembers": 15,
"totalWithdrawn": 0
}curl http://localhost:3000/api/statsExpected response:
{
"error": "Unauthorized"
}To verify the stats are calculated correctly, you can check the database:
-- Count active circles for a user
SELECT COUNT(*) FROM "Circle"
WHERE ("organizerId" = 'USER_ID' OR id IN (
SELECT "circleId" FROM "CircleMember" WHERE "userId" = 'USER_ID'
)) AND status = 'ACTIVE';
-- Sum completed contributions
SELECT SUM(amount) FROM "Contribution"
WHERE "userId" = 'USER_ID' AND status = 'COMPLETED';
-- Count total members across user's circles
SELECT COUNT(*) FROM "CircleMember"
WHERE "circleId" IN (
SELECT id FROM "Circle"
WHERE "organizerId" = 'USER_ID' OR id IN (
SELECT "circleId" FROM "CircleMember" WHERE "userId" = 'USER_ID'
)
) AND status = 'ACTIVE';- Check browser console for errors
- Verify JWT token is valid in localStorage
- Check network tab for API call to
/api/stats - Verify database connection
- This is normal for new users with no circles
- Create a circle and make contributions to see stats populate
- Clear localStorage:
localStorage.clear() - Logout and login again
- Check if
/api/statsendpoint is responding - Check browser console for fetch errors
- Verify authentication token is being sent
- Stats refresh automatically every 30 seconds
- Stats also refresh when you focus the browser tab
- Uses SWR for efficient caching and revalidation
- Database queries use transactions for consistency
- All queries use indexed fields for performance
After verifying the basic functionality:
- Test with multiple circles
- Test with multiple contributions
- Test search and filter functionality
- Test on mobile viewport
- Test with slow network (throttle in DevTools)
- Verify skeleton loaders appear correctly
- Test error states by temporarily breaking the API