Skip to content

Getting Started

Amit Das edited this page Apr 28, 2026 · 1 revision

🚀 Getting Started

Welcome to the SecureAuth setup guide.

This guide will help you install and run SecureAuth locally for development.


📋 Requirements

Before starting, make sure you have:

  • Node.js 18+
  • npm
  • Firebase Realtime Database
  • TextSnap API credentials

📦 Clone Repository

git clone https://github.com/AmitDas4321/SecureAuth.git

cd SecureAuth

📥 Install Dependencies

npm install

⚙️ Configure Environment Variables

Create a .env file in the project root.

Example:

# ===============================================
# SecureAuth Environment Configuration
# ===============================================

APP_NAME="SecureAuth"

APP_URL="http://localhost:3000"

# TEXTSNAP CONFIGURATION

TEXTSNAP_INSTANCE_ID="YOUR_INSTANCE_ID"

TEXTSNAP_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"

# FIREBASE CONFIGURATION

FIREBASE_DATABASE_URL="YOUR_FIREBASE_DATABASE_URL"

FIREBASE_DATABASE_SECRET="YOUR_FIREBASE_DATABASE_SECRET"

# SECURITY CONFIGURATION

JWT_SECRET="YOUR_SUPER_SECRET_KEY"

ENCRYPTION_KEY="YOUR_ENCRYPTION_KEY"

▶️ Start Development Server

Run:

npm run dev

Open:

http://localhost:3000

🔐 Authentication Flow

SecureAuth authentication process:

  1. User enters phone number
  2. OTP generated securely
  3. OTP sent via WhatsApp
  4. User verifies OTP
  5. JWT session created securely
  6. Session stored securely
  7. User accesses protected dashboard

📱 Features Available After Login

  • Authenticator account management
  • Multi-device sessions
  • Encrypted cloud sync
  • Backup & restore system
  • App lock protection
  • Session monitoring

🛠 Development Commands

Start Development Mode

npm run dev

Build Project

npm run build

Start Production Server

npm start

📂 Recommended Project Structure

SecureAuth
├── src/
├── public/
├── server.ts
├── package.json
├── vite.config.ts
├── .env
└── README.md

⚠️ Common Issues

Port Already In Use

lsof -i :3000

Kill process:

kill -9 PID

Vite Host Blocked

Add allowed hosts inside vite.config.ts

server: {
  allowedHosts: ['yourdomain.com']
}

✅ Next Steps

Continue with:


Secure • Fast • Modern ⚡

Clone this wiki locally