How ankit0514/skillswap-platform works
SkillSwap is a peer-to-peer skill exchange web application. Users create profiles listing skills to teach and learn, discover potential partners through search or AI recommendations, propose and manage swaps, and communicate through chat. The client routes users to these product areas and uses an API service to reach the Express server; the server mounts feature routes, whose handlers manage domain data. The tree and excerpts establish the main areas, but do not show all client API calls or Socket.io event wiring, so those connections are kept high-level.
Main entry points: App.js Route application · server.js HTTP server · api.js API service · User.js User records
Components 28
Web client
- Route application
client/src/App.js - Login and signup
client/src/pages/Auth - Dashboard
client/src/pages/Dashboard.jsx - Explore people
client/src/pages/Explore.jsx - Profile and skills
client/src/pages/Profile.jsx - Swap management
client/src/pages/MySwaps.jsx - Auth context
client/src/context/AuthContext.jsx - API service
client/src/services/api.js
API and access
- HTTP server
server/src/server.js - Auth routes
server/src/routes/authRoutes.js - MongoDB
Discovery and exchange
- User routes
server/src/routes/userRoutes.js - Swap routes
server/src/routes/swapRoutes.js - AI routes
server/src/routes/aiRoutes.js - User handlers
server/src/controllers/userController.js - Swap handlers
server/src/controllers/swapController.js - Recommendation handler
server/src/controllers/aiController.js - User records
server/src/models/User.js - Swap records
server/src/models/SwapRequest.js
Messaging
- Messages UI
client/src/pages/Messages.jsx - Socket context
client/src/context/SocketContext.jsx - Chat routes
server/src/routes/chatRoutes.js - Chat handlers
server/src/controllers/chatController.js - Chat records
server/src/models/Chat.js - Message records
server/src/models/Message.js - Socket.io server
server/src/config/socket.js
Other components
- Student
- Gemini API
Connections 40
- Student → Route application: uses
- Route application → Login and signup: routes to
- Route application → Dashboard: routes to
- Route application → Explore people: routes to
- Route application → Profile and skills: routes to
- Route application → Swap management: routes to
- Route application → Messages UI: routes to
- Route application → Auth context: provides auth
- Route application → Socket context: provides sockets
- Login and signup → API service: requests auth
- Dashboard → API service: requests data
- Explore people → API service: searches people
- Profile and skills → API service: updates profile
- Explore people → AI routes: requests recommendations
- Swap management → API service: manages swaps
- Messages UI → API service: loads messages
- Messages UI → Socket context: uses realtime
- API service → HTTP server: HTTP requests
- HTTP server → Auth routes: mounts
- HTTP server → User routes: mounts
- HTTP server → Swap routes: mounts
- HTTP server → AI routes: mounts
- HTTP server → Chat routes: mounts
- HTTP server → Socket.io server: initializes
- User routes → User handlers: dispatches
- Swap routes → Swap handlers: dispatches
- AI routes → Recommendation handler: dispatches
- Chat routes → Chat handlers: dispatches
- User handlers → User records: reads and updates
- Swap handlers → User records: checks users
- Swap handlers → Swap records: manages requests
- Recommendation handler → User records: finds matches
- Recommendation handler → Gemini API: ranks matches
- Chat handlers → User records: checks participant
- Chat handlers → Chat records: finds and updates
- Chat handlers → Message records: stores messages
- User records → MongoDB: persists
- Swap records → MongoDB: persists
- Chat records → MongoDB: persists
- Message records → MongoDB: persists