Skip to content

cllei12/tenzi

Repository files navigation

TENZI Game

What is TENZI and how to play?

Quick Start

npm install  # Install all dependencies via npm 
npm start  # Run this app

Then, you can see the Tenzi Game on http://localhost:3000/

Preview

image

image

image

Architecture

Front-end

Built an web app with React

Dependencies

❯ node --version
v18.0.0

❯ npm list
[email protected] /Users/lei/Desktop/Portfolio/tenzi
├── @testing-library/[email protected]
├── @testing-library/[email protected]
├── @testing-library/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Back-end

Created a game record CRUD API with Springboot + AWS RDS (PostgreSQL) + AWS EC2

NOTE: if you find the API doesn't work, feel free to contact me via [email protected]

Game Record API instruction

The Springboot application is runing on my own EC2. Try the following link to see all game records

http://ec2-18-212-191-193.compute-1.amazonaws.com:8080/api/record/getAll

NOTE:

  • If you run the app on your local terminal, you could use this API via http://localhost:{prot_number}/.

  • Or I have set up the API on my AWS EC2 instance, you can access via http://ec2-18-212-191-193.compute-1.amazonaws.com:8080/

# GET
http://ec2-18-212-191-193.compute-1.amazonaws.com:8080/api/record/getAll  # Get all game records
http://ec2-18-212-191-193.compute-1.amazonaws.com:8080/api/record/getBestTime  # Get the best game time
http://ec2-18-212-191-193.compute-1.amazonaws.com:8080/api/record/getOrderByTime  # Get all game records ordered by game time

# POST
POST http://ec2-18-212-191-193.compute-1.amazonaws.com:8080/api/record/add
Content-Type: application/json

{
  "name": "your name",
  "recordTime": "2022-08-26T16:40:00",
  "time": 40,
  "rolls": 20
}

# DELETE
http://ec2-18-212-191-193.compute-1.amazonaws.com:8080/api/record/delete/{recordId}  # Delete record by recordID

Setup API on your machine (Optional)

  1. Open tenzidb folder with intellij idea

  2. Maven: Clean -> install

    Generate tenzidb-0.0.1-SNAPSHOT.jar

  3. Run the API app

    java -jar tenzidb-0.0.1-SNAPSHOT.jar --server.port={prot_number}  # default port=8080