A sample E-Commerce application that consists of multiple, separate applications:
- A front end, rendered using Go's rich html/template package and services content to the end user as web pages.
- A restful back end API, which is called by the front end as necessary.
- A microservice that's dynamically building PDF invoices and sending them to customers as an email attachment.
The application:
- allows users to purchase a single product.
- allows users to purchase a recurring monthly subscription (a Stripe plan).
- handles subscription cancellations and refunds.
- saves all transaction information to a MariaDB database (for refunds, reporting, etc.).
- secures access to the frontend via session authentication.
- secures access to the backend API via stateful tokens.
- manages users (add/edit/delete).
- allows users to reset their passwords safely and securely.
- supports logging a user out and cancel their account instantly, over websockets.
- produces PDF invoices and sends them via email to the customers.
docker-compose up
cd migrations &&
soda migrate
docker exec -i [CONTAINER_NAME] mysqldump -uroot -p[ROOT_PASSWORD] --databases [DB_NAME] --skip-comments > [YOUR_PATH]/dump.sql
// stripe
STRIPE_KEY=
STRIPE_SECRET=
// Secret Key (Must be 256 bits/32 chars)
SECRET_KEY=
// stripe
STRIPE_KEY=
STRIPE_SECRET=
// Secret Key (must be the same as frontend SECRET_KEY)
SECRET_KEY=
// smtp (e.g. mailtrap.io)
SMTP_USERNAME=
SMTP_PASSWORD=
// smtp (e.g. mailtrap.io)
SMTP_USERNAME=
SMTP_PASSWORD=
- Fill out the ENV's at the top of the
makefile.example
- Rename
Makefile.example
toMakefile
- Run
make start
to start all the app components