Skip to content

MichaelGamel/ecom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started

Prerequisites

  • Go 1.23.4 or later
  • MySQL

Installation

  1. Clone the repository:

    git clone https://github.com/MichaelGamel/ecom.git
    cd ecom
  2. Install dependencies:

    go mod download
  3. Set up the environment variables:

    cp .env.example .env
  4. Update the .env file with your database credentials.

Database Migration

To run the database migrations, use the following commands:

  • To apply migrations:

    make migrate-up
  • To rollback migrations:

    make migrate-down

Build and Run

To build and run the project, use the following commands:

  • Build the project:

    make build
  • Run the project:

    make run

API Endpoints

The API provides the following endpoints:

  • User Authentication

    • POST /api/v1/register - Register a new user
    • POST /api/v1/login - Login a user
  • Product Management

    • GET /api/v1/products - Get all products
    • GET /api/v1/products/{productID} - Get a product by ID
    • POST /api/v1/products - Create a new product (requires authentication)
    • PUT /api/v1/products/{productID} - Update a product (requires authentication)
  • Cart Management

    • POST /api/v1/cart/checkout - Checkout the cart (requires authentication)

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

About

E-Commerce API with Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors