How starimper/student_marketplace works
Student Marketplace is a campus buy-and-sell application with a React frontend and Spring Boot backend. Students browse listings, inspect seller information, and purchase items; sellers manage listings and profiles, while users can leave reviews and use an optional authenticated AI assistant. The README documents backend and browser-local demo modes, time-based discounts, photo uploads, and PostgreSQL-backed reviews. Several backend and frontend relationships are documented, but many implementation files were not sampled, so unverified links are omitted or marked dashed.
Main entry points: App.tsx React application · index.ts API adapters · ListingService.java Listing and pricing · ClientReviewService.java Review statistics
Components 25
Student web app
- React application
student-marketplace-main/src/App.tsx - Sign-in screens
student-marketplace-main/src/pages/Login.tsx - Catalog and listing views
student-marketplace-main/src/pages/Catalog.tsx - Listing editor
student-marketplace-main/src/pages/ListingForm.tsx - Reviews and seller ratings
student-marketplace-main/src/pages/Reviews.tsx - AI assistant
student-marketplace-main/src/pages/AiAssistant.tsx - API adapters
student-marketplace-main/src/api/index.ts - Browser demo data
student-marketplace-main/src/api/mockAdapter.ts
Marketplace backend
- Listing APIs
student-marketplace/src/main/java/com/studentmarketplace/listing/ListingController.java - Listing and pricing
student-marketplace/src/main/java/com/studentmarketplace/listing/ListingService.java - Listings and discount rules
student-marketplace/src/main/java/com/studentmarketplace/listing/ListingRepository.java - Purchase transactions
student-marketplace/src/main/java/com/studentmarketplace/purchase/PurchaseService.java - Photo handling
student-marketplace/src/main/java/com/studentmarketplace/photo/PhotoService.java - Review and seller APIs
student-marketplace/src/main/java/com/studentmarketplace/client/ClientReviewController.java - Review statistics
student-marketplace/src/main/java/com/studentmarketplace/client/ClientReviewService.java - User profiles
student-marketplace/src/main/java/com/studentmarketplace/user/UserService.java - AI chat endpoint
student-marketplace/src/main/java/com/studentmarketplace/ai/AiChatController.java - AI chat service
student-marketplace/src/main/java/com/studentmarketplace/ai/AiChatService.java
Identity and access
- Session and route guards
student-marketplace-main/src/auth/AuthContext.tsx - Authentication API
student-marketplace/src/main/java/com/studentmarketplace/auth/AuthController.java - JWT authentication
student-marketplace/src/main/java/com/studentmarketplace/auth/AuthService.java - Request security
student-marketplace/src/main/java/com/studentmarketplace/security/SecurityConfig.java
Platform services
- PostgreSQL database
Other components
- Students
- OpenRouter
Connections 29
- Students → React application: use
student-marketplace-main/src/App.tsx - React application → Sign-in screens: routes to
student-marketplace-main/src/App.tsx - React application → Catalog and listing views: routes to
student-marketplace-main/src/App.tsx - React application → Listing editor: routes to
student-marketplace-main/src/App.tsx - React application → Reviews and seller ratings: routes to
student-marketplace-main/src/App.tsx - React application → AI assistant: routes to
student-marketplace-main/src/App.tsx - Sign-in screens → Session and route guards: uses session
- Session and route guards → API adapters: requests auth
student-marketplace-main/src/auth/AuthContext.tsx - API adapters → Browser demo data: selects demo mode
README.md - API adapters → Authentication API: calls API
- API adapters → Listing APIs: calls API
- API adapters → Review and seller APIs: calls API
README.md - API adapters → AI chat endpoint: calls API
README.md - Authentication API → JWT authentication: delegates to
- JWT authentication → Request security: issues JWT
student-marketplace/src/main/java/com/studentmarketplace/auth/AuthService.java - Listing APIs → Listing and pricing: delegates to
- Listing and pricing → Listings and discount rules: reads and writes
student-marketplace/src/main/java/com/studentmarketplace/listing/ListingService.java - Purchase transactions → Listings and discount rules: locks listing
student-marketplace/src/main/java/com/studentmarketplace/listing/ListingRepository.java - Review and seller APIs → Review statistics: delegates to
student-marketplace/src/main/java/com/studentmarketplace/client/ClientReviewController.java - Review statistics → Listings and discount rules: counts listings
student-marketplace/src/main/java/com/studentmarketplace/client/ClientReviewService.java - Review statistics → PostgreSQL database: stores reviews
README.md - AI chat service → OpenRouter: sends chat request
README.md - AI chat endpoint → AI chat service: delegates to
- Listing and pricing → PostgreSQL database: persists listings
- Photo handling → PostgreSQL database: stores photo metadata
- Students → Purchase transactions: buy item
- Listing editor → Photo handling: uploads photos
- Reviews and seller ratings → Review and seller APIs: loads feedback
README.md - AI assistant → AI chat endpoint: sends chat
README.md