Skip to content

Introduce CMS-backed content models, admin area, services, and DB seeding#8

Open
Code-311 wants to merge 1 commit intofinalfrom
codex/create-final-branch-and-rebuild-asp.net-core-mvc-site
Open

Introduce CMS-backed content models, admin area, services, and DB seeding#8
Code-311 wants to merge 1 commit intofinalfrom
codex/create-final-branch-and-rebuild-asp.net-core-mvc-site

Conversation

@Code-311
Copy link
Owner

Motivation

  • Replace hard-coded homepage content with a database-backed content model and provide an admin UI for creating and managing essays, models, tools, media, assets, and static pages.
  • Add authentication and role-based authorization so site content can be managed by administrators and uploaded assets can be served securely.
  • Provide Markdown rendering and an asset service to store and serve uploaded media from the database.
  • Add initial seed data to bootstrap the site for development and production environments.

Description

  • Added Entity Framework Core ApplicationDbContext, entity models under Models/Domain, and EF configuration classes in Data/Configurations to model publishable content like Essay, FrameworkModel, Tool, MediaItem, UploadedAsset, StaticPage, ToolQuestion, and SiteSetting.
  • Implemented admin area controllers and view models under Areas/Admin for CRUD of content (EssaysController, FrameworkModelsController, ToolsController, ToolQuestionsController, MediaItemsController, StaticPagesController, UploadedAssetsController) and added basic Razor views and a shared admin layout.
  • Added public controllers and views to serve content from the database (WritingsController, ModelsController, ToolsController, MediaController, PagesController, AssetsController), plus AccountController and a login view to support sign-in via Identity.
  • Introduced services IMarkdownRenderer/MarkdownRenderer and IAssetService/AssetService to render Markdown and persist uploaded files, and registered them along with Identity and ApplicationDbContext changes in Program.cs (including in-memory DB for development and PostgreSQL for production).
  • Added DatabaseSeeder to create the Admin role, an admin user (password read from configuration), and seed initial essays, models, tools, media, pages, and questions; added appsettings.json and appsettings.Development.json for configuration and updated project references in manpreetsingh.pro.csproj for Markdig, EF Core, Identity, and Npgsql.
  • Reworked front-end assets: new site CSS, JS for theme toggling and localStorage, a logo SVG, and updated Razor layout and public views to consume the new domain models and view models.

Testing

  • No automated tests were added or executed as part of this change; there are currently no unit or integration tests included in the patch.

Codex Task

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant