Skip to content

yerofey/api.secred.link

Repository files navigation

api.secred.link

License: MIT

The backend API for secred.link app - a secure, self-destructing secret sharing service

🌐 Visit secred.link | Frontend Repository

Overview

This is the backend service powering secred.link, a secure platform for sharing sensitive information. It provides a RESTful API for creating, retrieving, and managing self-destructing secrets.

Features

  • Secure secret sharing with encryption
  • Configurable expiration times
  • Burn-on-read functionality
  • High-performance Fastify-based API
  • Built-in rate limiting and security headers
  • Usage metrics and analytics

Prerequisites

  • Node.js
  • MongoDB database

Installation

1; Clone the repository:

git clone https://github.com/yerofey/api.secred.link.git
cd api.secred.link

2; Install dependencies:

npm install

3; Create a .env file with the following variables:

PORT=3000
MONGODB_URI=your_mongodb_connection_string
DB_COLLECTION_SECRETS=secrets
DB_COLLECTION_COUNTERS=counters

Development

Start the development server:

npm run dev

Production

Deploy using PM2:

npm start

API Documentation

Create a Secret

POST /secret/create

Creates a new secret with the following properties:

  • content: The secret content
  • is_protected: Boolean indicating if the secret is password protected
  • is_burnable: Boolean indicating if the secret should be deleted after reading
  • expires_at: ISO date string for secret expiration

Retrieve a Secret

GET /secret/get/:accessKey

Retrieves a secret using its access key.

Delete a Secret

DELETE /secret/delete/:accessKey/:manageKey

Deletes a secret using its access key and management key.

Get Metrics

GET /data/metrics

Returns usage statistics and metrics.

Security Features

  • Rate limiting (100 requests per minute)
  • CORS protection
  • Security headers via Helmet
  • Input validation
  • Automatic JSON parsing

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Author

Yerofey S.

License

MIT

About

API for secred.link app - a secure, self-destructing secret sharing service

Resources

License

Stars

Watchers

Forks