How abhijit789/mern-10th-aug-routing works
This is a React contact-manager application with an additional, apparently inactive nested-products routing example. The main workflow is navigating to a contact view, where users can list and search contacts, add or edit records, view details, and delete entries. Contact pages call a shared Axios client configured for localhost:8080; the repository also includes a backend data file, though its serving setup is not shown. The active router is mounted by App. The source excerpts establish component and routing links, but do not show how the backend serves its data.
Main entry points: RouterObject.jsx Active router · axiosConfig.js Axios client · NestedRouting.jsx Nested routes · ContactList.jsx Contact list
Components 20
Application routing
- App shell
src/App.jsx - Active router
src/router/RouterObject.jsx - Alternate router
src/router/Router.jsx - Nested routes
src/relative and nested routing/NestedRouting.jsx - Product details
src/relative and nested routing/ProductDetails.jsx - Product lookup
src/relative and nested routing/ProductById.jsx - Not found page
src/relative and nested routing/PageNotFound.jsx
Contact workflows
- Contact list
src/compoenets/contact list/ContactList.jsx - Add contact
src/compoenets/add contacts/AddContact.jsx - Edit contact
src/compoenets/edit contact/EditContact.jsx - View contact
src/compoenets/view contact/ViewContact.jsx
Shared UI
- Navigation bar
src/compoenets/navbar/Navbar.jsx - Contact card
src/compoenets/common ui components/Card.jsx - Loading indicator
src/compoenets/common ui components/Spinner.jsx - Text constants
src/compoenets/common ui components/textConstatnt.js
Data access
- Axios client
src/axios configuration/axiosConfig.js - Backend data file
src/backend/db.json
Other components
- Browser user
- React entry
src/main.jsx - Contacts HTTP service
Connections 27
- Browser user → React entry: opens app
- React entry → App shell: renders
src/main.jsx - App shell → Active router: mounts
src/App.jsx - App shell → Nested routes: imports optional router
src/App.jsx - Active router → Navigation bar: routes to
src/router/RouterObject.jsx - Active router → Contact list: routes to
src/router/RouterObject.jsx - Active router → Add contact: routes to
src/router/RouterObject.jsx - Active router → Edit contact: routes to
src/router/RouterObject.jsx - Active router → View contact: routes to
src/router/RouterObject.jsx - Active router → Not found page: routes fallback
src/router/RouterObject.jsx - Nested routes → Product details: routes to
src/relative and nested routing/NestedRouting.jsx - Nested routes → Product lookup: routes to
src/relative and nested routing/NestedRouting.jsx - Nested routes → Not found page: routes fallback
src/relative and nested routing/NestedRouting.jsx - Nested routes → Axios client: loads contacts
src/relative and nested routing/NestedRouting.jsx - Navigation bar → Text constants: uses labels
src/compoenets/navbar/Navbar.jsx - Contact list → Axios client: fetches and deletes
src/compoenets/contact list/ContactList.jsx - Contact list → Contact card: renders
src/compoenets/contact list/ContactList.jsx - Contact list → Loading indicator: renders while loading
src/compoenets/contact list/ContactList.jsx - Contact list → Text constants: uses heading
src/compoenets/contact list/ContactList.jsx - Add contact → Axios client: creates contact
src/compoenets/add contacts/AddContact.jsx - Edit contact → Axios client: loads and updates
src/compoenets/edit contact/EditContact.jsx - Edit contact → Loading indicator: renders while loading
src/compoenets/edit contact/EditContact.jsx - Edit contact → Text constants: uses heading
src/compoenets/edit contact/EditContact.jsx - View contact → Axios client: fetches contact
src/compoenets/view contact/ViewContact.jsx - View contact → Loading indicator: renders while loading
src/compoenets/view contact/ViewContact.jsx - Axios client → Contacts HTTP service: targets localhost
src/axios configuration/axiosConfig.js - Contacts HTTP service → Backend data file: may serve data