How sahanmedhawa/crosslink works
Purpose and topology
CrossLink is a MERN collaboration platform for NGOs, volunteers, and corporates. It supports NGO project delivery, volunteer applications and skill matching, corporate proposals/direct funding/resource donations, and notifications. The React SPA is served independently from the Express API; MongoDB is the system of record.
Entry points and composition
• Backend startup and HTTP/Socket composition: backend/src/server.js, backend/src/app.js.
• Frontend Vite/React bootstrap and route-bearing application shell: frontend/src/main.jsx, frontend/src/App.jsx.
• API follows routes → controllers → Mongoose models/services. Route groups map to domain ownership, e.g. backend/src/routes/ngo_management/Projectroutes.js and backend/src/routes/volunteer_management/participation.routes.js.
Identity, access, and role boundary
Authentication registers/logs in users and issues JWTs; users are typed as volunteer, NGO, or corporate. JWT validation and role-aware protection form the boundary before protected controllers.
• backend/src/controllers/auth.controller.js
• backend/src/middleware/auth.middleware.js
• backend/src/models/user.model.js
• Client-side identity/session state is supplied through frontend/src/context/AuthContext.jsx.
NGO project lifecycle
NGOs create, update, publish/status-manage, and delete projects, including optional project image upload. Projects expose public discovery and provide the central target for participation, proposals, funding, and resources.
• backend/src/controllers/ngo_management/projectcontroller.js
• backend/src/routes/ngo_management/Projectroutes.js
• backend/src/models/project.js
• NGO dashboards and project management views are under frontend/src/pages/ngo/myprojects.jsx and frontend/src/pages/ngo/createproject.jsx.
Volunteer matching and participation
The matchmaking service evaluates volunteer profile skills/interests against active projects, returning matched projects. Volunteers submit and manage participation applications; NGOs approve/reject them and view project volunteers. Participation is persisted separately from users/projects, allowing application status and statistics.
• backend/src/services/volunteer_management/matchmaking.service.js
• backend/src/controllers/volunteer_management/participation.controller.js
• backend/src/models/participation.model.js
• frontend/src/pages/volunteer/MatchedProjects.jsx, frontend/src/pages/volunteer/MyApplications.jsx.
Corporate collaboration and contribution flows
Corporates discover NGOs/projects, submit proposals for NGO review, send direct funding, and donate/manage physical resources. Proposal, funding, and resource documents are separate transaction-like records linked to projects and actor identities; corporate reporting aggregates impact from these domains.
• backend/src/controllers/corporate_management/proposal.controller.js
• backend/src/controllers/corporate_management/funding.controller.js
• backend/src/controllers/resource_management/resorceController.js
• backend/src/models/proposal.js, backend/src/models/funding.js, backend/src/models/resorce.js.
Notification and asynchronous delivery
Domain actions can create persisted notifications, emit real-time Socket.IO events, and use email utilities. The frontend consumes socket and notification API channels, storing notification/UI state in Redux.
• backend/src/services/notification.service.js
• backend/src/socket/socket.service.js
• backend/src/models/notification.model.js
• frontend/src/services/socket.js, frontend/src/store/slices/notificationsSlice.js.
Runtime infrastructure and integrations
Node/Express uses Mongoose with MongoDB Atlas/local MongoDB, JWT, CORS/security controls, and multipart upload middleware. Cloudinary stores project/profile images; Gmail SMTP sends email; NewsAPI supplies CSR news; the UN SDG API provides goals/targets/data. React 19/Vite uses Tailwind, MUI, Leaflet, and Recharts. Deployment targets are Render for API (render.yaml) and Vercel for frontend (frontend/vercel.json).
Main entry points: App.jsx Application shell · app.js HTTP application · notification.service.js Notification delivery · auth.middleware.js JWT role guard
Components 21
React SPA
- Vite bootstrap
frontend/src/main.jsx - Application shell
frontend/src/App.jsx - Session state
frontend/src/context/AuthContext.jsx - NGO project views
frontend/src/pages/ngo/myprojects.jsx - Volunteer views
frontend/src/pages/volunteer/MatchedProjects.jsx - Notification UI state
frontend/src/store/slices/notificationsSlice.js - Socket client
frontend/src/services/socket.js
Express API
- Server startup
backend/src/server.js - HTTP application · Composes REST middleware, routes, and Socket.IO.
backend/src/app.js - Authentication · Issues JWTs for volunteer, NGO, and corporate users.
backend/src/controllers/auth.controller.js - JWT role guard
backend/src/middleware/auth.middleware.js - Project lifecycle · Public discovery and NGO project management.
backend/src/routes/ngo_management/Projectroutes.js - Skill matching
backend/src/services/volunteer_management/matchmaking.service.js - Participation workflow · Handles volunteer applications and NGO decisions.
backend/src/controllers/volunteer_management/participation.controller.js - Corporate contributions · Proposals, direct funding, and resource donations.
backend/src/controllers/corporate_management/proposal.controller.js - Notification delivery · Persists notifications and triggers delivery channels.
backend/src/services/notification.service.js - Real-time events
backend/src/socket/socket.service.js
Data & integrations
- MongoDB · Stores users, projects, participation, contribution, and notification records.
- Cloudinary · Stores project and profile uploads.
- External content APIs
- Gmail SMTP
Connections 29
- Vite bootstrap → Application shell: mounts
- Application shell → Session state: provides session
- Application shell → NGO project views: routes to
- Application shell → Volunteer views: routes to
- Application shell → Notification UI state: uses
- Application shell → Socket client: connects
- Server startup → HTTP application: starts
- HTTP application → Authentication: auth endpoints
- HTTP application → JWT role guard: protects requests with
- JWT role guard → Project lifecycle: authorizes
- JWT role guard → Participation workflow: authorizes
- JWT role guard → Corporate contributions: authorizes
- Project lifecycle → MongoDB: persists projects
- Project lifecycle → Cloudinary: uploads images
- Skill matching → MongoDB: reads profiles and projects
- Participation workflow → MongoDB: persists applications
- Corporate contributions → MongoDB: persists transactions
- Authentication → MongoDB: manages users
- Participation workflow → Notification delivery: application events
- Corporate contributions → Notification delivery: contribution events
- Notification delivery → MongoDB: persists notifications
- Notification delivery → Real-time events: emits events
- Notification delivery → Gmail SMTP: sends email
- Real-time events → Socket client: pushes updates
- Application shell → HTTP application: REST API calls
- Volunteer views → Skill matching: matched projects
- NGO project views → Project lifecycle: manages projects
- Notification UI state → HTTP application: notification API
- HTTP application → External content APIs: retrieves news and SDG data