Skip to content

A full-stack application to check SSL certificates of domains, providing details like validity and expiration. Built with Node.js, Express, and Next.js 13+ using TypeScript.

License

Notifications You must be signed in to change notification settings

itsRkator/ssl-certificate-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSL Certificate Checker

This is a full-stack application that checks the SSL certificates of domains and provides details such as validity, expiration date, issuer, and more. The backend is built using Node.js and Express with JavaScript, and the frontend is built using Next.js 13+ with TypeScript.

The backend handles API requests and returns JSON responses, while the frontend provides a user-friendly interface to input domains and display SSL certificate details.

Table of Contents

  1. Features
  2. Project Structure
  3. Setup Instructions
  4. Environment Variables
  5. Running the Application
  6. Testing the Endpoints
  7. Technologies Used

Features

  • Check SSL certificate details of any domain.
  • Validate SSL certificate status, expiration, issuer, and CRL/OCSP status.
  • Fetch and display all previously checked SSL certificates.
  • Centralized service for API calls to improve maintainability.
  • Frontend uses Next.js with TypeScript for a responsive UI.
  • Backend built with Node.js and Express with REST API endpoints.

Project Structure

project-root/
├── backend/                        # Backend directory for Node.js + Express server (JavaScript)
│   ├── controllers/
│   │   └── sslController.js        # JavaScript controller for SSL checking
│   ├── models/
│   │   └── Certificate.js          # Mongoose model in JavaScript for SSL certificate data
│   ├── routes/
│   │   └── sslRoutes.js            # Routes in JavaScript
│   ├── tests/
│   │   └── api.test.js             # Automated test cases using Jest in JavaScript
│   ├── .gitignore
│   ├── index.js                    # Main server file in JavaScript (entry point)
│   ├── mongo_uri.js                # MongoDB URI configuration in JavaScript
│   ├── package.json
│   └── README.md
└── frontend/                       # Frontend directory for Next.js 13+ application (TypeScript)
    ├── public/
    │   └── favicon.ico             # Site favicon
    ├── src/
    │   ├── app/
    │   │   ├── fonts/              # Directory for custom fonts
    │   │   │   ├── GeistMonoVF.woff
    │   │   │   └── GeistVF.woff
    │   │   ├── globals.css         # Global CSS file for the entire app
    │   │   ├── layout.tsx          # Main layout component for consistent app layout
    │   │   └── page.tsx            # Main page component (Home page)
    │   ├── components/             # Reusable components
    │   │   └── CertificateResult.tsx # Component to display SSL check results in a table
    │   ├── services/               # Centralized API service directory
    │   │   └── apiService.ts       # Centralized API service for all API calls
    │   ├── types/                  # Types directory for TypeScript types
    │   │   └── sslTypes.ts         # Type definitions for SSL data
    ├── .eslintrc.json              # ESLint configuration
    ├── .gitignore                  # Git ignore file
    ├── next-env.d.ts               # TypeScript support for Next.js
    ├── next.config.mjs             # Next.js configuration
    ├── package-lock.json           # Lock file for package versions
    ├── package.json                # Metadata and dependency management
    ├── postcss.config.js           # PostCSS configuration for Tailwind CSS
    ├── README.md                   # Project documentation
    ├── tailwind.config.js          # Tailwind CSS configuration file
    └── tsconfig.json               # TypeScript configuration file

Setup Instructions

Clone the Repository

First, clone the repository to your local machine:

git clone https://github.com/itsRkator/ssl-certificate-checker.git
cd ssl-certificate-checker

Backend Setup

  1. Navigate to the Backend Directory:

    cd backend
  2. Install the Dependencies:

    Make sure you have npm installed. Run the following command:

    npm install
  3. Configure Environment Variables:

    Create a .env file in the backend directory and add the required environment variables. See Environment Variables for more information.

  4. Run the Backend Server:

    Start the backend server by running:

    node index.js

    The server will run on http://localhost:8000.

Frontend Setup

  1. Navigate to the Frontend Directory:

    cd frontend
  2. Install the Dependencies:

    Run the following command to install the necessary packages:

    npm install
  3. Run the Frontend Development Server:

    Start the Next.js development server:

    npm run dev

    The frontend will run on http://localhost:3000.

Environment Variables

Backend Environment Variables

Create a .env file in the backend directory with the following variables:

# .env (backend)

MONGO_URI=mongodb://localhost:27017/ssl_checker  # MongoDB connection string
PORT=8000                                          # Port number for backend server

Running the Application

  • Ensure both the backend and frontend servers are running.
  • Open your browser and go to http://localhost:3000 to access the SSL Certificate Checker interface.

Testing the Endpoints

You can test the backend endpoints using Postman or curl.

  1. Check SSL Certificate of a Domain:

    • Endpoint: GET /api/check-ssl?domain={domain}
    • Example:
    curl --location 'http://localhost:8000/api/check-ssl?domain=google.com'
  2. Get All Checked SSL Certificates:

    • Endpoint: GET /api/certificates
    • Example:
    curl --location 'http://localhost:8000/api/certificates'

Technologies Used

  • Frontend:

    • Next.js 13+
    • TypeScript
    • Tailwind CSS
  • Backend:

    • Node.js
    • Express
    • Mongoose (MongoDB)
    • Axios
    • OCSP

License

This project is licensed under the MIT License.

About

A full-stack application to check SSL certificates of domains, providing details like validity and expiration. Built with Node.js, Express, and Next.js 13+ using TypeScript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published