Skip to content

titanrukmana/be-assignment

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User Account and Payment Management Services

Introduction

Backend services to manage user accounts and their transactions. It comprises two main components: the Account Service and the Payment Service.

Domains

Account Manager Service

Deals with:

  • User authentication
  • User registration

Payment Manager Service

Made for:

  • Deposits, transfers, and withdrawals
  • Transaction history

Tech Stack

  • Supabase (auth)
  • Go + Gin Gonic
  • Typescript + Fastify + Prisma
  • PostgreSQL
  • Nginx
  • Docker compose

Architecture

architecture

  • Supabase as a third-party service that helps managing the authentication and authorization part of the system.
  • Nginx wraps the API services to make them easier to access
  • PostgreSQL is utilized to retain data (that are not handled by Supabase; e.g. transactions, payment accounts, etc.)
  • Both services do not communicate directly, instead the payment manager accesses the token that is provided by Supabase, generated by authenticating through the account manager.

API Reference

swagger

How to run

Clone the project

  git clone https://github.com/titanrukmana/be-assignment.git

Go to the project directory

  cd my-project

Add your own .env files

Please refer to the existing .env.example or see the instructions below:

  1. root .env
  POSTGRES_USER=
  POSTGRES_PASSWORD=
  POSTGRES_DB=
  POSTGRES_PORT=
  1. account_service .env
  SUPABASE_URL=
  SUPABASE_ANON_KEY=
  1. payment_service .env
  DATABASE_USER=
  DATABASE_PASSWORD=
  DATABASE_DB=
  DATABASE_HOST=
  DATABASE_PORT=
  DATABASE_URL="postgresql://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_DB}?schema=public"
  SUPABASE_URL=
  SUPABASE_ANON_KEY=

Run docker-compose

Run this from the root directory:

  docker-compose up -d

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 84.8%
  • Go 12.6%
  • Dockerfile 2.2%
  • Shell 0.4%