Git Product home page Git Product logo

cleanslice's Introduction

Prime Slice

The Slice Architecture for Coso Learning manager projects.

Contents

  1. App
  2. Api

Tech stack

Clean Slice is an Opinionated framework that is built on the tech-stack:

Frontend

  • Typescript, Scss
  • Vite
  • Vuejs
  • Nuxtjs
  • Vuetify

Backend:

  • Nodejs, Typescript
  • Nestjs
  • OpenApi (Swagger, CodeGen)
  • Prisma (DB ORM)
  • PostgreSQL (DB)

Hosting

  • AWS
  • CloudFormation (in CDK ts)

Mobile app

  • Capacitor

Testing

  • vitest
  • cucumber
  • selenium
  • cypress

Core philosophy

Slice Architecture

  • Screaming architecture
  • Abstract when necessary
  • Write reusable code
  • Test more, debug less

Slice Architecture is the next step in Clean Architecture evolution. A slice is a feature limited to a folder inside the application.

Theory

Screaming architecture

"Screaming Architecture" is a term coined by Robert C. Martin, also known as Uncle Bob. The concept of Screaming Architecture is that the structure of a software application should clearly reflect its primary purpose and domain. When someone looks at the high-level structure of its source code, the purpose of the application should be immediately evident – it should “scream” its intent.

Abstract when necessary

The "Abstract When Necessary" pattern is a software development principle that advises developers to introduce abstractions in their code only when it is necessary and justified, rather than prematurely. This principle is aligned with the broader philosophy of keeping code simple and maintainable, such as YAGNI Principle and Refactoring to Abstraction.

There are three recommended examples of structuring your app slice code.

  1. Repository (simple)
  2. Gateway
  3. Service

Which pattern to start with?

Start by implementing the simple pattern if you are also developing the API. You can rapidly prototype your application without having to write lots of abstractions and can take advantage of the OpenAPI CodeGen feature (Api slice)

If you are not in control of the API, you can start with the Gateway pattern. This allows you to add a layer of abstraction on top of a Repository, that is often a third-party SDK.

Write reusable code

The core principle of the Clean Slice Architecture is reusable features aka Slices. A slice is a loosely coupled implementation of a feature. It has its own readme and can only reference other slices through the slice key #sliceName.

This way a slice is independent and can be moved, shared or deleted without effecting the overall app. This approach allows the application to move away from being a monolithic app and become a feature-driven application.

Test more, debug less

Testing is a big part of the Clean Slice Architecture. Ever Project has a test folder that sets ups a testing environment for:

  • Unit testing (vitest)
  • Integration testing (vitest, api mocks)
  • End-to-end testing (cucumber, selenium, cypress)

cleanslice's People

Contributors

dmitriyzhukcoso avatar alexandrdrvn avatar dmitriyzhuk avatar

Stargazers

Oliver Yerbury-Hodgson 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.