Skip to content

Commit

Permalink
[add]: added neccessary files
Browse files Browse the repository at this point in the history
  • Loading branch information
goodylili committed Sep 17, 2023
1 parent ae41891 commit e9c3bf1
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DB_HOST=
DB_PORT=
DB_USERNAME=
DB_PASSWORD=
DB_NAME=
SSL_MODE=
46 changes: 46 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Go

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19
id: go

- name: Install dependencies
run: |
go mod download
- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...

- name: Vet
run: go vet ./...




23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.idea
.env
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work
Empty file added Dockerfile
Empty file.
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2012-2023 Ukeje Chukwuemeriwo Goodness

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Makefile for the Golang project

# Variables
BINARY_NAME=server
PACKAGE=cmd/server
DOCS_DIR=docs

.PHONY: all build run test clean docs

# Default target to run when executing 'make'
all: build

# Build the project
build:
@echo "Building..."
go build -o $(BINARY_NAME) ./$(PACKAGE)

# Run the server
run:
@echo "Running server..."
go run ./$(PACKAGE)

# Run tests
test:
@echo "Running tests..."
go test -v ./...

# Remove build artifacts
clean:
@echo "Cleaning up..."
go clean
rm $(BINARY_NAME)
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module MyGoWebAppTemplate
Empty file added go.sum
Empty file.
8 changes: 8 additions & 0 deletions scripts/PushaG.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# helper script for pushing code to GitHub


git add .
echo -n "🔊 What's the commit message 👉 "
read response
git commit -m "$response"
git push origin main
5 changes: 5 additions & 0 deletions scripts/creator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# helper file for recreating the project structure without any file content

mkdir -p cmd/server config internal/handlers internal/utils scripts static docs

touch .gitignore LICENSE Makefile README.md Dockerfile .env.example go.mod go.sum scripts/PushaG.sh

0 comments on commit e9c3bf1

Please sign in to comment.