Skip to content

HariDaCoder/transaction-query-web

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Transaction Search Application

Setup with Docker

Prerequisites

  • Docker installed on your machine
  • Docker Compose installed on your machine
  • CSV file containing transaction data

Steps to run with Docker

  1. Create a directory for your application:
mkdir saoke-app
cd saoke-app
  1. Create data directory and add CSV file:
mkdir data

Then copy file chuyen_khoan.csv into the data directory

  1. Create docker-compose.yml:
version: '3.8'

services:
  backend:
    image: thanghub2210/saoke-backend:latest
    ports:
      - "3001:3001"
    volumes:
      - ./data:/app/data
    container_name: saoke-backend

  frontend:
    image: thanghub2210/saoke-frontend:latest
    ports:
      - "3000:3000"
    depends_on:
      - backend
    container_name: saoke-frontend
  1. Pull and run the application:
docker-compose up
  1. Access the application:

Important Notes for Docker Setup

  • Ensure your CSV file is named chuyen_khoan.csv and placed in the data directory
  • The data directory must be in the same directory as your docker-compose.yml

Setup without Docker (For Development)

Clone this repository

git clone https://github.com/ThangNeo2210/transaction-query-web.git

Backend Setup

  1. Navigate to backend folder:
cd backend
  1. Install dependencies:
npm install
  1. Start server:
npm start

Server will run on http://localhost:3001

Frontend Setup

  1. Navigate to frontend folder:
cd frontend
  1. Install dependencies:
npm install
  1. Start server: If you want to run in development mode:
npm run dev

If you want to run in production mode:

npm run build
npm run start

Frontend will run on http://localhost:3000

Notes

  • Ensure backend is running before starting frontend
  • Place chuyen_khoan.csv file in the data directory /backend/data/chuyen_khoan.csv

Benchmark

We use k6 to benchmark the API search.

  1. Install k6:

  2. Navigate to backend folder:

cd backend
  1. Run benchmark:
  • Server backend is running on localhost:3001 so host in benchmark is localhost:3001
k6 run benchmark/search-benchmark.js

Important Notes

{
    "success": true,
    "total": 100,
    "data": list of records
}

Example:

{
    "success": true,
    "total": 1,
    "data": [
        {
            "date_time": "2024-01-01",
            "trans_id": "1234567890",
            "credit": 1000000,
            "detail": "Chuyen khoan 1000000"
        }
    ]
}

About

Adding PDF

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 74.7%
  • JavaScript 17.8%
  • CSS 6.2%
  • Dockerfile 1.3%