Flexibility, Simplicity, Extensibility - Habitat Sitecore Framework
Recently I got an opportunity to go through the sitecore habitat website architecture for one of my new excited sitecore project.
I already heard a lot about sitecore habitat, and after reviewing it, I can say this is one of the best modular architecture/Design/framework/principles/code guidelines by the sitecore.
“Modular Architecture is exactly what you think it is — a way to manage the complexity of a problem by breaking them down to smaller manageable modules. The difference is, as a software architecture style, it has some guidelines, principles and patterns”
Sitecore habitat is the best design/implementation example for modular architecture pattern; here developer can learn how to create the best sitecore architecture for enterprise level projects.
Habitat picked the best market tools in the architecture like:
- ASP.NET MVC
- Css Extension Language Sass
- Package management: NuGet, Node (npm) and Bower
- Sitecore tools: Sitecore Instance Manager and Sitecore Rocks
- Build scripts: Gulp
- Item serialization: Unicorn 3
- CI server: TeamCity
- Unit tests: xUnit
First of all, I would like to thanks Martina Welander for this nice video, which explain how to install and configure Sitecore habitat.
Here I am sharing my experience when I installed/configured the habitat site.
I configured the site with different domain and host name called
Below are some hiccups that I faced during the sitecore habitat site installation:
Unable to install “npm install” command
This is the first issue I faced because 188.8.131.52 IP is blocked in my proxy network, so if you are working under proxy, kindly update it, or try to install NPM package on open network.
NOTE: first you need to install node.js installer in your project source code location. https://nodejs.org/en/
Initially my build failed for Sitecore.Foundation.Forms because I didn’t install WFFM package, install the package and run the Copy-Sitecore-Lib command to resolve this issue.
I faced permission while I run the publish-all-project command
After giving the full permission to my website folder, it worked.
Now time to sync the item in sitecore through UNICORN,
“Kamsar made the developer life easily to build the sitecore best serialization tool called Unicorn” with free of cost, Thanks Kamsar for such a nice product.
After sync the Habitat project item into the sitecore, all serialize item came to my master database but somehow it’s didn’t published automatically, so I published manually.(you can publish manually if not appears in web database)
Everything worked fine in preview mode but once I checked with live mode(web database) it through the below error:
Value cannot be null. Source File: C:\websites\Habitat.dev.local\src\feature\Demo\code\Repositories\OutcomeRepository.cs Line: 66
As xdb is not installed in my application that’s why this error occurred, the quick turned around I found to disable the xdb setting from the below configuration
Go to > \Website\App_Config\IncludeSitecore.Xdb.config
And set the value of <setting name="Xdb.Enabled"> and Xdb.Tracking.Enabled to false like below
Everything worked fine now; oops I found one more issue
All links are targeting on http://habitat.dev.local host name but I configured my domain as habitatlocal and changed my all the setting as well.
My host name is different from http://habitat.dev.local but still somehow it’s used in the link manager all links are generated with prefix http://habitat.dev.local host name it means internally somehow its take this host name but I have changed the host name entry in publishsettings.targets file as defined in gitub installation guide.
To solve this problem, I found the quick workaround to add one more host entry in my website binding:
And add the host name in host entry under c:\Windows\System32\drivers\etc\hosts
Now I can browse my site properly
Below are some screen shots:
Happy Sitecore Habitat
I hope it will help you, if you face some issue; feel free to comment your thought or suggestion.