Samplestack

Sample Stack

What It Is

Samplestack is a comprehensive sample application designed to show developers how to build a MarkLogic application effectively. It is an actual production application with working code, using a modern three-tiered architecture:

  • MarkLogic plays the role of database in Samplestack‚Äôs three-tier architecture. Samplestack shows how to configure MarkLogic to ingest, store, and manipulate documents. With the project comes tooling and configuration files to get MarkLogic primed to expose robust search and data services.

  • The middle tier brokers the data between the database and the browser-based web application, coordinates integration with additional services (LDAP), locally optimizes application/database communications, and enforces business rules. There are two versions of Samplestack: one version features a Java middle tier with a Spring Framework and Gradle automation and another features a JavaScript and Node.js implementation with gulp automation.

  • The web-based front-end is a Model-View-Controller browser application which drives workflow using the business services exposed by the middle-tier and presents the user interface. It is implemented as an Angular.js application.

The sample application itself is centered around the idea of a Question and Answer site. It is a searchable, transactional, content-rich web application. Users of the application participate in the crowd-sourced knowledge community by asking questions, submitting answers, commenting, and voting. Search is a rich experience with interactive facets and parameters which enable users to narrow in on the answers they seek. The application also uses semantics, which helps by providing related tags that users can click on that are generated based on the semantic relationships with keywords used in searches.

The initial seed data set is an extract of content from the popular Stack Overflow website.

Access the Samplestack Git Repo

Open Box of Sample Code

Why it matters

Samplestack gives you the ability to become proficient with MarkLogic quickly. It will introduce you to the most important concepts of MarkLogic and present you with tangible development patterns to follow. Instantly dive in and explore the Samplestack source code, no training or reading the documentation required. See how the pieces of the architecture fit together in your own environment, using familiar tools and modern technologies. Then, jump start your project by using the features introduced in Samplestack as a starting point for addressing more complex business problems.


The Look of Samplestack

Samplestack is implemented with Angular.js, a JavaScript framework designed specifically for web applications. The user interface provided is clean, modern, and flexible.

marklogic8-samplestack-ask-question-hover-state

Key MarkLogic Concepts

Samplestack’s features demonstrate powerful and unique MarkLogic concepts. Even though it’s a sample application, Samplestack has enterprise-grade features such as transactional multi-document commits and role-based security.
Samplestack Application Feature MarkLogic Concept
Full-text search Indexes, query styles
User records and Q&A documents Data model for JSON and POJOs
Users & roles (log in, log out) Security (authentication and authorization)
Restricted content Role-based permissions
Facets Search constraints, analytics
Ask, answer, comment Document updates
Voting Updates impact search relevance
Accepted answers & reputation Transactional model, data integrity
Related tags Semantics