Example discord bot applying a layered architecture.
[!IMPORTANT]
dsGO is still in the early stages of development.
Showcase
Usage (Demo)
[!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
Features
Project Layout
Git
- Go: staticcheck and gofmt.
- templ: templ fmt.
- Gherkin: Cucumber extension.
- Others: Prettier cli/extension.
Scanners
Testing Packages
Releases
GitHub
- Actions for:
- Setup Languages and Dependencies
- Workflows running:
- Automatically (Triggered by Push or Pull requests):
- Manually (Using the Actions tab on GitHub):
- Upgrade Dependencies
- Automate Release
- Issue Templates (Defaults).
Devcontainer
- Multiple Features already pre-configured:
- Extensions and their respective settings to work with:
- Go
- templ
- Cucumber
- Prettier
- Better Comments
- Todo Tree
- cSpell
Docker
- Dockerfile
- Multi-stage builds:
- Development
- Testing
- Build
- Production
- Compose
Message Broker
Security
- 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.
Scripts
- 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.
- 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.
Basic Workflow (Domain > (Infrastructure | Application) > Presentation)
Context (Domain, Infrastructure & Application) > (Modules)
- Domain
- Value Objects
- Mother Creators
- Unit Tests
- Messages (Event/Command)
- Aggregates
- Aggregate Root
- Mother Creators
- Models (Ports)
- Infrastructure
- Persistence
- Repository Mocks
- Adapters
- Integration Tests
- Communication
- Broker Mocks
- Adapters
- Integration Tests
- Application
- Commands
- Querys/Responses
- Handlers/Consumers
- Inputs & Outputs
- Unit Tests
App (Presentation) > (Server)
- Presentation
- Services (Modules)
- Templates
- Handlers
- Routes
- Features (Gherkin)
First Steps
Clone
HTTPS
git clone https://github.com/bastean/dsgo.git && cd dsgo
SSH
git clone git@github.com:bastean/dsgo.git && cd dsgo
Initialize
Dev Container (recommended)
-
System Requirements
-
Start VS Code
code .
-
Open Command Palette
-
Run
Dev Containers: Reopen in Container
Locally
-
System Requirements
-
Run
make init
ZIP
-
System Requirements
-
Run
make init-zero
GitHub Repository
Settings
Actions
-
General
-
Workflow permissions
- Read and write permissions
Secrets and variables
Run
ENVs
[!IMPORTANT]
Before running it, you must set the following environment variables and rename the file to .env.(dev|test|prod).
[!TIP]
You can check the demo file to see which values you can use.
Development
make compose-dev
Tests
Unit
make test-unit
Integration
make compose-test-integration
Acceptance
make compose-test-acceptance
Unit/Integration/Acceptance
make compose-tests
Production
make compose-prod
Tech Stack
Base
Please see
Contributing
- Contributions and Feedback are always welcome!
License