Skip to content

cofoundry-cms/Cofoundry.Samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cofoundry.Samples

This repository contains samples for Cofoundry, an open source .NET CMS.

Getting Started

Each sample is configured to use a local database provisioned via the docker compose file located in the local-env directory. Run the docker compose file before starting any of the sample sites. For more information on running docker compose see the local-env docs.

Complete Sample Sites

The complete sample sites are the best way to get a feel for how a Cofoundry site works and what the code looks like.

SimpleSite

A simple website implementing content management and some framework features including:

  • Startup registration
  • Page templates
  • Custom page block types
  • Image content
  • Three custom entities - blog post, category and author
  • Querying and display a list of blog posts
  • A blog post custom entity details page
  • A simple contact form
  • Email notifications & email templating
  • Custom error pages
  • Configuration settings

See SimpleSite sample

SPASite

An example demonstrating how to use Cofoundry to create a SPA (Single Page Application) with WebApi endpoints as well as demonstrating some advanced Cofoundry features.

The application is also separated into two projects demonstrating an example of how you might structure your domain layer to keep this layer separate from your web layer.

  • Startup registration
  • Web API and use of IApiResponseHelper
  • Structuring commands and queries using CQS
  • Multiple related custom entities - Cats, Breeds and Features
  • A member area with a registration and sign in process
  • Using an entity framework DbContext to represent custom database tables
  • Executing stored procedures using IEntityFrameworkSqlExecutor
  • Integrating custom entity data with entity framework data access
  • Using the auto-updater to run SQL scripts
  • Email notifications & email templating
  • Registering services with the DI container

See SPASite sample

Individual Samples

These samples focus on specific areas of functionality in Cofoundry.

Mail

This sample shows a couple of examples of how you can use the Cofoundry mail abstraction to send emails, including:

  • Creating custom mail templates
  • Sending mail with IMailService
  • Customizing email notifications for admin panel accounts

See Mail sample

Menus

A bare website showing various examples of creating content editable menus:

  • Simple Menu
  • Nested Menu
  • Multi-level Menu

See Menu sample

PageBlockTypes

A bare website showing various examples of how to implement page block types including

  • Using data model attributes
  • Querying for data
  • Managing related entities and versions

See PageBlockTypes sample

UserAreas

The user areas sample solution contains two projects:

  • AuthenticationSample: A standard credential-based authentication flow with account recovery and account management features.
  • RegistrationAndVerificationSample: A self-service user registration and account verification flow.

AuthenticationSample

This sample is written using ASP.NET Razor Pages and implements the following features:

  • Credential-based authentication (email addresses as usernames)
  • Sign in/sign out
  • Forcing a password change at first sign in
  • Account recovery (AKA "forgot password")
  • Custom mail templates
  • Account management (update, password change, delete)
  • Using ICofoundryHelper in views to query the current user

In this sample users are added via the admin panel.

RegistrationAndVerificationSample

This sample is written using ASP.NET MVC and implements the following features:

  • Self-service user account registration
  • User accounts verified by email
  • Re-sending verification emails
  • Custom user verification mail template
  • Credential-based authentication (separate username and email address)
  • Sign in/sign out
  • Using ICofoundryHelper in views to query the current user

See UserAreas sample

About

Several samples websites for Cofoundry, a .NET CMS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published