Giter Site home page Giter Site logo

go-laravel's Introduction

go-laravel

go-laravel

Initial Project

├── go-laravel
│   ├── celeritas
│   └── myapp

cd celeritas
go mod init github.com/Moji00f/celeritas
cd ../myapp
go mod init myapp

in myapp and in go.mod add below config

replace github.com/Moji00f/celeritas => ../celeritas

when do change in celeritas you should update myapp like below

go get github.com/Moji00f/celeritas 
go: added github.com/Moji00f/celeritas v0.0.0-00010101000000-000000000000

go get -u github.com/Moji00f/celeritas 

insted fetching data

go mod vendor

Create Makefile in root level of myapp

BINARY_NAME=celeritasApp

build:
	@go mod vendor
	@echo "Building Celeritas..."
	@go build -o tmp/${BINARY_NAME} .
	@echo "Celeritas built!"

run: build
	@echo "Starting Celeritas..."
	@./tmp/${BINARY_NAME} &
	@echo "Celeritas started!"

start: run

stop:
	@echo "Stopping Celeritas..."
	@-pkill -SIGTERM -f "./tmp/${BINARY_NAME}"
	@echo "Stopped Celeritas!"

restart: stop start

clean:
	@echo "Cleaning..."
	@go clean
	@rm tmp/${BINARY_NAME}
	@echo "CLeaned!"

test:
	@echo "Testing..."
	@go test ./...
	@echo "Done!"

install GoDotEnv

cd data
go test -v . --tags integration --count=1
go test -cover . -v --tags integration --count=1
go test -cover . --tags integration --count=1


go test -coverprofile=coverage.out
go tool cover -html=coverage.out
cd celeritas
go get github.com/joho/godotenv

go get -u github.com/go-chi/chi/v5
go get github.com/go-chi/chi/v5/middleware

go get github.com/CloudyKit/jet/v6

go get github.com/alexedwards/scs/v2

go get github.com/jackc/pgconn
go get github.com/jackc/pgx/v4
go get github.com/jackc/pgx/stdlib

cd myapp
go get github.com/upper/db/v4/adapter/postgresql
go get github.com/upper/db/v4/adapter/mysql
go mod vendor 

#test Models
go get github.com/DATA-DOG/go-sqlmock

go get github.com/ory/dockertest/v3

go get github.com/fatih/color

cd celeritas
go get github.com/golang-migrate/migrate/v4

go get github.com/golang-migrate/migrate/v4/database/mysql

go get github.com/golang-migrate/migrate/v4/database/postgres

go get github.com/golang-migrate/migrate/v4/database/file

https://upper.io/v4/

run below code with root user to see percent of coverage

go tool cover -html=coverage.out -o coverage.html && google-chrome --no-sandbox coverage.html
#!/usr/bin/zsh

# Allow user "chrome" to access the X server
xhost +si:localuser:chrome

# Run Google Chrome as user "chrome" with the specified display
sudo -H -u chrome DISPLAY=:0 /usr/bin/google-chrome


# useradd chrome -s /usr/bin/zsh -d /home/chrome -m 
#!/usr/bin/zsh
xhost +
sudo -H -u chrome DISPLAY=:0 google-chrome

#chmod a+x /root/Doccuments/chrome.sh

go-laravel's People

Contributors

bido-bido avatar moji00f avatar

Watchers

 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.