Skip to content

ervinismu/purplestore

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
cmd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Purplestore

Prerequisites

Project Structures

  • Layout
.
├── app.env.sample ( contains application configuration )
├── cmd ( main binary )
├── Makefile ( simplify project commands )
├── docs ( swagger documentation )
├── db
│   └── migrations ( database migrations )
└── internal
    ├── app
    │   ├── controllers ( request response handler )
    │   ├── models ( all about database table )
    │   ├── repository ( database/cache operation )
    │   ├── router ( http router )
    │   ├── schema ( request/response schema )
    │   └── service ( business logic )
    └── pkg ( private lib )
  • Application flow
router --> middleware --> controllers(use schema) --> service --> repository(user model)

Migration Commands

  1. Create migration file
make migrate-create name=migration_name
  1. Migrate Down / Rollback migration
make migrate-down
  1. Migrate UP / Applt migration to database
make migrate-up

Testing Command

  1. Running testing
make test
  1. Open test coverage
make test-cover
  1. Generate mocking Command example
 mockgen -source internal/app/service/category.go -destination internal/mocks/category_repository_mock.go -package mocks

Docker Compose Commands

  1. Running docker compose
docker-compose up -d
  1. List all running container
docker ps

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published