This repository belongs to a To-Do App based on Golang. All project has been written by A-TDD approach.For more information about ATDD please check : https://bit.ly/3JmLA82. It has only one feature and adds a new todo item to list. Live version can be found in: http://34.111.105.21 for frontend.
Acceptance criteria for project:
Feature: ToDo
Scenario: Add Item to List
Given Empty ToDo list
When I write "buy some milk" to <text box> and click to <add button>
Then I should see "buy some milk" item in ToDo list
Clean architecture & TDD approach has been used for this project. Rule of Clean Architecture by Uncle Bob
- Independent of Frameworks. The architecture does not depend on the existence of some library of feature laden software. This allows you to use such frameworks as tools, rather than having to cram your system into their limited constraints.
- Testable. The business rules can be tested without the UI, Database, Web Server, or any other external element.
- Independent of UI. The UI can change easily, without changing the rest of the system. A Web UI could be replaced with a console UI, for example, without changing the business rules.
- Independent of Database. You can swap out Oracle or SQL Server, for Mongo, BigTable, CouchDB, or something else. Your business rules are not bound to the database.
- Independent of any external agency. In fact your business rules simply don’t know anything at all about the outside world.
For more: https://8thlight.com/blog/uncle-bob/2012/08/13/the-clean-architecture.html
This project has 3 Domain layer :
- Repository Layer
- Service Layer
- Controller Layer
├── controller/
│ ├── item_controller_test.go
│ └── item_controller.go
├── service/
│ ├── item_service_test.go
│ └── item_service.go
├── repository/
│ ├── item_repository_test.go
│ └── item_repository.go
├── mock/
│ ├── mock_itemrepository.go
│ └── mock_itemservice.go
├── server/
│ └── server.go
├── pact-test.go
├── main.go
├── go.mod/
└── ...
go mod download
go build -o /backend
go run .
go test ./...
go test -coverprofile cover.out and then
go tool cover -html=cover.out
All dependencies can be found on package.json file. Also you can check the list:
Project has GitLab CI pipeline and it has several steps to get ready for deployment.
- Build & Test: Builds the project and runs all unit tests,
- Dockerize: Generates a docker image to private gitlab registry
- Deploy2Test: Configures Google Cloud Platform Kubernetes Engine. This step has 4 another configuration files named:
- backend-deployment.yaml
- backend-ingress.yaml
- backend-secret.yaml
- backend-service.yaml
Ingress has been used for assign a static ip to backend. For more information please check .gitlab-ci.yml file.
This project contains a docker file that generates a docker image. For more information please check Dockerfile.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Nida Dinç - niddinc@gmail.com