Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matimortari/go-ecommerce-backend
Backend service for an e-commerce platform using Go and PostgreSQL. It provides APIs for user authentication, product management, cart functionality, and order processing.
https://github.com/matimortari/go-ecommerce-backend
backend backend-api backend-service backend-testing e-commerce ecommerce go golang postgresql
Last synced: 24 days ago
JSON representation
Backend service for an e-commerce platform using Go and PostgreSQL. It provides APIs for user authentication, product management, cart functionality, and order processing.
- Host: GitHub
- URL: https://github.com/matimortari/go-ecommerce-backend
- Owner: matimortari
- Created: 2025-01-05T18:14:13.000Z (25 days ago)
- Default Branch: main
- Last Pushed: 2025-01-05T21:17:21.000Z (25 days ago)
- Last Synced: 2025-01-05T22:18:48.578Z (25 days ago)
- Topics: backend, backend-api, backend-service, backend-testing, e-commerce, ecommerce, go, golang, postgresql
- Language: Go
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go E-Commerce Backend ๐โก
Backend service for an e-commerce platform using Go and PostgreSQL. It provides APIs for user authentication, product management, cart functionality, and order processing.
## ๐ฆ Key Features
- **Modular Architecture**: Clean and organized structure for better scalability.
- **Authentication**: Secure user authentication with JWT and password hashing.
- **Products**: Get, create and update products.
- **Cart**: Get and create orders with multiple products and secure validation.
- **Database Migrations**: Easy setup and migration of database schemas.
- **Automated Testing**: Easy-to-run tests for ensuring code reliability, using Go's built-in testing framework.
- **Makefile Automation**: Simplified commands for building, running, testing, and managing migrations.## ๐ Directory Structure
```bash
bin/ - Compiled binaries
cmd/ - Main application entry points
config/ - Configuration files
services/ - Business logic and API handlers
types/ - Shared data types
utils/ - Utility functions
```## ๐ Getting Started
- Clone the repository:
```bash
git clone https://github.com/matimortari/go-backend .
```- Install dependencies:
```bash
go mod tidy
```- Create a `.env` file in the project root with the following environment variables (modify as needed):
```bash
# Server configuration
PUBLIC_HOST=http://localhost/
PORT=8080# PostgreSQL database configuration
DB_USER=postgres
DB_PASSWORD=postgres
DB_HOST=localhost
DB_PORT=5432
DB_NAME=ecom
```- Use the `Makefile` to automate common tasks.
## โ๏ธ๐งช Makefile Commands
- Build the application to a binary at `bin/ecom`:
```bash
make build
```- Run the compiled binary:
```bash
make run
```- Run tests:
```bash
make test
```- Create a new migration file at `cmd/migrate/migrations`:
```bash
make migration-create name=
```- Run migrations "up" to apply all pending migrations:
```bash
make migrate-up
```- Run migrations "down" to roll back the last applied migration:
```bash
make migrate-down
```- Check migration status and version:
```bash
make migrate-status
```## ๐ฌ Contact
Feel free to reach out to discuss collaboration opportunities or to say hello!
- [**My Email**](mailto:[email protected])
- [**My LinkedIn Profile**](https://www.linkedin.com/in/matheus-mortari-19rt)
- [**My GitHub Profile**](https://github.com/matimortari)