Skip to content

The TODO application, using Go's Echo framework for the backend API and Remix's SPA mode for the frontend.

License

Notifications You must be signed in to change notification settings

ryichk/todolist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

todolist

Summary

Frontend

Programming Language

  • TypeScript

Frameworks

Backend

Programming Language

  • Go

Frameworks

  • Echo
    • Utilizes air for Live Reload

DB

  • PostgreSQL

Infrastructure

Cloud Vendor

  • AWS

Tools

  • Node.js v22.11.0
  • aws-cdk v2.173.4

Environment Construction

1. Install Docker

2. Set environment variables

cp .env.sample .env
cp client/.env.sample client/.env

Set the Amazon Cognito User Pool ID and Client ID and Cognito domain URL to be handled in the development environment in the environment variables of the .env and client/.env files.

COGNITO_USER_POOL_ID=
VITE_COGNITO_USER_POOL_ID=
VITE_COGNITO_CLIENT_ID=
VITE_COGNITO_DOMAIN=

3. Start the Docker Containers

make up

4. Execute DB migration

make migrate_up

Development Procedure

Organize Dependencies of Go modules

make tidy

Code Formatting

make fmt

Static Analysis

make lint

Test Code Execution

make test

Create Migration File

To make changes to the DB schema, create a file in api/internal/db/migration and run migration.

Steps

  1. Generate migration file (you can do it manually)
  2. Implement DDL
  3. Execute migration

Migration File Creation Command

make migrate_create NAME="file name"

Migration Execution Command

make migrate_up

Rollback Command for Migration

If STEP is not passed as an argument, everything will be rolled back.

make migrate_down STEP=1

DML Implementation

Implement the query in the file api/internal/db/query.

Reference: https://docs.sqlc.dev/en/latest/howto/select.html

When adding a new model, add it to rename in api/sqlc.yml so that the App prefix is not attached to the model name.

After implementing the query, run the splc generate command.

make sqlc_gen

Model Implementation

the model generated by the sqlc generate command is placed in api/internal/model.

The model implements business logic, etc.

Request Handler Implementation

The request handler implementation is placed in api/internal/handler.

The request handler implements request validation, etc.

Implement Request Routing

Implement request routing in api/internal/server/router.go.

Infrastructure Construction and Deployment Procedures

Setup

make npm_i_infra-ts
make cdk_bootstrap

Build Frontend Code

make build_client

Deploy

Deploy All Stack

make cdk_deploy_all

Deploy Stacks individually

make cdk_deploy STACK=StackName

About

The TODO application, using Go's Echo framework for the backend API and Remix's SPA mode for the frontend.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published