Go Ecom is a simple e-commerce project implemented in Go. The motivation behind building this project was to create a basic e-commerce system to learn and practice Go programming concepts.
The project aims to solve the problem of building a functional e-commerce API using Go. It provides a foundation for managing products, handling orders, and integrating with payment services.
Through this project, I learned how to structure and develop a REST API in Go, handle authentication and authorization, implement CRUD operations for products and orders, integrate with third-party payment services, and handle error responses.
To install and run the project locally, follow these steps:
- Clone the repository:
git clone https://github.com/paulodhiambo/ecom.git
- Navigate to the project directory:
cd ecom
- Install dependencies:
go mod tidy
- Set up the database and configure the connection details in the configuration file.
- Run the application:
go run main.go
To use the Go Ecom API, follow the API documentation and interact with the available endpoints using tools like cURL, Postman, or any other HTTP client.
For example, to retrieve a list of products, send a GET request to /products
:
GET /products
To add a product to the shopping cart, send a POST request to /cart
with the product ID and quantity:
POST /cart
{
"product_id": "123",
"quantity": 2
}
For more detailed usage instructions and examples, please refer to the API documentation.
- Odhiambo Paul - Project Developer
This project is licensed under the MIT License.
- Product management (CRUD operations)
- Shopping cart functionality
- Order management
- Integration with payment services
Contributions to Go Ecom are welcome! If you would like to contribute, please follow the guidelines outlined in CONTRIBUTING.md.
make migrateup
To run the tests for this project, use the following command:
make test
Make sure you have the necessary dependencies installed before running the tests.