tabi-memo / backend

0 stars 0 forks source link

Backend System Design #2

Open samuraikun opened 8 months ago

samuraikun commented 8 months ago

Introduction

Design Document Based on https://www.industrialempathy.com/posts/design-docs-at-google/

Scope

Scope of this design document

Background

Background: Why does this document write?

Required

Proposal

What kind of design will you choose? Also, write logically why you have chosen that option.

Language: TypeScript

Reason

Database: PostgreSQL(Supabase)

Reason

Database Architecture

Auth

GraphQL API

※ Full-scratch approach

Framework: Nest.js

GraphQL middleware:

These are described nest.js document. https://docs.nestjs.com/graphql/quick-start#installation

Test tool: @nestjs/testing

ORM: Prisma

Reason

Validation: zod

Reason

Storage: Subase Storage

Reason

CI/CD

Reason

Yo-mah-Ya commented 8 months ago

Seems to be great overall, but I'd like to add some comments below.

Framework: Nest.js

No suggestion or preferable but just simple question: As long as I google GraphQL servers, Apollo server is also popular and reliable. And I've used this before. And Nest.js seems to use it within it. It might be useful and simplified, but when some problems happens, it's going to be more difficult to fix it, for sure. What do you think about the pros and cons of them ?

Authentication/Authorization: Supabase

Want some explicit comments where and how exactly we store user password just in case. And token as well.

Server (WIP)

First of all, Cloud Run looks nice ! But I'd say it's not going to be the reason that we'll choose it as a server with above investigation.

Somewhat it looks docker is considered that important though, is it really necessary in this project first of all? From where I sit, it'd be rather inconvenient when we can prepare particular environment, which are like exact version of nodejs run time, OS and whatnot. My concern is building time of container image and how we manage.

And AWS says it officially supports Docker with Lambda

Database Architecture (WIP)

samuraikun commented 8 months ago

@Yo-mah-Ya This issue is too huge💦 So, I divided it into several like below.