How eikkar/oreshop works
OREshop is a small online shop with a React storefront and an Express/MySQL service. Shoppers browse and search products, add items to a shared cart, and submit an order; the interface also provides account access and order history. The server handles catalog and order requests, sessions, and database operations. The sampled code confirms catalog and checkout requests, but not the wiring for every account or history screen, so those links are omitted rather than inferred.
Main entry points: Valikko.jsx Page navigation · Authcontext.jsx Session UI state · Tuotteet.jsx Product catalog · tilaus.jsx Checkout
Components 20
Storefront
- React entry
oreshop/src/main.jsx - App shell
oreshop/src/jsx/App.jsx - Page navigation
oreshop/src/jsx/Valikko.jsx
Shopping
- Product catalog
oreshop/src/jsx/Tuotteet.jsx - Product search
oreshop/src/jsx/Searchbar.jsx - Product details
oreshop/src/jsx/Tuotesivu.jsx - Shopping cart
oreshop/src/jsx/Ostoskori.jsx - Checkout
oreshop/src/jsx/tilaus.jsx - Order confirmation
oreshop/src/jsx/Congrats.jsx - Order history
oreshop/src/jsx/Tilaushistoria.jsx - Shop helpers
oreshop/src/jsx/apuFunktiot.js
Accounts
- Session UI state
oreshop/src/jsx/Authcontext.jsx - Account screen
oreshop/src/jsx/kirjautuminen.jsx - Login form
oreshop/src/jsx/login.jsx - Registration form
oreshop/src/jsx/register.jsx - Sign-out control
oreshop/src/jsx/signout.jsx
Shop service
- HTTP service
datapalvelin/palvelin.js - Login guard
datapalvelin/kirjasto.js
Persistence
- MySQL database
Other components
- Shopper
Connections 24
- Shopper → React entry: opens storefront
oreshop/src/main.jsx - React entry → App shell: renders
oreshop/src/main.jsx - App shell → Session UI state: provides state
oreshop/src/jsx/App.jsx - App shell → Page navigation: renders
oreshop/src/jsx/App.jsx - Page navigation → Product catalog: routes to
oreshop/src/jsx/Valikko.jsx - Page navigation → Shopping cart: routes to
oreshop/src/jsx/Valikko.jsx - Page navigation → Checkout: routes to
oreshop/src/jsx/Valikko.jsx - Page navigation → Order confirmation: routes to
oreshop/src/jsx/Valikko.jsx - Page navigation → Order history: routes to
oreshop/src/jsx/Valikko.jsx - Page navigation → Account screen: routes to
oreshop/src/jsx/Valikko.jsx - Product catalog → Product search: renders
oreshop/src/jsx/Tuotteet.jsx - Product catalog → Product details: shows selection
oreshop/src/jsx/Tuotteet.jsx - Shopping cart → Session UI state: reads and updates
oreshop/src/jsx/Ostoskori.jsx - Checkout → Session UI state: reads and updates
oreshop/src/jsx/tilaus.jsx - Checkout → Shop helpers: calculates total
oreshop/src/jsx/tilaus.jsx - Order history → Shop helpers: uses formatting
oreshop/src/jsx/Tilaushistoria.jsx - Account screen → Session UI state: uses state
oreshop/src/jsx/kirjautuminen.jsx - Login form → Session UI state: uses state
oreshop/src/jsx/login.jsx - Registration form → Session UI state: uses state
oreshop/src/jsx/register.jsx - Sign-out control → Session UI state: uses state
oreshop/src/jsx/signout.jsx - Product catalog → HTTP service: fetches catalog
oreshop/src/jsx/Tuotteet.jsx - Checkout → HTTP service: submits order
oreshop/src/jsx/tilaus.jsx - HTTP service → Login guard: checks login
datapalvelin/palvelin.js - HTTP service → MySQL database: queries and writes
datapalvelin/palvelin.js