All Projects → mecitsemerci → go-todo-app

mecitsemerci / go-todo-app

Licence: other
Go + Angular Todo App

Programming Languages

go
31211 projects - #10 most used programming language
typescript
32286 projects
HTML
75241 projects
Dockerfile
14818 projects
javascript
184084 projects - #8 most used programming language
SCSS
7915 projects

Projects that are alternatives of or similar to go-todo-app

nbb
.Net Building Blocks
Stars: ✭ 98 (+366.67%)
Mutual labels:  ddd, clean-architecture
ITL
Sample Web API implementation with .NET Core and DDD using Clean Architecture.
Stars: ✭ 29 (+38.1%)
Mutual labels:  ddd, clean-architecture
clean-architecture
Package for isolate your domain code from framework dependency using DDD concepts.
Stars: ✭ 93 (+342.86%)
Mutual labels:  ddd, clean-architecture
Cqrs Clean Eventual Consistency
CQRS, using Clean Architecture, multiple databases and Eventual Consistency
Stars: ✭ 247 (+1076.19%)
Mutual labels:  ddd, clean-architecture
educational-platform
Modular Monolith Java application with DDD
Stars: ✭ 124 (+490.48%)
Mutual labels:  ddd, clean-architecture
Netcorekit
💗 A crafted toolkit for building cloud-native apps on the .NET platform
Stars: ✭ 248 (+1080.95%)
Mutual labels:  ddd, clean-architecture
clean architecture typescript example
This repository provides an implementation (or at least an attempt) of Uncle Bob's Clean Architecture with Typescript.
Stars: ✭ 78 (+271.43%)
Mutual labels:  ddd, clean-architecture
Typescript Clean Architecture
It is my attempt to create Clean Architecture based application in Typescript
Stars: ✭ 225 (+971.43%)
Mutual labels:  ddd, clean-architecture
ema
External memory app - allows one to quickly post and search text notes
Stars: ✭ 43 (+104.76%)
Mutual labels:  ddd, clean-architecture
eShopOnWeb
Sample ASP.NET Core 6.0 reference application, powered by Microsoft, demonstrating a layered application architecture with monolithic deployment model. Download the eBook PDF from docs folder.
Stars: ✭ 8,250 (+39185.71%)
Mutual labels:  ddd, clean-architecture
Node Api Boilerplate
DDD/Clean Architecture inspired boilerplate for Node web APIs
Stars: ✭ 2,797 (+13219.05%)
Mutual labels:  ddd, clean-architecture
MonolithicArchitecture
This repository presents an approach on how to build an application using Monolithic architecture, ASP.NET Core, EntityFrameworkCore, Identity Server, CQRS, DDD
Stars: ✭ 18 (-14.29%)
Mutual labels:  ddd, clean-architecture
Dotnet New Caju
Learn Clean Architecture with .NET Core 3.0 🔥
Stars: ✭ 228 (+985.71%)
Mutual labels:  ddd, clean-architecture
awesome-software-architecture
A curated list of awesome articles, videos, and other resources to learn and practice software architecture, patterns, and principles.
Stars: ✭ 1,594 (+7490.48%)
Mutual labels:  ddd, clean-architecture
Run Aspnetcore
A starter kit for your next ASP.NET Core web application. Boilerplate for ASP.NET Core reference application, demonstrating a layered application architecture with applying Clean Architecture and DDD best practices. Download 100+ page eBook PDF from here ->
Stars: ✭ 227 (+980.95%)
Mutual labels:  ddd, clean-architecture
repository
[PHP 7] Implementation and definition of a base Repository in Domain land.
Stars: ✭ 26 (+23.81%)
Mutual labels:  ddd, clean-architecture
Clean Architecture
Example project showing off clean/hexagonal architecture concepts in Python
Stars: ✭ 149 (+609.52%)
Mutual labels:  ddd, clean-architecture
Architecture
.NET 6, ASP.NET Core 6, Entity Framework Core 6, C# 10, Angular 13, Clean Code, SOLID, DDD.
Stars: ✭ 2,285 (+10780.95%)
Mutual labels:  ddd, clean-architecture
EcommerceDDD
Experimental full-stack application using Domain-Driven Design, CQRS, and Event Sourcing.
Stars: ✭ 178 (+747.62%)
Mutual labels:  ddd, clean-architecture
clean-gin
Implementation of clean architecture in Go, Gin with dependency injection.
Stars: ✭ 181 (+761.9%)
Mutual labels:  clean-architecture, gin-gonic

Go

Go + Angular Todo APP Project Template

This repository is a todo sample go and angular web project built according to Clean Architecture.

Technologies

Web UI Preview

GitHub Logo

Open API Doc Preview

GitHub Logo

Layers and Dependencies

cmd (application run)

Main application executive folder. Don't put a lot of code in the application directory. The directory name for each application should match the name of the executable you want to have (e.g., /cmd/myapp). It's common to have a small main function that imports and invokes the code from the /internal and /pkg directories and nothing else.

internal (application codes)

Private application and library code. This is the code you don't want others importing in their applications or libraries.

  • core includes application core files (domain objects, interfaces). It has no dependencies on another layer.
  • pkg includes external dependencies files and implementation of core interfaces.

test (integration tests)

Application integration test folder.

web (web ui)

Web application specific components: static web assets, server side templates and SPAs.

docs (openapi docs)

open api (swagger) docs files. Swaggo generates automatically.

swag init -g ./cmd/api/main.go -o ./docs

Usage

Open your terminal and clone the repository

git clone https://github.com/mecitsemerci/go-todo-app.git

The application uses mongodb for default database so run makefile command

make docker-mongo-start

This command builds all docker services so if it's ok check that application urls.

Application URL Purpose
Angular UI http://localhost:5000 Todo APP Project
Swagger UI http://localhost:8080/swagger/index.html Todo API OpenAPI Docs
Jaeger UI http://localhost:16686 Opentracing Dashboard

By the way the application supports redis, if you use redis run that command

make docker-redis-start

This command builds docker services so if it's ok check same application urls.

Local Development

Configuration

The application uses environment variables. Environment variable names and values as follows by default.

  # MONGO
  MONGO_URL=mongodb://127.0.0.1:27017
  MONGO_TODO_DB=TodoDb
  MONGO_CONNECTION_TIMEOUT=20
  MONGO_MAX_POOL_SIZE=10
  
  # REDIS
  REDIS_URL=127.0.0.1:6379
  REDIS_TODO_DB=0
  REDIS_CONNECTION_TIMEOUT=20
  REDIS_MAX_POOL_SIZE=10
  
  # JAEGER
  JAEGER_AGENT_HOST=localhost
  JAEGER_AGENT_PORT=6831
  JAEGER_SAMPLER_PARAM=1
  JAEGER_SAMPLER_TYPE=probabilistic
  JAEGER_SERVICE_NAME=go-todo-app
  JAEGER_DISABLED=false

Dependency Injection

The project uses google wire for compile time dependency injection. The project is set for MongoDB by default. Docker compose files generates automatically wire_gen.go in containers but, it must be created manually for local development.

Wire dependency file is /internal/wired/wire_gen.go

make wire-redis

This command generates wire_gen.go with redis provider. When wire_gen.go file is checked, the following change will be seen.

// Injectors from redis.go:

func InitializeTodoHandler() (handler.TodoHandler, error) {
    client, err := redisdb.ProvideRedisClient()
    if err != nil {
        return handler.TodoHandler{}, err
    }
    todoRepository := redisdb.ProvideTodoRepository(client)
    idGenerator := redisdb.ProvideIDGenerator()
    todoService := services.ProvideTodoService(todoRepository, idGenerator)
    todoHandler := handler.ProvideTodoHandler(todoService)
    return todoHandler, nil
}

The following command can be run for MongoDB again

make wire-mongo

All changes can be observed in /internal/wired/wire_gen.go

Swagger

The command that generates the open api document to /docs folder.

make swag

Tests

Existing tests are for demonstration purposes only

Unit Test run command

make unit-test

Integration Test run command

make integration-test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].