Skip to content

biagioiorio/public-ip-logger-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Public IP Logger API

🌐 A lightweight, privacy-conscious API for logging click events and redirecting users while avoiding permanent IP storage.

πŸš€ Features

  • Log incoming user clicks via a simple API
  • Capture and log user agent and IP (configurable to hash/store it)
  • Timestamped records in a MySQL database
  • Lightweight redirect handler with tracking
  • Built with Spring Boot

πŸ“¦ Endpoints

POST /api/logs

Logs a click or visit event.

Request Body:

{
  "hashedIp": "hashed_ip_1",
  "userAgent": "user_agent_1"
}

GET /api/logs

Returns all logged entries.


GET /r?to=URL

Logs the visit and redirects to the given URL.

Example:

/r?to=https://google.com

βš™οΈ Technologies

  • Java 21
  • Spring Boot 3
  • MySQL (configurable)
  • Maven

πŸ› οΈ Setup

  1. Clone the repo

    git clone https://github.com/biagioiorio/public-ip-logger-api.git
  2. Configure your application.properties with your DB credentials:

    spring.datasource.url=jdbc:mysql://localhost:3306/public_ip_logger
    spring.datasource.username=root
    spring.datasource.password=yourpassword
    spring.jpa.hibernate.ddl-auto=update
  3. Run the application:

    ./mvnw spring-boot:run

πŸ“Œ Roadmap

  • Redirect with logging
  • IP + User-Agent logging
  • Optional IP hashing
  • .env support for credentials
  • Access stats endpoint

πŸ“„ License

This project is licensed under the GNU General Public License v3.0 – see the LICENSE file for details.

About

🌐 Privacy-friendly public IP logger API for redirects and click tracking. No IPs are stored permanently.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages