Git Product home page Git Product logo

vianneydoleans / blogcore Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 6.0 1.26 MB

Powerful .NET 8 Blog API. Create your own custom front-end or explore a complete blog API. Contains Swagger, OAuth2, Clean code, Resource based authorization, Advanced search (Specification pattern) and much more.

Home Page: https://blogcore.fly.dev/swagger

License: GNU General Public License v3.0

C# 99.88% Dockerfile 0.12%
blog api dependency-injection entity-framework-core repository-pattern specification-pattern service-pattern code-first-approach dto tests

blogcore's Introduction

BlogCore.

Powerful .NET 8 Blog API

Create your own custom front-end or explore a complete blog API.

build codecov License: GPL v3 Security Rating Maintainability Rating Reliability Rating Vulnerabilities

Live demo : https://blogcore.fly.dev/swagger

Powerful features

  • Advanced search by combining criteria (filters) on all resources
  • Advanced user permissions management by creating roles and permissions for users via the API at runtime (combination of Permission-Based Authorization & Resource-based Authorization)
    • ex: create a role "mini-moderator" with the permissions CanEdit own Posts, CanDelete All Comments, etc.
    • Default role(s) given to new users can also be defined via the API.
  • Complete community features (create comments on a post, like a comment or a post, add a comment on a comment, consult profiles, etc.)
  • Configurable log system that logs all user actions / events (implementation of Serilog library, can be connected to Kibana, Seq and other solutions, for monitoring)
  • CRUD is provided on all resources. Everything can be manipulated via endpoints, giving the possibility out-of-the-box to develop an admin interface or a mobile app. (current Swagger interface can act as an administrator interface)
  • Pagination strategy has been implemented.
  • OAuth2.0 standard (access / refresh token) has been implemented for authorization.
  • Email SMTP configuration : Email confirmation & password reset are provided by sending emails (can use Gmail SMTP server for example)

Clean code

  • Good code coverage
  • The Project was developed by relying on guidelines from DDD (Domain Driven Design) and Clean Code Book by Robert C. Martin.
  • SonarCloud used to ensure code quality
  • Implementation of End-to-End Testing to ensure the functioning of Blog Core API endpoints.
  • Utilization of Resharper and SonarLint during the development process to enhance code quality and consistency.
  • The project follows Conventional Commits and Git Feature Workflow with Develop Branch, ensuring a clean and organized git history with meaningful and clear commit messages.
  • Code Quality is one of the main focuses on this project

Compatibilities

Compatible with Linux / Windows / MacOS and can be deployed with SQL Server or PostgreSQL database.
Docker is also available (Dockerfile at the root of the project).

Technologies

Getting Started

Prerequisites

Installation

  • Open appsettings.json file inside BlogCoreAPI project and edit the database settings :

For Microsoft SQL Server :

"DatabaseProvider": "MsSQL",
"ConnectionStrings": {
 "Default": "Server=.;Database=BlogCore;Integrated Security=True;TrustServerCertificate=True;"
}

For PostgreSQL :

"DatabaseProvider": "PostgreSQL",
"ConnectionStrings": {
 "Default": "Host=localhost;Port=5432;Database=BlogCore;Username=postgres;Password=[YourPassword];"
}

Then in visual studio :

  1. Set BlogCoreApi as project to run
  2. Open the Package Manager Console (Tools -> Nuget Package Manager -> Package Manager Console).
  3. In the package Manager Console, select DBAccess as Default project
  4. Run the following commands:
  • Microsoft SQL Server
Add-Migration CreateInitialDatabase -Context MsSqlDbContext
Update-Database -Context MsSqlDbContext
  • PostgreSQL
Add-Migration CreateInitialDatabase -Context PostgreSqlDbContext
Update-Database -Context PostgreSqlDbContext
  1. Now press F5 and run the application.
  2. Refresh the page. The API was busy filling the default data in the database. Now it can respond.

Default Users, Roles and Permissions

Users

Default users are :

User Password Role(s)
Sam 0a1234A@ User
Frodon 0a0000A@ User
Jamy 0JamyRedactA@ User, Redactor
Fred 0FredRedactA@ User, Redactor
AdminUser 0adminPasswordA@ User, Admin

Defalt Roles and Permissions

Roles and permissions can be created / configured by API endpoints.
The default configuration is :

User :

CanRead CanCreate CanUpdate CanDelete
Category All
Comment All Own Own Own
Like All Own Own Own
Post All
Tag All
User All X X X
Role All
Permission All X
Account Own Own Own

Redactor :

CanRead CanCreate CanUpdate CanDelete
Category All
Comment
Like
Post Own Own Own
Tag All
User X X X
Role
Permission X
Account

Admin :

CanRead CanCreate CanUpdate CanDelete
Category All All All All
Comment All All All All
Like All All All All
Post All All All All
Tag All All All All
User All X X X
Role All All All All
Permission All All X All
Account All All All All

Wiki

A wiki for this project is available on github : link
The wiki give more explanations about configuration, online deployment (render, heroku) and architecture of the project.

blogcore's People

Contributors

vianneydoleans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

blogcore's Issues

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.