Giter Site home page Giter Site logo

token-filter's Introduction

Token Filter App

My aim in this project is to understand servlet filters and how to manage token headers in the request and response headers. I had a chance to experience the Inversion Of Control principle and its implementation via Dependency Injection.

In this application, a simple token-based authentication and authorization method is adopted. The token contains expiration data and some unique random characters. There are a number of protected paths that require a valid token to be accessed. The existence of a valid token header is examined using two separate filters: token filter and authorization filter. token filter checks if token is not expired and exists in the database. After that, the authorization filter checks if the requested path or resources are allowed to be accessed by the requesting user. Furthermore, the application provides some other features such as CRUD for users and products.

The application has three main layers: repository for data access, service for business logic, and controller for handling restful HTTP requests. Besides these modules, it has config, filter, model, error, etc. Shortly, the application is split into modules for ease of development and separation of concerns.

So, Spring Data JPA, JdbcTemplate, Lombok, Servlet Filter are used.

Modules in the app:

image-20230824171726848

General view of the HTTP methods

image-20230824172134302

FRONTEND

The front end is developed using React. State management uses Redux Tool-Kit with asyncThunks. Axios is used for API calls. Bootstrap is used to make the design a bit attractive.

Landing page

image-20230824170608891

Login Page

image-20230824170526848

Register Page

image-20230824170642562

Profile

image-20230824170717859

Profile - Edit

image-20230824170751488

User Operations

image-20230824170946649

When opening user home page, if the token is expired, user is forced to log out automatically.

image-20230824171213557


token-filter's People

Contributors

nhty avatar

Watchers

 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.