Monday, July 15, 2013

Firebird, Angularjs, Node and Socket.IO - Part 1

Hi,
It's been quite awhile since my first and only post and I do have quite a bit to share. To that end I'm going to post my latest project I'm working on and will go back to publish some older works that might be of interest to the community. About a year ago I attended an AngularJS meetup at Google's NY office and since then have completely changed my development stack. Angular is an awesome approach to developing client side web applications and has truly changed my development life. Of course I needed a back end that supported Firebird. This is where Nodejs comes in and  helps explain the gap between posts as it's taken some time to become proficient with all these new developments. There is a lot to learn and fortunately for those just jumping in, the resources since I began are maturing at a rapid rate (see pluralsight training, eggheadio, books etc) .
The Main Stack for Single Page App (SPA)
Angularjs.org
Firebirdsql.org
Nodejs.org
socketio
express

Quick Dive :
For those who want to jump right in and have some experience with Firebird, Node and JavaScript, I've included all the code and a sample Firebird 2.5 database so that you can really see an end to end product. I will be adding to this blog to break down more of the concepts. Please note that this just a partial snippet of a production product and for those who are interested beyond the training please contact me! This repo incorporated some advanced concepts provided by:


https://github.com/fnakstad/angular-client-side-auth

https://github.com/jfromaniello/passport.socketio


To View code and download this repo
https://github.com/johntom/Angular-Passport-Auth-SIO
Steps to run this repo
To Run The Repo
  • c:\nodedemo>node server
The following Screen Shots represents my repo
.
  • from browser http://localhost:8000
Based upon Login Credentials the system will display menus based on role

roles of users




The following Screen has some parts lifted from https://github.com/btford/angular-socket-io-seed

The Claim View will show open claims for the logged in adjuster
Clicking on a different claim will load associated time/billing rows. Filter will search entire dataset.



Once you press the logout menu the system will only display menus associted with no login credentials
When Mat logs in the system will display menus based on role=user



mat's view


























Tuesday, April 17, 2012

MVC 4 / Firebird / EF 4.1 and Database First

My first blog and it's about giving back to the community I've received so much from.
Recently decided to concentrate my efforts on MVC4, Entity Framwork 4.1 and Firebird after spending a year trying to master Silverlight with MVVM. A recent post on Single Page Application Overview By Brad Severtson led me to his great presentation given by Steve Sanderson (http://channel9.msdn.com/Events/TechDays/Techdays-2012-the-Netherlands/2159). As I'm more interested in Database First development and given that code first is the preferred method shown in examples, I decided to try and convert the beta example with Firebird and Database First. The results of my journey are below. Products used: Microsoft MVC4 Beta with the latest SPA templates, Firebird 2.5 and Firebird 2.7.5 asp dotnet drivers.
Preexisting Firebird database used in my examples.
Metadata view
Data View

Start of new MVC 4 app / Name=SPA1

Template selection

Nuget update for SPA template



Restart solution
Delete automatically created todoitem page not begin used or create todo table in database.
Add the Model

Make sure you arUsing EF 4.1 and Select ADO.NET Entity Data Model

I uesd an established connection fromVS2010
Use SPA1Context for all naming
Select a few Tables. Products used in test

Make all keys Identity type
Code generation item to make a simple DB Context.
Select ADO.Net DbContext
A review of model

This is what got created.

Must do a build before using Controllers
Add new Controller
Select options for dropdowns

Important to select SPA1ContextEntities



Generated javascript
Generated c#
        
Generated View

Web Config

Product Index

Add Product to Main Menu in _Layout.cshtml

Default page When testing new website

Products Page

Edit to change a product. No postbacks occur.

A view of changed products before saving. All modified rows are hi-lighted

View after pressing save button

View of data stored in table
The End.