Skip to content

This project is a REST API for a basic cards game. It was developed as a homework assignment, which a partial requirement for the LogmeIn selection process.

Notifications You must be signed in to change notification settings

wnoizumi/cardgames

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deck of Cards Games

example workflow

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Limitations

About The Project

This project is a REST API for a basic cards game. It was developed as a homework assignment, which a partial requirement for the LogmeIn selection process.

(back to top)

Built With

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

  • Java 11 (or higher)

Installation

  1. Clone the repo
    git clone https://github.com/wnoizumi/cardgames.git
  2. Enter the project dir
    cd cardgames
  3. Run Maven install
    mvnw install

Running Automated Tests

  1. Run Maven test in the project dir
    mvnw test

(back to top)

Basic Usage

For the sake of simplicity, the project is configured to run with a development profile using the in-memory H2 database. To startup the project in an embedded server, please follow the steps below:

  1. Run Spring-boot run
    mvnw spring-boot:run
  2. The API will be available at 8080 port. In case you need to use another port, please change the server.port property in the application.properties file.
    server.port=8080
  3. Explore the API using swagger or another tool (e.g., curl, postman, etc)

(back to top)

Features

Next, I present a mapping of features to the API.

(back to top)

Limitations

Next, I present the known limitations and trade-offs considered during the development of this project.

  • More integration tests than unit Tests. Given time constraints, I decided to write mostly integration tests, rather than unit tests. As a result, I was able to test multiple layers with less tests. However, integration tests are slower and consume more resources. Moreover, it is more difficult to find the root cause of deffects without unit tests.
  • No CI/CD configuration. Considering that this project should be prepared to be used in production, I should have configured a CI/CD pipeline and should also have configured a container to facilitate deployment. Finally, I should have created migrations for database versioning. However, I didn't managed to do any of this, since I ended up running out of time.
  • Use of an in-memory database. To facilitate the evaluation of my implementation, I decided to work only with an in-memory database, both for running automated tests and also for running it in a development environment. However, in a real project I would use a more robust database, such as PostgreSQL.
  • Lack of concurrency control. I didn't have enough time to implement and test better concurrency controls (locks, transactions, etc). This would be critical to enable concurrent execution of multiple application server instances.
  • No user interface. I would like to have delivered some user interface to facilitate API testing. However, there was only time to include the documentation and interface generated by swagger.
  • No authentication and security. This version of the API does not perform any authentication and security controls, which would be mandatory in a production environment.
  • Games Api is overloaded with operations. The current implementation of the GamesAPi class is far from good. There are a very large number of operations in this same API. Ideally it should be divided into at least two distinct classes.
  • Some inefficient implementations. There is room for improving many of the implemented operations. Some of them (e.g., getSuitsSummaryOfGame) are performing operations that could be delegated to the database.

(back to top)

About

This project is a REST API for a basic cards game. It was developed as a homework assignment, which a partial requirement for the LogmeIn selection process.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages