A local JWT Token Explorer running in a Docker container, powered by React. This application allows users to decode, verify, and sign JSON Web Tokens (JWTs) through a user-friendly interface. Built with a React frontend and an Express backend, it’s designed for developers to test and explore JWTs locally.
- Features
- Prerequisites
- Installation
- Usage
- Project Structure
- Docker Setup
- Testing
- Contributing
- License
- Contact
- Decode JWTs: View the header, payload, and signature of a JWT.
- Verify JWTs: Validate a JWT using a provided secret key.
- Sign JWTs: Generate a new JWT with a sample payload and custom secret.
- Responsive UI: Built with React and Material-UI, featuring a clean interface with a logo (
client/public/logo.png). - Dockerized: Run the app in a single container using Docker Compose.
- CORS Support: Seamless development with separate frontend (
http://localhost:3001) and backend (http://localhost:3000).
- Node.js (v20 or higher)
- Docker and Docker Compose (for containerized deployment)
- Git (to clone the repository)
- IntelliJ IDEA (optional, for development and debugging)
-
Clone the Repository:
git clone https://github.com/ChristianPacifici/costanza-jwt-token-explorer.git cd costanza-jwt-token-explorer -
Install Backend Dependencies:
cd backend npm install -
Install Frontend Dependencies:
cd client npm install -
Add Logo (if not already present):
- Place a
logo.pngfile inclient/public/(e.g., a 300x60px image). - The logo is displayed in the app header and this README.
- Place a
-
Start the Backend:
cd backend npm start- Runs the Express server on
http://localhost:3000.
- Runs the Express server on
-
Start the Frontend:
cd client npm start- Runs the React app on
http://localhost:3001.
- Runs the React app on
-
Access the App:
- Open
http://localhost:3001in your browser. - Use the interface to decode, verify, or sign JWTs.
- Open
-
Build and Run:
docker-compose up --build
- Builds the Docker image and starts the container.
- The app is available at
http://localhost:3000.
-
Stop the Container:
docker-compose down
costanza-jwt-token-explorer/
├── backend/ # Express backend
│ ├── node_modules/
│ ├── package.json # Backend dependencies
│ └── server.js # Express server with JWT logic
├── client/ # React frontend
│ ├── node_modules/
│ ├── public/
│ │ └── logo.png # Application logo
│ ├── src/
│ │ ├── App.jsx # Main React component
│ │ ├── components/
│ │ │ └── JwtForm.jsx # JWT input and processing component
│ │ └── index.jsx # React entry point
│ ├── package.json
├── .dockerignore # Ignores node_modules, etc.
├── .gitignore # Ignores build artifacts
├── Dockerfile # Builds backend and frontend
├── docker-compose.yml # Docker Compose configuration
└── README.md # Project documentation
The app is containerized using a single Docker image, defined in Dockerfile and orchestrated with docker-compose.yml. The React frontend is built and served by the Express backend on port 3000.
- Dockerfile: Builds the React app (
client/) and copies the backend (backend/), then runsnode backend/server.js. - docker-compose.yml: Defines a single service (
jwt-explorer) with port mapping3000:3000.
To customize:
- Update
docker-compose.ymlfor environment variables (e.g., port changes). - Ensure
client/public/logo.pngis present for the logo to display.
Test the app with the following JWT token:
- Token:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJleHAiOjE3MTYyMzkwMjJ9.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c - Secret:
your-256-bit-secret
- Open
http://localhost:3000(Docker) orhttp://localhost:3001(development). - Enter the JWT in the “JWT Token” field.
- Decode: Click “Decode” to view the header and payload.
- Verify: Enter the secret and click “Verify” to validate the signature.
- Sign: Enter a secret (or use default) and click “Sign Example” to generate a new token.
{
"header": {
"alg": "HS256",
"typ": "JWT"
},
"payload": {
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022,
"exp": 1716239022
},
"signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/YourFeature). - Commit changes (
git commit -m 'Add YourFeature'). - Push to the branch (
git push origin feature/YourFeature). - Open a Pull Request.
MIT License
Copyright (c) 2025 Christian Pacifici
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Author: Christian Pacifici
- GitHub: ChristianPacifici
- Issues: Report issues here
