Giter Site home page Giter Site logo

cardmanagement's Introduction

Card Management

Why?

This is a "real world" example application, written entirely in F#. The goal is to create a best practice for building applications or at least give a reasonable manual to design one.

Summary

It's a very simple bank application.

Here you can

  • Create/Read users
  • Create/Read cards for those users
  • Set daily limits for cards
  • Top up balance
  • Process payments (according to your current balance, daily limit and today's spendings)

Tech

To run this thing you'll need:

  • .NET Core 2.2+
  • Docker
  • Visual Studio 2017+ or VS Code with Ionide plugin or Rider with F# plugin

Database here is MongoDb, hosted in docker container. So you just have to navigate to docker folder and run docker-compose up. That's it.

For web api Giraffe framework is used. You can also play with it using CardManagement.Console project.

Project overview

There are several projects in this solution, in order of referencing:

  • CardManagement.Common. Self explanatory, I guess.
  • CardManagement. This is a business logic project, a core of this application. Domain types, actions and composition root for this layer
  • CardManagement.Data. Data access layer. Contains entities, db interaction functions and composition root for this layer.
  • CardManagement.Infrastructure. In here you'll find a global composition root, logging, app configuration functions.
  • CardManagement.Console/CardManagement.Api. Entry point for using global composition root from infrastructure.

Detailed description

Here's long and boring explanation of why anyone would even bother to use F# for web api and tips on how to do it in such a way so you don't blow your head off.

cardmanagement's People

Contributors

anishkny avatar atsapura avatar michael-wolfenden avatar rliman avatar zprobinson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cardmanagement's Issues

Question about where contract mapping code lives

Not really an issue, but there wasn't a discussion forum or I'd have put it there.

I've been reading through your (fantastic) article, I think you bring up a lot of really great ideas.

Curious if you'd be willing to expand on your opinion where the contract mapping code lives in the Domain project.

Normally I've been keeping the contract code purely to the boundaries of the application. My thoughts are that it is the concern of the WebAPI layer to define/maintain the definitions of how the domain aggregates are represented to other systems. Similar to how you've done it in the Data layer. The Data layer is concerned with the representation/mapping of the domain to however it looks when persisted to the database.

Would you argue that the definition of the exposed contract is the concern of the domain? I'm not trying to push one way or the other, just interested in hearing you expand on your thoughts..

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.