Author Topic: Using bootstrap and MVC for website  (Read 2887 times)

0 Members and 1 Guest are viewing this topic.

Jeff H

  • Needs a day job
  • Posts: 6150
Using bootstrap and MVC for website
« on: July 29, 2014, 02:47:37 PM »
For creating simple websites that look good in my opinion  for non-designers this is turning out to be fairly easy and look pretty good, especially for a company website.

Bootstrap is a open-source Responsive or Mobile first framework used for websites.

You can google how its grid works and how you define columns for mobile, desktop or different devices.

If you or whoever can spring $15 you can buy a theme from WrapBootStrap you basically create a MVC app and rip out header and footer to place in _Layout.cshtml(Master Layout) then pull out the contents you like to place in your views and update links to images, css and javascript files or use bundling and minification in MVC 4.

Here is the theme I purchased and you click on the links up in the header to see all the different content you get.

The website is for engineering company so not selling anything etc...,  and just a small database so they can upload picture, name, description of new projects them selves but for something small and simple thought it went smoothly and turned out pretty good.






   

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: Using bootstrap and MVC for website
« Reply #1 on: July 29, 2014, 06:05:41 PM »
Yep, I use for any web dev as a base now, it's easy once you use it a few times and as you say, even a base setup looks good as a starter rather than hacking up your own css.

You can also grab the examples to start with from the bootstrap site to give you some ideas on layouts -> http://getbootstrap.com/getting-started/#examples

I've gradually worked my way up to Marionette.js (Backbone.js extension) which you can use to organise your views in the layouts in a logical way, it's pretty cool.
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Using bootstrap and MVC for website
« Reply #2 on: July 29, 2014, 06:20:52 PM »
Cool makes feel like better knowing you are using same technology.

First time messing with web technologies in a while, and this razor @start using c# back to html to me is just awesome.


Was surprised how adding an extra class and a line in web.config file built my database, and Package manager console for updating database.
No nerds required for this stuff. Right now I am loving it.

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: Using bootstrap and MVC for website
« Reply #3 on: July 30, 2014, 06:29:04 PM »
I haven't used any windows web tech as yet, I like to stay agnostic with web tech as the server you run on may not be under your full controll and could be a windows or unix/linux OS.
For that reason I stick to PHP.

My goals are to develop RESTful apis in PHP with html/js client side single page applications, a pretty clean stack. You can use any js framework/library to help here.

For generating and migrating db's etc, frameworks like yii can do all that too and also have built in code generators for MVC and CRUD etc, very slick.

Another good alternative is Ruby On Rails, it is built just for this type of development and is very powerful and well supported, I would probably use this if Ruby was as 'standard' as PHP. Most shared hosting might not have it or let you install it, mine for instance has it but it's a very old version and they won't update it (cPanel). I will most likely move to a VPS soon but if you develop for others they might not have the same flexibility.

The hardest part which I'm working on now is authentication/authorisation, it's not so simple with an SPA. For instance, say you want to port your html/js app to a mobile app using PhoneGap, you don't get a page reload (start session, create csrf tokens etc ) at start up as it's not being published and sent from the server. Very tricky and there's a mess of stuff to weed through to find a good, safe solution.

You learn some good practices and architectures in web dev, very useful for all dev work as separation of concerns, design patterns and test driven development is petty much enforced on you early else you end up in a mess real quick.
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Using bootstrap and MVC for website
« Reply #4 on: July 30, 2014, 07:29:41 PM »
I going all Microsoft on this one because authentication/authorization is already built and updated in MVC 4 to have it right out of the box, and the free azure site to test as an actual deployment then the upgrade to little less than $10.00 a month for using custom domain.


Just too easy and since I got a choice will go Microsoft for easy tooling and maintenance.




MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: Using bootstrap and MVC for website
« Reply #5 on: July 31, 2014, 03:30:05 AM »
Yep, they have a great setup.

Their business model for web and mobile is very good, you can see the changes of moving to mobile/web/cloud services over the last year or so starting to really kick in now. I think their mobile platform may struggle though but the web services section is strong. They are the only company to offer a real turnkey solution for cloud services, the others do also but are built from mixed tech whereas MS have built the whole stack with their own products that work very well together and hide all the 'wiring' together from you.

And you can do all this from VS and use TFS to manage the whole shebang, pretty sweet.

I can't help much with the server side tech but if you get stuck on client side just holler.
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien