Skip to main content

Project architecture

E-Cashpoint Web is a SPA (Single Page Application) built with React 18 + Vite, with a microservices backend.

Technology stack​

Frontend​

TecnologΓ­aVersiΓ³nUso
React18.3Framework UI
Vite7.xBuild tool / dev server
React Router6.xRouting SPA
styled-components6.xCSS-in-JS
framer-motion11.xAnimaciones
react-i18next15.xInternacionalizaciΓ³n
react-leaflet4.xMapas
recharts2.xGrΓ‘ficos
Stripe.js4.xPagos

Backend (microservices)​

ServicioURLResponsabilidad
Login Servicelogin.e-smartpoints.deAutenticaciΓ³n (Keycloak)
Gateway APIgateway.e-smartpoints.deAPI 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​

WorkerPlataformaFunciΓ³n
example-WORKER.JSCloudflare WorkersGeneraciΓ³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.JSCloudflare WorkersGeneraciΓ³n de imΓ‘genes (Fal.ai Recraft v3) y video (Pixverse v6, LTX 2.3 Fast) con Upstash Redis
Logo GeneratorCloudflare WorkersGeneraciΓ³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
  • πŸ”’ 2FA available for super-admins

Design patterns​

  • 🎨 Component composition over inheritance
  • πŸ“¦ Custom hooks for reusable logic
  • 🎯 Container/Presentational components
  • πŸ’… styled-components with theme provider
  • 🌐 i18n centralized with context

Next steps​