How aliamin3x/fyp-nexgen-arcade works
NexGen Arcade is a game storefront with player accounts, wishlists, carts, checkout, a game library, and developer/admin workflows. The main player journey is to browse approved games, add a game to a cart, and proceed through checkout; the sampled code directly confirms browsing and wishlist/cart API calls, but not the checkout-to-payment handoff. The graph also retains the documented-by-routes account, developer, approval, and revenue areas. Several route and payment details were not excerpted, so those relationships are left unconnected or marked unverified.
Main entry points: games/route.js Game API · page.jsx Home discovery · mongodb.js Mongo connector · developers/route.js Developer accounts
Components 32
Storefront
- Home discovery
app/homepage/page.jsx - Game catalog
app/Games/page.jsx - Game details
app/discover/DiscoverClient.js - Featured games
components/FeaturedGames.jsx - Free games
components/FreeGames.jsx - Recommendations
components/RecommendedGames.jsx - Game search
components/SearchBar.jsx
Commerce
- Cart
app/cart/page.jsx - Checkout
app/checkout/CheckoutComponent.js - Checkout session API
app/api/create-checkout-session/route.js - Payment webhook
app/api/webhook/route.js - Game library
app/library/page.jsx - Wishlist
app/favorite/page.jsx
Platform data
- Game API
app/api/games/route.js - Wishlist API
app/api/favorites/route.js - Cart API
app/api/cart/route.js - Mongo connector
lib/mongodb.js - Game records
models/Game.js - Wishlist records
models/Favorite.js - Cart records
models/Cart.js - MongoDB
- User records
models/User.js - Order records
models/Order.js
Accounts and operations
- Session context
lib/SessionContext.jsx - Session API
app/api/auth/me/route.js - Cookie sessions
lib/session.js - Account access
app/login/page.jsx - Developer accounts
app/api/developers/route.js - Game upload
app/dashboard/upload/page.jsx - Game approvals
app/admin/game-approvals/page.jsx - Revenue reports
app/admin/revenues/page.jsx
Other components
- Player
Connections 33
- Player → Home discovery: browses
app/homepage/page.jsx - Home discovery → Featured games: renders
app/homepage/page.jsx - Home discovery → Recommendations: renders
app/homepage/page.jsx - Home discovery → Free games: renders
app/homepage/page.jsx - Home discovery → Game search: renders
app/homepage/page.jsx - Player → Game catalog: browses
app/Games/page.jsx - Game catalog → Game API: fetches games
app/Games/page.jsx - Game API → Mongo connector: connects
app/api/games/route.js - Game API → Game records: queries
app/api/games/route.js - Mongo connector → MongoDB: connects
lib/mongodb.js - Player → Game details: opens details
app/discover/DiscoverClient.js - Game details → Game API: fetches game
app/discover/DiscoverClient.js - Game details → Cart API: adds to cart
app/discover/DiscoverClient.js - Player → Cart: reviews cart
- Cart → Checkout: proceeds to
- Checkout → Checkout session API: requests session
- Checkout session API → Payment webhook: payment event
- Player → Wishlist: manages wishlist
- Game catalog → Wishlist API: adds or removes
app/Games/page.jsx - Wishlist API → Mongo connector: connects
app/api/favorites/route.js - Wishlist API → Wishlist records: reads and writes
app/api/favorites/route.js - Cart API → Cart records: reads and writes
- Player → Account access: signs in
- Session context → Session API: fetches session
lib/SessionContext.jsx - Session API → Cookie sessions: reads cookies
- Game upload → Game API: submits game
- Game API → Cookie sessions: checks session
app/api/games/route.js - Developer accounts → Mongo connector: connects
app/api/developers/route.js - Developer accounts → User records: creates or finds
app/api/developers/route.js - Developer accounts → Cookie sessions: sets cookie
app/api/developers/route.js - Game approvals → Game API: reviews games
- Revenue reports → Order records: reports revenue
- Game library → Order records: loads purchases