Common Scenarios

This section provides practical, step-by-step guides for common development tasks in LightNap. Each article walks you through implementing a specific feature or customization, following the established patterns used throughout the application.

Data & Persistence

Backend Seeding

Understand how LightNap’s automatic seeding system works on application startup, including support for environment-specific seeders that enable safe development data without production deployment risks.

Adding Entities

Learn how to add new database entities using Entity Framework, including creating entity classes, updating the DbContext, and generating migrations.

Adding Profile Fields

Extend the user profile with custom fields. This comprehensive example covers the full stack from backend entities to frontend forms, demonstrating the complete data flow pattern.

Scaffolding From an Entity

Use the scaffolding tool to automatically generate boilerplate code for CRUD operations, including backend services, API controllers, and Angular components.

Security & Authorization

Working With Roles

Add and manage application roles for authorization. Learn how to define roles, apply them to endpoints, and use them in the frontend to control access.

Working With Custom Claims

Implement fine-grained permissions using ASP.NET claims. This guide covers claim-based authorization for dynamic, record-level security.

Features

Managing Content

Learn how to create, edit, and publish content using LightNap’s built-in Content Management System. This comprehensive guide covers zones, pages, multilingual content, access control, and frontend integration.

Adding In-App Notification Types

Create new types of in-app notifications to keep users informed about events and activities. Learn how to trigger notifications from backend services and display them in the Angular UI.

Adding Backend Email Scenarios

Implement new transactional email scenarios using T4 templates and the email service. This comprehensive guide walks through creating email templates, adding service methods, and following best practices for reliable email delivery.

Adding User Settings

Implement user-specific settings and preferences that persist across sessions. This comprehensive guide walks through adding the PreferredLanguage setting, demonstrating service integration, automatic fallback logic, and browser language detection.

Reusable Form Components

Learn the architectural pattern for creating reusable form components in LightNap. This guide explores the layered component approach using SelectListItemComponent, UserSettingSelectComponent, and domain-specific wrappers to build type-safe, composable UI elements with minimal boilerplate.

Frontend Customization

Working With Angular Routes

Understand LightNap’s route alias system that makes it easier to manage and refactor Angular routes throughout the application.

Updating the Sidebar Menu

Customize the sidebar navigation menu to add new sections, items, and role-based visibility.


Table of contents