Skip to content

Repository files navigation

InternTest01

Prerequisites

List the prerequisites required to run your project. Include any software or tools that need to be installed.

  • Go Language | Document
    brew install go
  • Air | Go Package | Document
    go install github.com/cosmtrek/air@latest
  • Docker | Document
  • Docker Compose | Document
    for mac
    brew install docker
    brew install docker-compose

Installation

How to installing and setting up your service.

  1. Clone repository

    git clone https://github.com/KhingNoi/internTest01.git
    
  2. Install dependency package

    go get 
  3. For Localhost | Use air package to build and run the project

    air

Migration

  1. Install go migate

    go install -tags 'mysql' github.com/golang-migrate/migrate/v4/cmd/migrate@v4.15.0

    if there's a stable and newer version you better install that instead.

  2. Run migreate to check versioning should comes out a version number

    migrate -version
  3. Create migration file by using command

    make create-migrations <file name>

    Up and down file will created empty you should add on migration code yourself (gpt able to do this)

  4. Run migrations using command

    make migrations-up
    make migrations-down
    

    *If you run migration up and “no change” even if in your db not have given table or some error occorred run migration down to clear all cache before you run migration up

Running the Containers

  1. start the container(s) using docker or docker Compose. Include any necessary commands or configuration files.

    docker-compose up -d
  2. If using docker directly Document Pull MySQL image (if not already pulled)

    docker pull mysql/mysql-server:tag

    Start MySQL container

    docker run --name=mysql1 -d mysql/mysql-server:tag

FAQ

  1. When we system not found air command, we should set PATH environment variable in ~/.bashrc, ~/.bash_profile, ~/.zshrc
    export PATH=$PATH:$(go env GOPATH)/bin

API Specification

Untitled
  • Orange Background => commit
  • White Background => uncommit

EER Diagram

image

  • table image

Hint

  • Postman collection is located in the postman_collection folder.
  • figma click here

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages