GoStoreAPI is a RESTful API designed to power e-commerce platforms or store management systems. It provides structured endpoints to handle core operations such as product management, categories, transactions, user authentication, and other essential features for online stores or inventory-based applications.
- Go (version 1.23+)
- MySQL / Postgres
- Docker
git clone https://github.com/Nuvantim/GoStoreAPI.git
cd GoStoreAPI# Copy environment template
cp .env.example .env
# Edit configuration
nano .envAPP_NAME=STORE_API
URL=example.com
DB_DRIVER=mysql
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=
DB_NAME=api_store
DB_PORT=3306
MAIL_MAILER=smtp.xxx.com
MAIL_PORT=25
MAIL_USERNAME=user@mail.com
MAIL_PASSWORD=password123
MAIL_FROM_ADDRESS="person@mail.com"
PORT=8080
go mod tidy
# Generate a 4096-bit RSA private key
openssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:4096
# Generate a public key from the private key
openssl rsa -in private.pem -pubout -out public.pem
go run cmd/main.goFor the deployment process using Docker, make sure docker is installed on your server
The database configuration is adjusted in the file docker-compose.yml
APP_NAME=STORE_API
URL=example.com
DB_DRIVER=pgsql
DB_HOST=mydb
DB_USER=postgres
DB_PASSWORD=your_database_password
DB_NAME=api_store
DB_PORT=5432
MAIL_MAILER=smtp.xxx.com
MAIL_PORT=25
MAIL_USERNAME=user@mail.com
MAIL_PASSWORD=password123
MAIL_FROM_ADDRESS="person@mail.com"
PORT=7373
make builddocker compose up -ddocker logs myapp