项目作者: kanzhygaly

项目描述 :
gRPC client-server application
高级语言: Java
项目地址: git://github.com/kanzhygaly/wallet.git
创建时间: 2018-11-04T18:33:22Z
项目社区:https://github.com/kanzhygaly/wallet

开源协议:

下载


wallet

wallet-proto gRPC Service Interface (API).

wallet-server keeps track of a users monetary balance in the system.

wallet-client emulates users depositing and withdrawing funds.

Technology stack

  • Java 8
  • gRPC
  • JPA/Hibernate
  • PostgreSQL
  • Gradle
  • JUnit 4
  • SLF4J

Database Setup

Install PostgreSQL, then:

  1. # Open command line from project directory and Login to PostgreSQL server
  2. psql -U postgres -h localhost
  3. # Create User
  4. CREATE USER wallet_user WITH password 'wallet_pass';
  5. # Create Database
  6. CREATE DATABASE wallet OWNER wallet_user;
  7. # Change owner of schema "public"
  8. ALTER SCHEMA public OWNER TO wallet_user;
  9. # Logout from PostgreSQL server
  10. \q
  11. # Create Database Data
  12. psql -U wallet_user -d wallet -a -f db-setup/create-db.sql
  13. # Insert Initial Data
  14. psql -U wallet_user -d wallet -a -f db-setup/init-db.sql

Build and Run

Build the project

  1. # From project directory run
  2. ./gradlew build

To run the Java server and client locally:

  1. # Start the server (listens on port 8980)
  2. java -jar wallet-server/build/libs/wallet-server-1.0.jar
  3. # Run the client (connects to localhost:8980)
  4. java -jar wallet-client/build/libs/wallet-client-1.0.jar