How moanwer/softstore works
1. Overall shape
- SoftStore is a single Laravel 12 monolith, not a split frontend/backend app.
- The same codebase serves two major surfaces: the customer-facing store and the Filament-based admin panel.
2. Request entry and routing
- HTTP traffic enters through public/index.php and is routed via routes/web.php.
- Most user-facing pages are Livewire components, so page navigation is largely server-driven with reactive updates rather than a separate SPA API.
3. Storefront UI layer
- The storefront lives in app/Livewire with matching Blade views in resources/views/livewire.
- Main pages include home, products listing, product details, categories, cart, checkout, order history/details, success, and cancel screens.
- Shared UI pieces such as navbar and footer are split into partial Livewire components.
4. Authentication and account flows
- Auth is implemented as Livewire pages for login, registration, forgot password, and reset password.
- These flows sit in the same application boundary as the store, and they reuse Laravel’s auth, session, and password reset infrastructure.
5. Commerce domain and persistence
- The main domain models are User, Category, Brand, Product, Order, OrderItem, and Address.
- Database structure is defined through migrations under database/migrations, with SQLite as the primary database in the README.
- The model layer is the central boundary between UI components and stored commerce data.
6. Cart and checkout flow
- Cart behavior is encapsulated in app/Helpers/CartMangement.php, which appears to manage item state across requests.
- The checkout flow likely turns cart contents into an Order, OrderItem records, and an Address.
- SuccessPage and CancelPage suggest payment outcome handling, with Stripe support prepared but marked as in progress.
7. Admin panel
- The back office is built with Filament v3 and configured through app/Providers/Filament/AdminPanelProvider.php.
- Admin resources exist for brands, categories, products, users, and orders, each with create/edit/list pages.
- Order and user resources also have relation managers, indicating nested admin views for related records.
- Admin widgets such as OrderStats and LatestOrders provide dashboard-style summaries.
8. Events, listeners, and mail
- The app includes a user registration event (UserRegisterd.php), a SendWelcomeEmail listener, and a WelcomeEmail mailable.
- This is the main asynchronous/business side-effect boundary visible in the repo: after registration, the app can trigger email onboarding.
9. UI/asset stack
- Presentation uses Blade templates, Tailwind CSS, Alpine.js, Preline UI, and Livewire v3.
- Frontend assets are built with Vite, with source files in resources/js and resources/css, and compiled output under public/.
- The README highlights wire:navigate for faster in-app navigation and Livewire Alert for user notifications.
10. Infrastructure and runtime concerns
- Laravel’s standard storage, cache, sessions, logs, and queue configuration are present, but no separate infrastructure service is defined in the tree.
- The repo includes Docker support, indicating the app can be containerized for local or deployment use.
- Queue and mail configuration exist, so the architecture is prepared for background jobs and outbound email, even if the visible implementation is mostly synchronous.
11. Testing and scaffolding
- The repo contains the default Laravel test structure plus a UserFactory, suggesting standard model/factory-based testing.
- There is no separate microservice boundary or API layer visible; the architecture is centered on Laravel MVC + Livewire + Filament.
12. How to draw it
- A good diagram would show:
- Browser/users → Livewire storefront components → Eloquent models → SQLite database
- Browser/admins → Filament admin resources → Eloquent models → SQLite database
- Registration/auth events → listener → mailer
- Cart/checkout → order persistence → success/cancel/payment outcomes
- Shared support layer for auth, sessions, storage, notifications, and build assets
Main entry points: web.php web routes · Product.php Eloquent models · CheckoutPage.php Checkout · AdminPanelProvider.php Admin panel
Components 29
Runtime & entry
HTTP entrypoint, bootstrap, and routing.
- index.php · Front controller for incoming web requests.
public/index.php - web routes · Main web routing for storefront and account pages.
routes/web.php
Storefront
Customer-facing Livewire pages and shared UI.
- Home · Storefront landing page.
app/Livewire/HomePage.php - Products · Product listing and browsing surface.
app/Livewire/ProductsPage.php - Product details · Single product view and purchase entry point.
app/Livewire/ProductDetailsPage.php - Categories · Category browsing surface.
app/Livewire/CategoriesPage.php - Cart · Cart review and item state display.
app/Livewire/CartPage.php - Checkout · Checkout flow that turns cart contents into an order.
app/Livewire/CheckoutPage.php - My orders · Customer order history.
app/Livewire/MyOrdersPage.php - Order detail · Customer view for a single order.
app/Livewire/MyOrderDetailPage.php - Success · Post-checkout success outcome screen.
app/Livewire/SuccessPage.php - Cancel · Post-checkout cancellation outcome screen.
app/Livewire/CancelPage.php - Navbar · Shared storefront navigation.
app/Livewire/Partials/Navbar.php - Footer · Shared storefront footer.
app/Livewire/Partials/Footer.php
Account flows
Login, registration, and password reset pages.
- Login · Customer sign-in page.
app/Livewire/Auth/LoginPage.php - Register · Customer registration page.
app/Livewire/Auth/RegisterPage.php - Forgot password · Password reset request page.
app/Livewire/Auth/ForgetPasswordPage.php - Reset password · Password reset confirmation page.
app/Livewire/Auth/ResetPasswordPage.php
Admin panel
Filament back office and dashboard widgets.
- Admin panel · Back office configured through Filament.
app/Providers/Filament/AdminPanelProvider.php - Catalog resources · Brand, category, and product management.
app/Filament/Resources/ProductResource.php - Users & orders · User and order management, including nested relation views.
app/Filament/Resources/UserResource.php - Dashboard widgets · Admin summaries such as latest orders and order stats.
app/Filament/Widgets/LatestOrders.php
Domain & data
Commerce models, cart state, events, mail, and persistence.
- Eloquent models · Core entities: users, catalog, orders, and addresses.
app/Models/Product.php - Cart helper · Request-spanning cart management logic.
app/Helpers/CartMangement.php - Schema · Database migrations for users, catalog, orders, and addresses.
database/migrations/2025_03_22_092618_create_categories_table.php - SQLite DB · Primary persistence store for the monolith.
database/migrations/0001_01_01_000000_create_users_table.php - User registered · Event fired after a new user registers.
app/Events/UserRegisterd.php - Send welcome · Listener that sends onboarding email.
app/Listeners/SendWelcomeEmail.php - Welcome email · Welcome message sent to new users.
app/Mail/WelcomeEmail.php
Connections 41
- index.php → web routes: boots · HTTP entrypoint hands off to web routing.
- web routes → Home: serves · Routes resolve to storefront pages.
- web routes → Products: serves · Routes resolve to product browsing.
- web routes → Product details: serves · Routes resolve to product details.
- web routes → Categories: serves · Routes resolve to category browsing.
- web routes → Cart: serves · Routes resolve to cart view.
- web routes → Checkout: serves · Routes resolve to checkout.
- web routes → My orders: serves · Routes resolve to customer order history.
- web routes → Order detail: serves · Routes resolve to customer order details.
- web routes → Success: serves · Routes resolve to checkout success.
- web routes → Cancel: serves · Routes resolve to checkout cancellation.
- web routes → Login: serves · Routes resolve to login.
- web routes → Register: serves · Routes resolve to registration.
- web routes → Forgot password: serves · Routes resolve to password reset request.
- web routes → Reset password: serves · Routes resolve to password reset confirmation.
- Home → Navbar: uses · Storefront pages share navigation.
- Home → Footer: uses · Storefront pages share footer.
- Products → Eloquent models: reads · Catalog pages load product and category data.
- Product details → Eloquent models: reads · Detail pages load product data.
- Categories → Eloquent models: reads · Category page loads category data.
- Cart → Cart helper: uses · Cart UI relies on cart state helper.
- Cart → Eloquent models: reads · Cart display resolves product data.
- Checkout → Cart helper: uses · Checkout starts from current cart contents.
- Checkout → Eloquent models: writes · Checkout creates orders, order items, and addresses.
- My orders → Eloquent models: reads · Order history loads user orders.
- Order detail → Eloquent models: reads · Order detail loads order and items.
- Success → Eloquent models: reads · Success outcome may reference order state.
- Cancel → Eloquent models: reads · Cancel outcome may reference payment/order state.
- Register → User registered: emits · Registration raises a domain event.
- User registered → Send welcome: handled by · Welcome listener reacts to the registration event.
- Send welcome → Welcome email: sends · Listener dispatches welcome email.
- Welcome email → Eloquent models: references · Welcome onboarding is tied to the user domain.
- Admin panel → Catalog resources: contains · Admin panel exposes catalog management resources.
- Admin panel → Users & orders: contains · Admin panel exposes user and order management.
- Admin panel → Dashboard widgets: contains · Admin panel shows dashboard widgets.
- Catalog resources → Eloquent models: manages · Catalog resources operate on Eloquent models.
- Users & orders → Eloquent models: manages · User and order resources operate on Eloquent models.
- Users & orders → My orders: supports · Admin order views complement customer order data.
- Eloquent models → SQLite DB: persists · Models map to the primary database.
- Schema → SQLite DB: defines · Migrations define the schema stored in SQLite.
- Checkout → Schema: depends on · Checkout flow depends on order-related schema.