Example CRUD project applying Hexagonal Architecture, Domain-Driven Design (DDD), Event-Driven Architecture (EDA), Command Query Responsibility Segregation (CQRS), Behavior-Driven Development (BDD), Continuous Integration (CI), and more... in Go.
Note
- System Requirements
- In the Demo version, the link to confirm the account is sent through the Terminal.
- "Hi <username>, please confirm your account through this link: <link>"
- You can define your own SMTP configuration in the .env.demo file by simply modifying the SERVER_SMTP_* variables, then you will receive the links by mail.
make demo
- Based on Standard Go Project Layout.
- Hooks managed by husky:
- Pre-Commit: lint-staged
- Secrets Scanning using TruffleHog CLI
- Formatting
- Commit-Msg: commitlint
- Check Conventional Commits rules
- Pre-Commit: lint-staged
- Commit message helper using Commitizen.
- Interactive prompt that allows you to write commits following the Conventional Commits rules.
make commit
- Go: staticcheck and gofmt.
- templ: templ fmt.
- Gherkin: Cucumber extension.
- Others: Prettier cli/extension.
- Random data generator: Gofakeit.
- Unit/Integration: Testify.
- Acceptance: Testify, Godog (Cucumber) and Playwright.
- Automatically managed by Release It!:
- Before/After Hooks for:
- Linting
- Testing
- Bump version based on Conventional Commits and SemVer:
- CHANGELOG generator
- Commits and Tags generator
- GitHub Releases
- Before/After Hooks for:
- Actions for:
- Setup Languages and Dependencies
- Workflows running:
- Automatically (Triggered by Push or Pull requests):
- Secrets Scanning (TruffleHog Action)
- Linting
- Testing
- Manually (Using the Actions tab on GitHub):
- Upgrade Dependencies
- Automate Release
- Automatically (Triggered by Push or Pull requests):
- Issue Templates (Defaults).
- Multiple Features already pre-configured:
- Go
- Node
- Docker in Docker
- Extensions and their respective settings to work with:
- Go
- templ
- Cucumber
- Gherkin
- Prettier
- Better Comments
- Todo Tree
- cSpell
- Dockerfile
- Multi-stage builds:
- Development
- Testing
- Build
- Production
- Multi-stage builds:
- Compose
- Switched by ENVs.
- Routing Key based on AsyncAPI Topic Definition.
- Form validation at the client using Fomantic - Form Validation.
- On the server, the validations are performed using the Value Objects defined in the Context.
- Data authentication via JWT managed by Session Cookies.
- Account confirmation via Mail or Terminal.
- Password hashing using Bcrypt.
- Requests Rate Limiting.
- Server log files.
- syncenv
- Synchronize all .env* files in the directory using an .env model.
- copydeps
- Copies the files required by the browser dependencies from the node_modules folder and places them inside the static folder on the server.
- upgrade
- Perform the following steps to upgrade the project:
- Upgrade Go and Node dependencies.
- Linting and Testing.
- Commit changes.
- Perform the following steps to upgrade the project:
- run
- Display the logs and redirect them to a file whose name depends on the time at which the service was run.
- Used in Production Image.
git clone https://github.com/bastean/codexgo.git && cd codexgo
git clone git@github.com:bastean/codexgo.git && cd codexgo
-
System Requirements
-
Start VS Code
code .
-
Open Command Palette
- Ctrl+Shift+P
-
Run
Dev Containers: Reopen in Container
-
Run
make init-zero
-
General
-
Workflow permissions
- Read and write permissions
-
-
Actions
-
New repository secret
-
BOT_GPG_PRIVATE_KEY
gpg --armor --export-secret-key [Pub_Key_ID (*-BOT)]
-
BOT_GPG_PASSPHRASE
-
-
Important
Before running it, you must set the following environment variables and rename the file to .env.(dev|test|prod).
make compose-dev
make test-unit
make compose-test-integration
make compose-test-acceptance
make compose-tests
make compose-prod
- Contributions and Feedback are always welcome!