Skip to content

KronigDev/sens-manager

Repository files navigation

Sens Manager

A web application for managing gaming mouse sensitivity settings across multiple games. Features multi-user support with token-based registration, cross-game sensitivity conversion using yaw values, and advanced calculator metrics.

Features

Core

  • Multi-User System - Admin creates accounts via registration tokens
  • Secure Authentication - JWT-based login with password reset tokens, case-insensitive usernames
  • Multiple Games - Store sensitivity profiles for different games
  • Custom Fields - Define game-specific settings (number, text, dividers, headers)
  • Per-Game Decimal Places - Configure how many decimals each game's sensitivity uses
  • Profile Import - Import and convert profiles from other games with automatic conversion
  • Single Profile Export/Import - Export individual profiles as JSON, import with field validation
  • Game Preset Export/Import - Export complete game configurations, share with friends
  • Dark/Light Mode - Gaming-style theme with glow effects
  • Export/Import - Backup and restore your data
  • Password Visibility Toggle - Show/hide password fields with eye icon
  • Hidden Games - Games without profiles are hidden by default, toggle to show all
  • Profile Drag & Drop - Reorder profiles within a game, order persists in database
  • Clone Profile - Duplicate a profile with one click, opens in edit mode with pre-filled values
  • Primary Profile - Mark one profile per game as primary (★), always pinned to front with glow effect
  • Yaw Value Warning - Yellow warning when yaw differs from default preset value
  • Changelog - View all version changes in an expandable changelog modal

Profile Sharing

  • Share with Users - Send profiles directly to other users by username
  • Inbox - Receive shared profiles, accept or reject them
  • Public Links - Create time-limited view-only links (1h to 1 year), one per profile with remaining time display
  • Public Profile View - Anyone can view profiles via public link without account
  • Privacy Settings - Disable receiving shared profiles in Settings
  • Link Management - View and delete active public links in Settings

Calculator

  • DPI Conversion - Calculate new sensitivity when changing DPI
  • Cross-Game Conversion - Convert sensitivity between games using yaw values
  • Swap Button - Quickly swap source and target games
  • eDPI - Effective DPI (DPI × Sensitivity)
  • cm/360° - Centimeters per full 360° rotation
  • in/360° - Inches per full 360° rotation

Admin Features

  • Invite Users - Generate registration tokens from Users section
  • Password Reset - Generate reset tokens directly in modal with copy button
  • Admin Management - Make or remove admin rights for users
  • Owner Protection - Original admin (Owner) cannot have rights removed
  • User Management - View and delete non-admin users
  • Token History - View all tokens, delete individual or clear all
  • Active Tokens - Full token visible for active, truncated for used/expired
  • Database Backup - Export encrypted backup of entire database (AES-256-GCM)
  • Database Restore - Restore from encrypted backup with password

Tech Stack

  • Frontend: React 19, TypeScript, Tailwind CSS 4, Vite
  • Backend: Express 5, better-sqlite3, JWT
  • Database: SQLite

Installation

Prerequisites

  • Node.js 18+
  • npm

Setup

  1. Clone the repository:
git clone https://github.com/niklask52t/sens-manager.git
cd sens-manager
  1. Install dependencies:
npm install
  1. Create environment file:
cp .env.example .env
  1. Important: Edit .env and set a secure JWT_SECRET:
JWT_SECRET=your-super-secure-random-string-here

Development

Run both frontend and backend in development mode:

npm run dev

This starts:

Production

  1. Build the frontend:
npm run build
  1. Start the server:
# Linux/Mac
npm start

# Windows
npm run start:win

The server serves both the API and the built frontend on port 3001 (or PORT from .env).

First Run

  1. On first access, you'll be prompted to create an admin account (this becomes the Owner)
  2. After login, choose whether to import default game presets
  3. The "first run" state is stored per-user

User Management

Adding New Users

  1. Login as admin
  2. Go to Admin tab
  3. Click "+ Invite User" in the header
  4. Set token expiration time
  5. Share the generated token with the new user
  6. New user clicks "Register with Token" on login page

Password Reset

  1. Go to Admin tab
  2. Click "Reset PW" next to the user's name
  3. Set token expiration time
  4. Share the generated token with the user
  5. User clicks "Reset Password" on login page

Admin Rights

  • Click "Make Admin" / "Remove Admin" next to any user (except Owner)
  • The Owner (first admin) cannot have their admin rights removed
  • Admins can manage users, generate tokens, and access admin features

Database

Location

data/sens-manager.db

Reset Database

To completely reset the application (delete all users, games, profiles):

Windows:

del data\sens-manager.db

Linux/Mac:

rm data/sens-manager.db

The database will be automatically recreated on next server start.

Backup

Simply copy the data/sens-manager.db file.

Default Games

The public/default-games.json file contains preset game configurations:

Game Yaw Value Default Multiplier Decimals
Rainbow Six Siege 0.00572957795 0.02 (ADS) 0
Counter-Strike 2 0.022 2
Valorant 0.07 3

Rainbow Six Siege Special Notes

  • Uses a multiplier (default 0.02) for ADS sensitivity storage
  • Sensitivity values are whole numbers (0 decimal places)
  • Scope magnifications: 1.0x, 2.5x, 3.5x, 5.0x, 12x
  • ADS Mutual Exclusivity: You can either set "Standard ADS Sensitivity" OR individual magnification values - they are mutually exclusive (entering one disables the others)

Calculator Formulas

eDPI (Effective DPI)

eDPI = DPI × Sensitivity

cm/360° (Centimeters per 360°)

cm/360° = (360 × 2.54) / (DPI × Sensitivity × Yaw)

in/360° (Inches per 360°)

in/360° = cm/360° / 2.54

Cross-Game Conversion

Target Sens = Source Sens × ((Source Yaw × Source DPI) / (Target Yaw × Target DPI))

Profile Import

When adding a new profile, click the "Import" button to:

  1. Select a source game with yaw value
  2. Select an existing profile from that game
  3. Choose which field to convert (e.g., Horizontal Sensitivity)
  4. Choose which field to fill in the target game
  5. The value is automatically converted using yaw values

Game Settings

Each game can have:

  • Name - Display name
  • Yaw Value - For sensitivity conversion (game-specific constant)
  • Default Multiplier - For games like R6S that use a multiplier for ADS
  • Decimal Places - How many decimals to round sensitivity to (0 for whole numbers)
  • Custom Fields - Sensitivity fields, dividers, and headers

Security Notes

  • Change the JWT_SECRET in production!
  • Passwords hashed with bcrypt (12 rounds)
  • JWT tokens expire after 7 days
  • Registration/reset tokens are single-use and expire (default 24h)
  • Usernames are case-insensitive (prevents duplicate accounts with different casing)
  • Original admin (Owner) is protected from demotion

Production Deployment (Debian 13)

Complete guide for deploying on a Debian 13 server/container with Nginx reverse proxy.

1. System Preparation

# As root - update system
apt update && apt upgrade -y

# Install required packages
apt install -y curl git nginx build-essential python3

# Create non-root user for the app
adduser --disabled-password --gecos "" sensmanager

2. Install Node.js 20 LTS

curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt install -y nodejs

# Verify
node -v
npm -v

3. Clone and Build

su - sensmanager
git clone https://github.com/niklask52t/sens-manager.git
cd sens-manager
npm install
npm run build
exit

4. Configure Environment

# Generate secure JWT_SECRET
openssl rand -base64 48

# Create .env file (replace SECRET!)
cat > /home/sensmanager/sens-manager/.env << 'EOF'
JWT_SECRET=PASTE_GENERATED_SECRET_HERE
PORT=3001
EOF

# Set permissions
chown sensmanager:sensmanager /home/sensmanager/sens-manager/.env
chmod 600 /home/sensmanager/sens-manager/.env

5. Create Systemd Service (Autostart)

cat > /etc/systemd/system/sens-manager.service << 'EOF'
[Unit]
Description=Sens Manager
After=network.target

[Service]
Type=simple
User=sensmanager
WorkingDirectory=/home/sensmanager/sens-manager
ExecStart=/usr/bin/node --import tsx backend/server.ts
Restart=on-failure
RestartSec=10
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable sens-manager
systemctl start sens-manager
systemctl status sens-manager

6. Configure Nginx Reverse Proxy

cat > /etc/nginx/sites-available/sens-manager << 'EOF'
server {
    listen 80;
    server_name _;

    location / {
        proxy_pass http://127.0.0.1:3001;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_cache_bypass $http_upgrade;

        # Allow all HTTP methods (DELETE, PATCH, etc.)
        proxy_method $request_method;
    }
}
EOF

ln -sf /etc/nginx/sites-available/sens-manager /etc/nginx/sites-enabled/
rm -f /etc/nginx/sites-enabled/default

# Add nginx to PATH (if 'nginx' command not found)
export PATH=$PATH:/usr/sbin

nginx -t
systemctl restart nginx

7. Useful Commands

Action Command
Restart app systemctl restart sens-manager
View logs journalctl -u sens-manager -f
Check status systemctl status sens-manager
Restart nginx systemctl restart nginx

8. Updates

Use the included update script (as root):

# First time only: make script executable
chmod +x /home/sensmanager/sens-manager/update.sh

# Run update
/home/sensmanager/sens-manager/update.sh

The script will ask if you want to reset the application (delete database). Default is No.

Optional: Make update command globally available:

ln -sf /home/sensmanager/sens-manager/update.sh /usr/local/bin/sens-manager-update

Then run sens-manager-update from anywhere.

Or manually:

su - sensmanager
cd sens-manager
git pull
npm install
npm run build
exit
systemctl restart sens-manager

9. Backup

cp /home/sensmanager/sens-manager/data/sens-manager.db /root/backup-$(date +%Y%m%d).db

License

MIT

Author

Programmiert von Niklas Kronig mit Unterstützung von Claude AI


Last reviewed: 2026-04-11

About

Gaming sensitivity manager with cross-game conversion

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages