Categorygithub.com/pstano1/go-cart
repository
0.0.0-20240626174046-2c70a3bfd2f3
Repository: https://github.com/pstano1/go-cart.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# README

go-cart

This repository contains a setup for a multi-store application. It includes a REST API and a minimal yet fully functional frontend for store management.

Content

Description

To enable this API, a gRPC service is required. The goal is for the application to host multiple stores using shared resources. To achieve this, the API leverages another application that provides utilities connected to customers. A simple implementation used during development can be found here.

basic-api-schema

TO-DO:

  • frontend:
    • refresh token when expiry is near;
    • style;
    • add manuals;
    • add employees UI;
    • add coupons UI;
    • add orders UI;
    • translations;
    • handle errors;
    • add loaders;
    • validation;
    • toasts;
  • backend:
    • orders;
    • coupons;
    • permissions;
    • tests;
    • errors;
    • add goDoc comments;
    • images storage;
    • add price history;
    • payment processing (stripe);
    • localized product names;
    • BUG: server crashes when user doesn't have any permission;
    • scrape exchange rates in 24h interval (API call in the end);
    • proccessing of coupons to orders;
    • add TAXID to orders;
    • add unit (percentage/currency) to coupon;
    • invoice/receipt generation (probably can be done by stripe);
    • mail sending;
    • webhooks for changing status to paid when stripe gets payment;
  • other:
    • swagger;
    • makefile;
    • .sh script;
    • README.md;
    • dockerfile;
    • investigate dependabot's alerts;

Running locally

git clone [email protected]:pstano1/go-cart.git
cd ./go-cart

Scripts

endpoints testing script

The script runs cURL requests to all enpoints end prints result based on received status code. Please note that although all created entries are deleted, API performs soft delete. To delete all artifacts from database run this script

./scripts/enpointsTests.sh

# result
...
Success: POST /order
Failed: GET /order
...

database managing script

FlagAction
migratecreates tables
create-permissioninserts predefined permissions into table
flushdrops all the tables & creatres new ones
go run ./scripts/manage.go <flag>

Licence

This project is licensed under the MIT License