go-assignment

command module
v0.0.0-...-c21ba44 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2021 License: MIT Imports: 8 Imported by: 0

README

Overview

  • Backend assignment for Manabie project for todo service.
  • This repo has resolved issues asked by Manabie:
    • Change Database from SQLLite to Postgres
    • unit test for 'services' layer (todo)
    • unit test for 'storage' layer (todo)
    • split 'services' into 'use case' and 'transport' layer (todo)
  • How to run:
    • docker-compose up -d
    • go run main.go
    • Import Postman collection from docs to check example

DB Schema

-- users definition

CREATE TABLE users (
	id TEXT NOT NULL,
	password TEXT NOT NULL,
	max_todo INTEGER DEFAULT 5 NOT NULL,
	CONSTRAINT users_PK PRIMARY KEY (id)
);

INSERT INTO users (id, password, max_todo) VALUES('firstUser', 'example', 5);

-- tasks definition

CREATE TABLE tasks (
	id TEXT NOT NULL,
	content TEXT NOT NULL,
	user_id TEXT NOT NULL,
    created_date TEXT NOT NULL,
	CONSTRAINT tasks_PK PRIMARY KEY (id),
	CONSTRAINT tasks_FK FOREIGN KEY (user_id) REFERENCES users(id)
);

Sequence diagram

auth and create tasks request

How to run

  • run make build to create local docker image for backend.
  • make run-logs to run project with seeing the logs in the terminal console.
  • make run-no-logs to run project in detached docker mode.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL