Discover Packages
github.com/Teelevision/excommerce
command
module
Version:
v0.0.0-...-14d7d22
Opens a new window with list of versions in this module.
Published: Aug 26, 2020
License: MIT
Opens a new window with license information.
Imports: 12
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
ExCommerce
Example Commerce System
Development requirements
API
Build the server: make build
Start the server build on localhost:8080
: make run
Start api doc server on localhost:8081 : make redoc
Configuration via environment variables
COUPON_DEFAULT_LIFETIME
: The default lifetime when creating a coupon and no
expires at date is given. Use values like 10s
, 2.5m
or 1h30m
to express
a duration. Defaults to 10s
.
Administration
There is a built-in administration account with the credentials admin:admin
.
Use the enclosed postman collection and environment to create coupons using
the administration account.
Frontend
Design
+--------------------------------------------+ +---------------------------------------------+
| SPA Frontend (Vue) | | RESTful Backend (Go) |
| | | |
| +---------------------------+ +---------+--+ +--+--+ +---------------+--------------------+ |
| | App Logic | | API Client | | API +--> Registration | Controllers | |
| | | | +----> | +---------------+ | |
| | | | | | +--> Login | | |
| | +---> +----> | +---------------+ | |
| | | | | | +--> Store Cart | | |
| +---+-----------------------+ | +----> | +---------------+ | |
| | | | | +--> ... | | |
| | +-----------------+ Auth | | | +---------------+ | |
| | | | | | | | | |
| | | +------> | | | +------------+ | | |
| | | | | | | +---> Basic Auth | | | |
| | | | +---------+--+ +--+--+ +----------+-+ +-------+-+-+--------+ |
| | | | | | | | | | |
| +---v---------v---+ +---+------------+ | | +--------------------------v-v-v--------+ |
| | Persistence | | Server-side | | | | Models | | |
| | | | | | | | | | |
| +-------+-+-+-----+ | +------+ +---+ | | | | +------+ +-v----+ +-------+ +---+ | |
| | | | | | Cart | |...| | | | | | Cart | | User | | Order | |...| | |
| | | +--------> +------+ +---+ | | | | +------+ +------+ +-------+ +---+ | |
| | | | | | | | | |
| | | +----------------+ | | +---------------+-+-+-------------------+ |
| | | | | | | | |
| | +-------------------+ | | +---------------v-v-v-------------------+ |
| | | | | | Persistence | |
| +-------v---------+ +--------v-------+ | | | | |
| | Session Storage | | Local Storage | | | +-----+-------------+-------------+-----+ |
| | | | | | | | | | |
| | +-------------+ | | +------+ +---+ | | | +-----v----+ +-----v-----+ +----v-----+ |
| | | Credentials | | | | Cart | |...| | | | | Database | | In-memory | | ... | |
| | +-------------+ | | +------+ +---+ | | | | | | | | | |
| | | | | | | | | | | | | |
| +-----------------+ +----------------+ | | +----------+ +-----------+ +----------+ |
| | | |
+--------------------------------------------+ +---------------------------------------------+
Guest orders a product:
+----------------------+ +----------------------+ +----------------------+
| User | | Frontend | | Backend |
+----------------------+ +----------------------+ +----------------------+
| | | | | |
| adds product to cart +-----> stores cart in local | | |
| | | storage | | |
| | | | | |
| goes to checkout +-----> requires login | | |
| | | | | |
| <-----+ show login | | |
| | | | | |
| want to create acc +-----> | | |
| | | | | |
| <-----+ show register | | |
| | | | | |
| register +----------------------------------> create user |
| | | | | |
| | | store user creds <-----+ |
| | | | | |
| | | store cart on server +-----> apply discounts & |
| | | | | store cart |
| | | | | |
| | | update local cart <-----+ |
| | | | | |
| <-----+ show checkout | | |
| | | | | |
| enter coupon +------- add cart info ------------> validate order |
| | | | | |
| <-----+ show order details <-----+ order details |
| | | | | |
| submit payment info +------- add cart info ------------> lock cart, validate |
| | | | | and store order |
| | | | | |
| | | clear cart <-----+ order details |
| | | | | |
| <-----+ show order details | | |
| | | | | |
+----------------------+ +----------------------+ +----------------------+
Attribution
Images used:
Expand ▾
Collapse ▴
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.