11 Replies - 371 Views - Last Post: 03 January 2018 - 11:04 AM

#1 steveh_131  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-January 18

Advice needed - Angular Front-End / C# Api Back-End

Posted 02 January 2018 - 10:42 AM

I work for a manufacturing company, and we are working on putting together a new design paradigm to move our code-base into the current century. These programs all revolve around database manipulation and viewing using basic CRUD. Things like CRM, Accounting, Inventory, etc. We don't use any middleware or third party systems like MES, etc.

We have finally settled on the following basic structure. The client-facing portion is an angular based light front end developed in VSCode. Most of the heavy lifting CRUD work is done with a back-end server, developed in Visual Studio using a C# .NET API.

They are intended to communicate with each other via HTTP calls and JSON data format.

We are going to be building probably 200 different pages, split into around 12 different categories. Development will be done by 3-4 guys and will likely take years, as we must maintain the existing garbage for the users in addition to new development.

I am trying to find the right tools and the right design architecture that will allow us to move forward efficiently - so here are a few questions.

1. How should I split it all up? Having a separate front-end angular project and a back-end visual studio project would be nice because changes on one wouldn't propagate to another, requiring intense testing of multiple pages every time we push a change into production. However, creating 2 distinct projects for 200 or so pages is going to be extremely tedious - unless there are some tools that can make it easier.

2. On the API side, I am thinking about using Dapper for the database ORM and maybe Swagger to help with the API structure - are there any other/better tools that I might be missing that would speed up this huge process? I am toying with the idea of a middleware like Dreamfactory taking the place of all of the server-side code, but being tied to a proprietary middleware from now until forever sounds... scary. We aren't exactly cutting-edge here, some of our codebase is 20+ years old and I don't see that timeline changing.

Anyway, thanks in advance for any advice you guys can offer.

Is This A Good Question/Topic? 0
  • +

Replies To: Advice needed - Angular Front-End / C# Api Back-End

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 5186
  • View blog
  • Posts: 13,914
  • Joined: 18-April 07

Re: Advice needed - Angular Front-End / C# Api Back-End

Posted 02 January 2018 - 05:19 PM

First of all your idea of breaking it up to an API backend and then having an independent front end is definitely the way to go. Not only are you going to simplify things (2 projects to maintain 200 pages is not really that bad believe me) you are going to get a ton of mileage out of it. You may have 200 now but you could easily triple or quadruple that and still be good. Keep the resources on the back-end sharp and you will be looking good.

As for building the pages, well that is up to you and whatever you are using for the front end web server tech. Almost all languages have templating solutions. If you are going to a Microsoft backend web API then you might want to stay in the family and do something like an ASP.NET Core MVC web server tech. That way you will get a bit of synergy off of it. You can then of course build Angular into that. the MVC portion will give you views/templates to quickly simplify most of your pages and help support CRUD operations.

I have been working with Entity Framework for ORM but I guess people have been moving towards Dapper for years. So that might be a good choice. If you do go with ASP.NET Core you will also be able to use Swagger as you planned... https://docs.microso...s=visual-studio

But the best advice I can give you is to start small and iterate. Focus on getting a simple endpoint up and running. Test it, see how it performs, put in the proper plumbing, then scale it out. Identify what is most crucial to the business and migrate that first. As long as you start small, iterate and get feedback you should be fine. Oh and one other thing... go with what works, not what is hip and trendy. Keep the stack you use lean and well supported by the community. Last place where you want to find yourself is out on a limb with some niche tech and have no one to turn to for when you hit that brick wall... and you will indeed hit a few along the way. :)
Was This Post Helpful? 1
  • +
  • -

#3 steveh_131  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-January 18

Re: Advice needed - Angular Front-End / C# Api Back-End

Posted 03 January 2018 - 08:53 AM

Thank you for the advice. I think that is the direction that I will go.

But let me make one correction to something that was unclear. I meant that there would be 2 projects per page, or per category, or something along those lines. So if there's 200 different pages in 12 different categories, there would either be 24 projects or 400 projects (wow, bad idea haha)

Here's the reasoning: We deal with a constant barrage of things that need fixed or tweaked to meet new demands or handle new equipment. If I have one API serving something like 20 (or 200) pages and I make a small change, it could potentially make a huge mess if I mess something up like a route or something along those lines. So our platform at the moment has each page working as its own code-base, letting us make changes safely and easily and only having to validate a single page's functionality when we're done.

BUT - 200 Angular projects and 200 Visual Studio API projects seems unmanageable to build and maintain so I'm wondering if there are better strategies for handling these things.

Hope that all makes sense, and I really appreciate your insight.

Oh, and by the way I am currently stuck excluding .NET core for the API because some of our systems still reside in Oracle databases and it doesn't currently support that as far as I know.
Was This Post Helpful? 0
  • +
  • -

#4 astonecipher  Icon User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2481
  • View blog
  • Posts: 9,958
  • Joined: 03-December 12

Re: Advice needed - Angular Front-End / C# Api Back-End

Posted 03 January 2018 - 09:07 AM

Are you using Testing currently?

It sounds like, even though you are breaking things out, that you are still keeping things too tightly bound. No idea what your experience level is, so not trying to inform you of things you are doing or do know...

Looking using generics.
See what can be abstracted for more usability.
Add tests if you are not doing so currently.


You should not need a new API per page, unless it does something completely different. In fact, to me, it sounds like a hell of a rabbit hole your company has gone down. Is nothing templated out? 200 pages means that there should be something complete different, not that data is different. In fact, using Angular, even if layout is different, that shouldn't require a new page.



:Point of reference: I work for a Global Forbes 200 manufacturing company, coding their inventory, shipping, warehouse management, and the actual machine level systems.

This post has been edited by astonecipher: 03 January 2018 - 09:09 AM

Was This Post Helpful? 1
  • +
  • -

#5 steveh_131  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-January 18

Re: Advice needed - Angular Front-End / C# Api Back-End

Posted 03 January 2018 - 09:24 AM

Everything here is poorly designed ColdFusion or classic ASP code. I haven't been here long, but I am somewhat spearheading an initiative to start building new pages in a more future-proof architecture and to do it right.

I am not new to writing code but I am somewhat new to designing architectures so feel free to make any ground-level suggestions - there will be no offense taken on my part. Much of my experience is in fixing / adding to legacy systems. I'm heading to ng-conf next year to try to learn more about angular and its applications.

We do not currently use any kind of Testing, but it sounds like I need to be going in that direction instead of trying to isolate chunks of code. Although one other benefit of having isolated pieces is that we can publish a change to a certain piece without having to notify a large number of users that there may be an interuption or something.
Was This Post Helpful? 0
  • +
  • -

#6 astonecipher  Icon User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2481
  • View blog
  • Posts: 9,958
  • Joined: 03-December 12

Re: Advice needed - Angular Front-End / C# Api Back-End

Posted 03 January 2018 - 09:33 AM

We use microservices exclusively on a SOA paradigm. Something you may want to look into, if for no other reason to umderstand the architecture behind it.

Sounds like a long up hill fight. Buy-in we be your biggest hinderance.

Not saying there is anything wrong with how they are doing anything, if it works for them, it works for them. But, in trying to make everything simple, they have managed to make a nightmare to maintain things and unless there are people that will ne there forever with the domain knowledge, things will start failing and no one will know what or where to go to correct it.

We had a service go down for 4 hours in one facility and it cost a few hundred thousand dollars in lost revenue. That is another reason why testing ensures system integrity. At a minimum, you can document what the system currently does and that it will work with changes. But, 200+ systems makes testing a nightmare, unless you can centralize it to a testing service.


SOA Basics
Was This Post Helpful? 0
  • +
  • -

#7 steveh_131  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-January 18

Re: Advice needed - Angular Front-End / C# Api Back-End

Posted 03 January 2018 - 10:20 AM

Thanks, I am going to look into SOA.

The rest of the IT team is on-board with making some big changes. We didn't design this stuff and we are ready to jettison it into outer space. We have already reached the point where a lot of the older people with the 'tribal knowlede', so to speak, are gone and the new-ish guys are here trying to keep this mess running.

So far from what I am reading, it seems that these applications need to be consolidated. Would you say that there should be one api and one angular app for each business area? For example, one for accounting, one for assembly, one for shipping, one for inventory, etc. Or would you recommended compiling all of this into one huge API and one huge angular app?

Please forgive these questions if they seem uninformed, I'm still trying to grapple with the details of how this all gets scaled up.

With consolidated applications, every time we publish changes to the API it could potentially drop some connections or refuse some requests for any area of the plant, right? And possibly the same for the front-end changes?

And doesn't it make it more difficult for a 6-7 member team to all tackle different issues if the areas are all combined?

Thanks AGAIN for all of this help and information!
Was This Post Helpful? 0
  • +
  • -

#8 astonecipher  Icon User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2481
  • View blog
  • Posts: 9,958
  • Joined: 03-December 12

Re: Advice needed - Angular Front-End / C# Api Back-End

Posted 03 January 2018 - 10:38 AM

Domain Drive Design, is another area to look into from the sounds of it. It compliments SOA. If you are on PluralSight, there are a number of courses, or I can point you to some.



For your separation question, you need to evaluate your possibilities, there is no one right way to do it. From an archetectural stand-point;

I would separate out each domain: accounting, assembly, shipping, inventory. But, I would start looking at what they have in common as well, that way you are not duplicating code or projects. Have you heard of Onion Architecture?


Major benefits that you are having issue with now can be addressed.
So, teams, or individuals can work on and deploy components without it affecting everything [ to the point that each service can use a different tech stack].
You can individually scale services that are utilized higher than others.
You can literally drop in a new service without re-calibrating everything else.


The UI can be tricky, depending on how many people need access to what systems. UX comes into play and you don't want someone to need to log into 10 different systems to do their job. There are ways to build the UI on the backend to piece the services needed together though.
Was This Post Helpful? 0
  • +
  • -

#9 astonecipher  Icon User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2481
  • View blog
  • Posts: 9,958
  • Joined: 03-December 12

Re: Advice needed - Angular Front-End / C# Api Back-End

Posted 03 January 2018 - 10:52 AM

A blog that sheds a lot of info for DDD.


Martin Fowler DDD
Was This Post Helpful? 0
  • +
  • -

#10 steveh_131  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-January 18

Re: Advice needed - Angular Front-End / C# Api Back-End

Posted 03 January 2018 - 10:56 AM

I'm reading your link about onion architecture right now - I think I'll need to read it twice. Haha. I just signed up for pluralsight per your recommendation, it looks like it has some great resources.

Are you recommendng an onion architecture for the front-end, back-end or both? This may all be well over my head at this point, but I'm having a hard time figuring out what that would generally look like in an angular/c# api type of application.
Was This Post Helpful? 0
  • +
  • -

#11 astonecipher  Icon User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2481
  • View blog
  • Posts: 9,958
  • Joined: 03-December 12

Re: Advice needed - Angular Front-End / C# Api Back-End

Posted 03 January 2018 - 11:01 AM

First thing first. Don't combine. Front-end is completely separate from back-end, intentionally. Taking a holistic approach, ANY frontend could be used and it not make a difference to the back-end side of things.


Here is the DDD Course
Was This Post Helpful? 0
  • +
  • -

#12 steveh_131  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-January 18

Re: Advice needed - Angular Front-End / C# Api Back-End

Posted 03 January 2018 - 11:04 AM

Great, thank you. I'm going to start with that.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1