Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alvingxv/create-go-ddd
https://github.com/alvingxv/create-go-ddd
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/alvingxv/create-go-ddd
- Owner: alvingxv
- Created: 2023-06-30T10:27:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-30T13:41:25.000Z (over 1 year ago)
- Last Synced: 2024-09-26T13:07:52.177Z (about 2 months ago)
- Language: Go
- Size: 8.79 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Create Go DDD Project
> This npm package allows you to quickly create a Go project using the Domain-Driven Design (DDD) architecture. It automates the process of cloning a starter template, modifying the Go module path, and installing the project dependencies.
# Prerequisites
Before using this package, ensure that you have the following prerequisites installed on your machine:- [npx](https://www.npmjs.com/package/npx)
- [Git](https://git-scm.com)
- [Go](https://golang.org)# Installation
To create a new Go DDD project, run the following command using npx:
```bash
npx create-go-ddd
```You will be prompted to enter the project name in the format "username/projectname". Provide the desired name and press Enter.
# Running the App
1. After creating the project, navigate to the project directory:
```bash
cd username/projectname
```
2. Open the db.go file under database folder.
3. Locate the following code block and replace the variables with your database credentials:
```go
var (
host = os.Getenv("PGHOST")
port = os.Getenv("PGPORT")
user = os.Getenv("PGUSER")
password = os.Getenv("PGPASSWORD")
dbname = os.Getenv("PGDATABASE")
dialect = "postgres"
)```
4. Save the file and run `go run main.go` and you're good to go!🚀🚀