Golang backend for online shop

Local setup:

Prerequisites:

  • GOLang
  • MySQL

Steps:

  1. Logging with your credentials using mysql cli.

mysql -u root -p
Enter password:
  1. Create a new database

create database online_shop;
use online_shop;
  1. Use initial sql file to create the tables and insert initial data

source sql/initialSetup/tableProducts.sql;
source sql/initialSetup/tableOrders.sql;
source sql/initialSetup/tableOrderedProducts.sql;
  1. Start main.go with those environment variables

MYSQL_USER = <your mysql username>
MYSQL_PASSWORD = <your mysql password>
MYSQL_IP_ADDRESS = <to ip address of the mysql> default: localhost:3306

Swagger

Go to
localhost:8080/swagger/index.html
to see the available endpoint and try example call.

GitHub

View Github