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.
- Features
- Project Structure
- Setup Instructions
- Environment Variables
- Running the Application
- Testing the Endpoints
- Technologies Used
- 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-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
First, clone the repository to your local machine:
git clone https://github.com/itsRkator/ssl-certificate-checker.git
cd ssl-certificate-checker
-
Navigate to the Backend Directory:
cd backend
-
Install the Dependencies:
Make sure you have
npm
installed. Run the following command:npm install
-
Configure Environment Variables:
Create a
.env
file in thebackend
directory and add the required environment variables. See Environment Variables for more information. -
Run the Backend Server:
Start the backend server by running:
node index.js
The server will run on
http://localhost:8000
.
-
Navigate to the Frontend Directory:
cd frontend
-
Install the Dependencies:
Run the following command to install the necessary packages:
npm install
-
Run the Frontend Development Server:
Start the Next.js development server:
npm run dev
The frontend will run on
http://localhost:3000
.
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
- 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.
You can test the backend endpoints using Postman or curl.
-
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'
- Endpoint:
-
Get All Checked SSL Certificates:
- Endpoint:
GET /api/certificates
- Example:
curl --location 'http://localhost:8000/api/certificates'
- Endpoint:
-
Frontend:
- Next.js 13+
- TypeScript
- Tailwind CSS
-
Backend:
- Node.js
- Express
- Mongoose (MongoDB)
- Axios
- OCSP
This project is licensed under the MIT License.