Project architecture
E-Cashpoint Web is a SPA (Single Page Application) built with React 18 + Vite, with a microservices backend.
Technology stackβ
Frontendβ
| TecnologΓa | VersiΓ³n | Uso |
|---|---|---|
| React | 18.3 | Framework UI |
| Vite | 7.x | Build tool / dev server |
| React Router | 6.x | Routing SPA |
| styled-components | 6.x | CSS-in-JS |
| framer-motion | 11.x | Animaciones |
| react-i18next | 15.x | InternacionalizaciΓ³n |
| react-leaflet | 4.x | Mapas |
| recharts | 2.x | GrΓ‘ficos |
| Stripe.js | 4.x | Pagos |
Backend (microservices)β
| Servicio | URL | Responsabilidad |
|---|---|---|
| Login Service | login.e-smartpoints.de | AutenticaciΓ³n (Keycloak) |
| Gateway API | gateway.e-smartpoints.de | API principal |
| Users Data | (interno) | Perfiles, wallets, referidos |
| Commerce Catalog | (interno) | Productos, menΓΊs |
| Commerce Operations | (interno) | Pedidos, POS |
| Billing | (billing.e-smartpoints.de) | Suscripciones, Stripe |
| Feeds Service | (interno) | Marketing, posts |
| Super Admin API | (interno) | Panel admin |
Workers / Edge functionsβ
| Worker | Plataforma | FunciΓ³n |
|---|---|---|
| example-WORKER.JS | Cloudflare Workers | GeneraciΓ³n de imΓ‘genes (OpenAI gpt-image-1.5, Gemini), video (Gemini Veo 3.1), eliminaciΓ³n de fondo (Poof), plantillas (Orshot), texto (Gemini) |
| fal-WORKER.JS | Cloudflare Workers | GeneraciΓ³n de imΓ‘genes (Fal.ai Recraft v3) y video (Pixverse v6, LTX 2.3 Fast) con Upstash Redis |
| Logo Generator | Cloudflare Workers | GeneraciΓ³n de logos con IA (Puter/gpt-image-1) con Turnstile y lΓmites en IndexedDB |
Folder structureβ
E-CASHPOINT-WEB/
βββ src/
β βββ components/ # Componentes reutilizables
β β βββ dashboard/ # MΓ³dulos del dashboard
β β βββ *.jsx # Componentes globales
β βββ pages/ # PΓ‘ginas (rutas)
β β βββ billing/ # Checkout success/cancel
β β βββ *.jsx
β βββ modules/ # MΓ³dulos por perfil de comercio
β β βββ restaurantes/ # Restaurantes (bar, cafeterΓa, fast food)
β β β βββ pages/
β β β βββ components/
β β β βββ config/
β β βββ servicios/ # Servicios (peluquerΓa, spa, etc.)
β β βββ superAdmin/
β βββ services/ # Clientes API (apiFetch)
β βββ state/ # Estado global (auth, businessProfile)
β βββ styles/ # styled-components globales + temas
β βββ i18n/ # Sistema de internacionalizaciΓ³n
β β βββ index.js
β β βββ locales/
β β βββ de.json
β β βββ en.json
β β βββ es.json
β βββ App.jsx # ConfiguraciΓ³n de rutas
β βββ main.jsx # Entry point
β βββ theme.js
βββ public/ # Assets estΓ‘ticos
βββ dist/ # Build output
βββ docs/ # Esta documentaciΓ³n (Docusaurus)
βββ package.json
βββ vite.config.js
Trading profilesβ
The application supports 3 trading profiles, each with specific modules:
// src/config/subtypes.js
export const profileConfig = {
restaurantes: {
subtypes: ['restaurant', 'bar', 'cafeteria', 'fast_food'],
modules: ['menu', 'orders', 'tables', 'inventory', 'kitchen']
},
servicios: {
subtypes: ['service', 'beauty'],
modules: ['agenda', 'citas', 'personal']
},
productos: {
subtypes: ['product', 'technology', 'fashion', 'home'],
modules: ['catalog', 'pos', 'inventory']
}
};
Data flowβ
ββββββββββββ login ββββββββββββ token ββββββββββββββββ
β Cliente ββββββββββββΆβ KeycloakββββββββββββΆβ localStorage β
ββββββββββββ ββββββββββββ ββββββββββββββββ
β
βΌ
βββββββ βββββ REST/JSON ββββββββββββββββββββββββββββββββββββββββ
β Frontend βββββββββββββΆβ Gateway API (Cloudflare Workers) β
ββββββββββββ ββββββββββββββββββββββββββββββββββββββββ
β β
βΌ βΌ
ββββββββββββ ββββββββββββ
β Users DB β β Billing β
ββββββββββββ ββββββββββββ
Authenticationβ
- π OAuth 2.0 / OpenID Connect with Keycloak
- π« JWT with custom claims (roles, realm_access)
- πΎ Token saved in localStorage (
access_token) - β° Automatic refresh before expiration