Giter Site home page Giter Site logo

unrealbg / blazorblog Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 4.26 MB

This repository contains the Blazor Blog project, built using the latest Blazor Web App template. The goal is to create a modern, responsive blog leveraging the capabilities of Blazor for fast and interactive user interfaces.

License: MIT License

C# 24.56% HTML 11.46% CSS 63.84% JavaScript 0.15%
blazor csharp dotnet blazor-web-app asp-net-core web-development serverside-rendering

blazorblog's Introduction

Blazor Blog Project

Overview

Welcome to the Blazor Blog Project! This repository hosts a modern, responsive blog application, built using the latest Blazor Web App template. Our goal is to leverage Blazor's capabilities to deliver fast and interactive user interfaces, ensuring an engaging and seamless experience for our users.

Features

  • Blazor Web App: Utilizes the latest Blazor framework for building interactive web UIs using C# instead of JavaScript.
  • Responsive Design: Ensures a smooth experience across various devices and screen sizes.
  • Interactive UI: Offers dynamic user interactions with minimal latency.

Screenshots

Below are some screenshots showcasing the different aspects and features of the Blazor Blog Project.

Main View

Main View of Blazor Blog The main landing page of the Blazor Blog, showing an overview of the blog's layout and design.

Recent Posts

Recent Posts on Blazor Blog Continuation of the main view, displaying the latest blog posts.

Dashboard

Dashboard on Blazor Blog The dashboard interface for managing the blog.

Manage Categories

Manage Categories on Blazor Blog The section for managing blog categories.

Manage Blog Posts

Manage Blog Posts on Blazor Blog Interface for managing individual blog posts.

Manage Subscribers

Manage Subscribers on Blazor Blog The section dedicated to managing blog subscribers.

Create a New Blog Post

Create New Blog Post on Blazor Blog The interface for creating a new blog post.

Create a New Category

Create New Category on Blazor Blog The interface for adding a new category to the blog.

Getting Started

To get started with the Blazor Blog project, follow these steps:

Prerequisites

  • Install .NET 8.0 SDK or later.
  • Recommended: Visual Studio 2022 or later with the ASP.NET and web development workload.
  • A SQL Server instance for the database (or adjust the database provider as per your choice).

Clone the Repository

git clone https://github.com/unrealbg/BlazorBlog.git

Configure Admin User

Before running the application, you need to configure the AdminUser settings in the appsettings.json file:

"AdminUser": {
  "Name": "Admin",
  "Email": "[email protected]",
  "Password": "Admin@123",
  "Role": "Admin"
}

This step is crucial to ensure the application initializes correctly with an admin user account.

Database Migrations

Before running the application, ensure that the database is up-to-date with the latest migrations:

  1. Navigate to the Project Directory

    • Go to the folder where the *.csproj file is located.
  2. Update the Database

    • Run the following command to apply the latest migrations:

      dotnet ef database update

Run the Application

  • Navigate to the project directory.
  • Run the following command:
dotnet run

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/NewFeature)
  3. Commit your Changes (git commit -m 'Add some NewFeature')
  4. Push to the Branch (git push origin feature/NewFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Zhelyazko Zhelyazkov - [email protected]

Project Link: https://github.com/unrealbg/BlazorBlog

blazorblog's People

Contributors

unrealbg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mediaobjects

blazorblog's Issues

Fail create post

I have tried, nothing is modified to just post one blogpost and i have this error :
` Microsoft.EntityFrameworkCore.Database.Command[20101]
Executed DbCommand (2ms) [Parameters=[@p0='?' (DbType = Int32), @p1='?' (Size = 4000), @p2='?' (DbType = DateTime2), @p3='?' (Size = 4000), @P4='?' (Size = 500), @p5='?' (DbType = Boolean), @p6='?' (DbType = Boolean), @P7='?' (DbType = Boolean), @p8='?' (DbType = DateTime2), @p9='?' (Size = 125), @p10='?' (Size = 100), @p11='?' (Size = 450), @p12='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
SET IMPLICIT_TRANSACTIONS OFF;
SET NOCOUNT ON;
INSERT INTO [BlogPosts] ([CategoryId], [Content], [CreatedAt], [Image], [Introduction], [IsDeleted], [IsFeatured], [IsPublished], [PublishedAt], [Slug], [Title], [UserId], [ViewCount])
OUTPUT INSERTED.[Id]
VALUES (@p0, @p1, @p2, @p3, @P4, @p5, @p6, @P7, @p8, @p9, @p10, @p11, @p12);

fail: Microsoft.EntityFrameworkCore.Update[10000]
An exception occurred in the database while saving changes for context type 'BlazorBlog.Data.ApplicationDbContext'.
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details.
---> Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot insert the value NULL into column 'Image', table 'BlazorBlog.dbo.BlogPosts'; column does not allow nulls. INSERT fails.
at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at Microsoft.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows)
at Microsoft.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)
at Microsoft.Data.SqlClient.SqlDataReader.ReadAsyncExecute(Task task, Object state)
at Microsoft.Data.SqlClient.SqlDataReader.InvokeAsyncCall[T](SqlDataReaderBaseAsyncCallContext1 context) --- End of stack trace from previous location ---

A problem with the image upload it's look like

Null reference error

Where's the AdminUser section in the appsettings file? This is causing a null reference error because it's null

this._adminUserSettings = config.GetSection("AdminUser").Get();

if (await this._roleManager.FindByNameAsync(this._adminUserSettings.Role) is null) <- error here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.