NodeJS+MongoDB backend
portokallidis opened this issue · 5 comments
I would like to see it with a node+mongo backend as you said!
I think will help a lot newcomers like me. thank you for sharing knowledge
I have considered forking this project and moving it to Node+Mongo. Any interest? Dan, what are your thoughts? Is this on your roadmap, or would you accept a Pull Request for this?
Hey Mike,
I’m definitely interested in that - would love to offer a Node.js/MongoDB backend (even mention that at the bottom of the readme :)). I started working on that very thing last night actually but will happily take a pull request if you have some time to start it.
I do plan to use the Customer Manager code base in some video classes and potentially some books (so you know upfront) but I’d of course give you credit if you contribute to it. :-)
Thanks,
Dan
From: Mike Erickson [mailto:notifications@github.com]
Sent: Wednesday, September 18, 2013 12:51 PM
To: DanWahlin/CustomerManager
Subject: Re: [CustomerManager] NodeJS+MongoDB backend (#6)
I have considered forking this project and moving it to Node+Mongo. Any interest? Dan, what are your thoughts? Is this on your roadmap, or would you accept a Pull Request for this?
—
Reply to this email directly or view it on GitHub #6 (comment) . https://github.com/notifications/beacon/-qe5h4jddzcHcmhqXzVhYzdrAjHhjQSdM55bp21_bgMLt2DCWwgJNhuTl0CPjQP5.gif
Reviewing the code and it seems the code is abstracted pretty cleanly (of course) and moving to a Node/MongoDB backend would pretty straight forward. Any chance you can supply a SQL dump of the existing database?
Here's what the tables looks like - nice and simple. It's probably easier (from a MongoDB perspective anyway) to look at the classes in the Model folder since ultimately that's what will go in there. But, here are the schemas if you want them:
CREATE TABLE [dbo].[Customers]([Id] INT IDENTITY %281, 1%29 NOT NULL,
[FirstName] NVARCHAR %2850%29 NULL,
[LastName] NVARCHAR %2850%29 NULL,
[Email] NVARCHAR %28100%29 NULL,
[Address] NVARCHAR %281000%29 NULL,
[City] NVARCHAR %2850%29 NULL,
[StateId] INT NOT NULL,
[Zip] INT NOT NULL,
[Gender] INT NOT NULL,
CONSTRAINT [PK_dbo.Customers] PRIMARY KEY CLUSTERED %28[Id] ASC%29,
CONSTRAINT [FK_dbo.Customers_dbo.States_StateId] FOREIGN KEY %28[StateId]%29 REFERENCES [dbo].[States] %28[Id]%29 ON DELETE CASCADE);
CREATE TABLE [dbo].[Orders]([Id] INT IDENTITY %281, 1%29 NOT NULL,
[Product] NVARCHAR %2850%29 NULL,
[Price] DECIMAL %2818, 2%29 NOT NULL,
[Quantity] INT NOT NULL,
[Date] DATETIME NOT NULL,
[CustomerId] INT NOT NULL,
CONSTRAINT [PK_dbo.Orders] PRIMARY KEY CLUSTERED %28[Id] ASC%29,
CONSTRAINT [FK_dbo.Orders_dbo.Customers_CustomerId] FOREIGN KEY %28[CustomerId]%29 REFERENCES [dbo].[Customers] %28[Id]%29 ON DELETE CASCADE);
CREATE TABLE [dbo].[States]([Id] INT IDENTITY %281, 1%29 NOT NULL,
[Abbreviation] NVARCHAR %282%29 NULL,
[Name] NVARCHAR %2825%29 NULL,
CONSTRAINT [PK_dbo.States] PRIMARY KEY CLUSTERED %28[Id] ASC%29);
Thanks,
Dan
Mike,
Just as a heads-up, Tony beat us both to the punch and just sent a nice code-base over for Node.js/Express/MongoDB. I didn't want you wasting any time on it since I know were considering doing some work there. I put in a little work but not enough to worry about. :-) Thanks for the offer to work on that. I'm open to other back-ends too and may look into some other options for people to have as a reference.