Skip to content

Basic integration of BE#1

Open
ankitrajmehta wants to merge 3 commits into
ibriz:mainfrom
ankitrajmehta:integration/main-integration_changes
Open

Basic integration of BE#1
ankitrajmehta wants to merge 3 commits into
ibriz:mainfrom
ankitrajmehta:integration/main-integration_changes

Conversation

@ankitrajmehta
Copy link
Copy Markdown

@ankitrajmehta ankitrajmehta commented Mar 11, 2026

  • Completely replaces mock.js from being a static data hub to using the api routes.
  • Pages where data from mock.js was used now use async methods to support the api based mock.js, alongside some edge case handling
  • NOT INTEGRATED in places where mock.js was not used, including all the form/file submissions, or "Apply now" buttons, etc. Only in data loading part it is integrated. Changes have been kept minimal
  • The FE operates exactly the same as it previously, with no change in functionality. Only the location from where data is loaded is changed.

…ync API client

- Created api.js with per-role token caching and demo credentials
- Rewrote mock.js to export async functions calling api.get()
- Added relativeTime() helper for activity timestamps
- All exports now async: getNGOs, getPrograms, getPlatformStats, etc.
…ync API

- main.js: async renderPage, api.setRole on role change, await all renders
- router.js: cleaned up duplicate code
- All 14 page files converted to async render functions
- Removed hardcoded ID filters (ngo-1, donor-1, school-1) - API returns scoped data
- public-dashboard.js uses relativeTime() for activity timestamps
@ankitrajmehta ankitrajmehta changed the title landing page edge case Basic integration of BE Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant