GithubHelp home page GithubHelp logo

card-app's Introduction

Description

A demo app that allows users to create and manage tasks in the form of cards:

  • Application users are identified uniquely by their mail address, have a role (Member or Admin) and use a password to authenticate themselves before accessing cards
    • Members have access to cards they created
    • Admins have access to all cards

Review

https://github.dev/nikosath/card-app

How to Run

  1. ./gradlew bootJar
  2. docker compose up

REST APIs

The server port is set to 28852. Thanks to SpringDoc OpenAPI, the API JSON is available at http://localhost:28852/api-docs . A basic UI for trying out the API will be available later on at http://localhost:28852/swagger-ui/index.html .

AuthController

  • POST /token: Use Basic Auth to retrieve a JWT token needed for using the CardController operations below. For testing purposes the [username / password] pairs for three dummy users have been hardcoded in method 'userDetailsService' from SecurityConfig. These are:

CardController

Use the token from AuthController as a bearer token to access the following operations. Example header: Authorization: Bearer {token}. With the current application.properties, no data is kept between app restarts.

  • GET /cards: Retrieves all cards.
  • GET /cards/search: Searches for cards based on given parameters.
  • POST /cards: Creates a new card.
  • GET /cards/{cardName}: Retrieves a card by its name.
  • PUT /cards/{cardName}: Updates a card by its name.
  • DELETE /cards/{cardName}: Deletes a card by its name.

TODOs

  • Retrieve user data for each request from a distributed cache (e.g. Redis)
  • Add database indexing
  • Improve integration with SpringDoc OpenAPI.
  • Add proper IT tests with separated use cases and unit tests for each app layer.
  • Don't use email as username.
  • Consider making @Entity retrieval lazy.
  • Exclude lazy loaded fields from Lombok.
  • Add bean validation annotations to all @Entity.
  • Consider making UserContext a spring bean.

card-app's People

Contributors

nikosath avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.