Giter Site home page Giter Site logo

mozaw39 / breathbackend Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 0.0 55 KB

Breath is a distributed application that consists of a backend logic developped with JEE specification and two clients(mobile and web), this repository contains the backend logic

Java 100.00%
java java-8 javaee rest-api jax-rs hibernate-jpa jersey

breathbackend's Introduction

Idea behind

"When emergencies occur, rapid medical treatment increases chances of survival exponentially. Using specially equipped motorcycle ambulances" United Hatzalah
This application helps people that have emergency situations call the nearest equiped motorcycle ambulance.

BreathBackend

Breath is a distributed application that consists of a backend logic developped with JEE specification and two clients(mobile and web), this repository contains the backend logic

Application architecture

I had the intention to build from scrash this application in order to experience some Design Paterns, and to help me get better into "clean code" and SOLID approaches, espacially when it comes to add new features and how to make your application extensible. "A minimun features modification/extension need to have a minimum code modification".
The main architecture model is based on Domain Driven Design using repositories to help persist/retrieve/update data in the database.

Modals

Modals used in this App:

Modals related to App users (roles/entities):

Urgencier: The person in charge of helping people in a emergency situation.
SimpleUser: The final user of the application (person in a emergency situation).
Candidat: Each person that want to become an "Urgencier" he must subscribe in order to join a training session, and if he passes the test he becomes an "Urgencier".
Admin: Person that handle accounts management, adding/removing/altering training sessions.
all of this modals inherite from a commun entity to help adapt the Domain Driven Design in a effectif way that is we only use a common Abstract class to handle all the common use cases.

Modals related to Business

Formation: each candidat(role) can subscribe to a "Formation" and after passing the test he can become an "Urgencier"

Repositories

AbstractRepo: This repo helps handle all the crud operation related to each entity, that helps using a clean DDD design and not repeating code in useless way.
RoleRepo: Each role has a specific repo that handle all the special operations.

Resources

The way how we handle App resources is that each Role use cases are build after a base URL named after the user role. i.e:
candidat resources: candidat/.... urgencier resources: urgencier/....

Authentication & authorization

Authentication and authorization are build using filters, each resource that demands authentication is put after the base url "/secured" (so that we intercept ony if a user reach secured resources).
to handle authorization: we handle autorization by testing the equality between the usertype (role) and the base url that he reaches. So we can say that the authorization part is handled at the execution level which make it a solid approach.

breathbackend's People

Contributors

mozaw39 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.