Giter Site home page Giter Site logo

pikselinweb / user-management Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 7.0 1.35 MB

An angular app to manage users.

JavaScript 1.70% TypeScript 75.49% HTML 20.01% SCSS 2.79%
angular angularmaterial angularforms typescript angular-starter angular-boilerplate angular13

user-management's Introduction

User Authorization Project

Welcome to User Management App! There is 3 types (Super Admin, Admin, Customer) of roles. This app has 6 pages (Login, Register, Home, User Listing, 401 and 404).

Some available accounts:

Running App

After install depencies with npm start command you can run json server and Angular development server easily.

Rules

  • All users can view Homepage when they logged in. Homepage protected by LoginGuard (Router-Guard) that allow to only authorized users. If user have not token will be redirect to Login page.
  • Navigation provided by Navbar buttons by using RouterLink. User List button will be hidden if you are not Super Admin.
  • User List page protected by AdminGuard (Router-Guard) that allow to access only users has role Super Admin. If Customer try to go User List page will be redirect to 401 - Forbidden page.
  • Edit user, add user, delete user functions available in User List page.
  • Username cannot be change because of used to login. Also changing the password is not allowed.
  • Admin can't change user roles and can't list other admins. When admin create a user, user's role will be Customer by the default. Also Admin can delete only customers.
  • Super Admin can update role and can list all users.
  • Super Admin can't delete itself, but can delete other Super Admin's accounts.
  • Everyone can login or register to application. But if logged user try to reach Login or Register page will be redirect to Home page. Login and Register pages protected by NotLoginGuard (Router-Guard).
  • This app uses JSON Server for creating fake database and JSON Server Auth to manage login - register operations. By the way auth token has 1 hour life time.

Roles

  • Super Admin (role value: 3)
  • Admin (role value: 2)
  • Customer (role value: 1)

About App

  • Created with Angular v13
  • Uses Angular Material Framework for app compoments
  • CSS template engine is SCSS
  • Bootstrap Reboot, Bootstrap Grid, Bootstrap Tables and Bootsrap Aler imported with Sass
  • Ngx Cookie Service used to handle cookies
  • User ids gererated with uuid
  • concurrently used to run multiple script commands in same time

TO DO

  • NGRX should be use to state managament
  • Usualy i use toPromise() for converting observables to promise then use in async functions with await. I think it make codes more readable and avoid problems like cold observale and unsubscribe. Now toPromise() is depraced, need to find new method instead of it.

Known Issues

  • When Super Admin change its account role to Admin still can use Super Admin privileges. To fix this issue should be disabled role input on user form if current user is same.

Screen Shoots

Login - Register And Angular Form Validation

Login Page

Register Page

Angular Form Validation Error

Angular Form Validation

Customer

Home Page

User Menu

Admin

Admin User List

Admin Create New User

Admin Edit User

Admin User List

Super Admin

Super Admin User List

Super Admin Create New User

Super Admin Edit User

Super Admin User List

user-management's People

Stargazers

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

Watchers

 avatar  avatar  avatar

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.