Giter Club home page Giter Club logo

asp.netcore_3.1-postgre_startupproject's Introduction

Startup Role Management Project for Asp.Net Core 3.1 with PostGRE - perfect for deployment in Linux Server

This application is created with ASP.Net Core 3.1 and PostGRE SQL (any version, tested with v11-v13). This project is a perfect startup place for a project targetting to deploy in Linux server. HTML, CSS, JS minifire all are configured in the project for better performance.

Easy Run and Deploy with Requirements

To run this project, CLI can be enough, but Visual Studio is recommanded because it offers various features to devs.

Prerequisite

  1. ASP.Net Core SDK
  2. PostGRE SQL Server, tested with 11+, should work with any version
  3. Visual Studio 2019

Running with VS

To run this project with Visual Studio 2019, you need to install the dotnet SDK in PC and a PostGRE connection string (connection string comes from PostGRE server which can exists in dev PC or remote server). After having both, you need to change this line in code with your connection string. Then if you build and run the code, everything would be OK.

To apply the migration, you need to run migration update command in package manager console. The command is-

Update-Database

To get the package manager console, you need to go here in VS 2019-

  • Tools -> Library Package Manager -> Package Manager Console

Most common migration commands are added in this project and can be found in here.

CSS and JS library with bundling and minification

Minimal configuration and easy to deploy library manager, bundler and minifire is used in this project which can be easily deployed in linux along with windows easily with zero configuration.

Library management with Libman with different source

All CSS and JS library are managed by libman which is one of the bset option for managing client side libraries. The file can be found in here and look like this- Libman file where default provider is set to cdnjs and can be set to anything like jsdelivr or anything. All file download directory is set and only required files are downloaded, so list of required files are found from the included file in the libman.json file. No custom CSS and no custom JS are applied

Bundling and Minification

Bundling and minification is configured with this file which is very easy to configure and used. More can be found in here. The file is looking like this-

libman easy configuration

which generates a css file named site.min.css and a js file named site.min.js which includes all CSS and js file compliation including all libraries.

In the project, there is stored 1 custom CSS file can be found in here and one custom js fle can be found in here which is also configured with bundler and minifire. No code is added in the 2 file because of providing freedom to the developer who wishesh to use this project and customize it on his demand. AS well this 2 file is added to the bundler so that a developer who forks this repo, can know how to configure his own repo. And finally, version number is appended with the CSS and JS so that CSS and JS caching issue can't happen because after each build, browser will treat every CSS and JS as new one.

Database and Migration with Seed

PostGRE SQL is used because it is most robust open source database having support for both relational DB and text based DB. In this project I am using the DB as a relational DB. The configuration of the database can be done from here so that anyone can configure individual DB for both deployment and development.

Migration

All migration files are configured to be stored in this folder. Useful migration commands can be found from here.

Seed

Seeds are configured in here. After adding a seed, you need to run this command-

Add-Migration <Seed_Migration_Name>
Update-Database

Replace <Seed_Migration_Name> with your seeder-migration name.

Default Superadmin set with seeder is-

Authentication and Authorization

In this project Role based authintication is implemented.

In this project, Role based authontication is implemented and some specific roles are created depending on an enum defined in here. And also Any user can be assigned with any role and a user can have multiple roles. Moreover, the filtering based on different places are applied in following places-

  1. Controller Level can be found in here
  2. Action level can be found in here
  3. Razor page sections can be filtered with role can be found in here
  4. Add multiple roles on a Cntroller/Action/Razor page can be found in here
  5. Username change limit added and set limit to 10 by default
  6. 2FA with Google authinticator is added Custom attributes are defined in here which is used to convert enum to attribute.

Application UI and Screen Shots

All forms has front end and back end validation at a same time.

  1. Landing Page Landing Page
  2. Registration page Login Page Design
  3. Login page Login Page Design
  4. Normal User View Login Page Design
  5. Super-Admin User View Login Page Design
  6. Access Denied page for any unauthorised access Login Page Design
  7. 2FA for user Login Page Design
  8. Profile Page Login Page Design
  9. Role Page Login Page Design
  10. User-Role Management Page Role List by User and Change User Role

and basic operation pages.

Some important partials

  1. Header partial are seperated and can be found in here
  2. Footer partial are seperated and can be found in here
  3. Navbar partial are seperated and can be found in here

asp.netcore_3.1-postgre_startupproject's People

Contributors

abrarjahin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

abrarhasin

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.