GithubHelp home page GithubHelp logo

storyofhis / shping Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 60 KB

make a point api for e-commerce application

Home Page: https://shping-production.up.railway.app/v1/

Shell 0.57% Go 99.43%
golang ecom gin-gonic postgresql

shping's Introduction

Shping with Go (Golang) REST API

make a point api for e-commerce application

you can see

Used libraries:

Run Locally

Create .env at root, i.e.

DATABASE_URL=postgresql://${{ PGUSER }}:${{ PGPASSWORD }}@${{ PGHOST }}:${{ PGPORT }}/${{ PGDATABASE }}
PGHOST=your_local
PGPORT=5432
PGUSER=postgres
PGPASSWORD=your_password
PGDATABASE=your_db_name
PORT=8080

Setup Db after create database in your postgres

CREATE TYPE role AS ENUM ('admin', 'customer')

Run

go run cmd/main.go

Routes for API

all of. local routes can change with this link

  • user routes

    • POST for register
    localhost:8080/v1/users/register
    https://shping-production.up.railway.app/v1/users/register
    
    • POST for login
    localhost:8080/v1/users/login
    https://shping-production.up.railway.app/v1/users/login
    
    • PATCH for edit topup user
    localhost:8080/v1/users/topup
    https://shping-production.up.railway.app/v1/users/topup
    
  • category routes

    • POST for create category
    localhost:8080/v1/categories
    https://shping-production.up.railway.app/v1/categories
    
    • GET for get all category
    localhost:8080/v1/categories
    https://shping-production.up.railway.app/v1/categories
    
    • PATCH for edit category
    localhost:8080/v1/categories/:categoryId
    https://shping-production.up.railway.app/v1/categories/:categoryId
    
    • DELETEfor delete category
    localhost:8080/v1/categories/:categoryId
    https://shping-production.up.railway.app/v1/categories/:categoryId
    
  • product routes

    • POST for create product
    localhost:8080/v1/products
    https://shping-production.up.railway.app/v1/products
    
    • GET for get all products
    localhost:8080/v1/products
    https://shping-production.up.railway.app/v1/products
    
    • PUT for edit product
    localhost:8080/v1/products/:productId
    https://shping-production.up.railway.app/v1/products/:productId
    
    • DELETE for delete product
    localhost:8080/v1/products/:productId
    https://shping-production.up.railway.app/v1/products/:productId
    
  • transaction routes

    • POST for create transaction
    localhost:8080/v1/transactions
    https://shping-production.up.railway.app/v1/transactions
    
    • GET for get all transaction
    localhost:8080/v1/transactions/my-transactions
    https://shping-production.up.railway.app/v1/transactions/my-transactions
    
    • GET for get all transaction with users response
    localhost:8080/v1/transactions/user-transactions
    https://shping-production.up.railway.app/v1/transactions/user-transactions
    

Jobdesk Member

  • MAULA IZZA AZIZI (GLNG-KS04-020) :
    Initialize Project
    User Endpoints: Register and Login
    Transactions Endpoints: Get My Transactions and Get User Transactions
    Deployment
    
  • HEZKYA NATANAEL RAMLI (GLNG-KS04-008) :
    Endpoint User Topup
    All Products Endpoint
    Endpoint Create Transaction
    Unit Test
    Mocking
    
  • MUHAMAD RESTU FADILLAH (GLNG-KS04-002) :
    All Categories EndPoint
    Postman Collection
    

shping's People

Contributors

mrestuf avatar nathanramli avatar storyofhis avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.