This full-stack application provides a solution for storing, managing, and searching credential data from log files. The system includes:
- Frontend: Vue.js with Vite for a modern, responsive user interface
- Backend: Go with Fiber framework providing a robust API
- Database: PostgreSQL for reliable data storage
- Log Processing: Automatic monitoring and processing of credential log files
hello-world/
├── backend/ # Go Fiber API server
│ ├── go.mod # Go module definition
│ ├── go.sum # Go dependency checksums
│ ├── main.go # Main application entry point
│ ├── logparser.go # Log file parsing functionality
│ ├── watcher.go # File system watcher for log files
│ └── log/ # Directory containing log files to process
├── frontend/ # Vue.js frontend
│ ├── index.html # HTML entry point
│ ├── package.json # Node.js dependencies
│ ├── vite.config.js # Vite configuration
│ └── src/ # Source code
│ ├── App.vue # Root Vue component
│ ├── main.js # JavaScript entry point
│ └── components/ # Vue components
└── start.ps1 # PowerShell startup script
- RESTful API: JSON-based API for data retrieval and management
- Pagination: Built-in pagination support for large datasets
- Search: Advanced search capabilities with multiple filter options
- Log Processing: Automatic parsing and importing of credential data from logs
- File Watching: Real-time monitoring of log directory for new files
- PostgreSQL Integration: Efficient database operations with connection pooling
- Responsive UI: Modern interface that works across devices
- Real-time Updates: Dynamic display of imported data
- Search Interface: User-friendly search with multiple filtering options
- Pagination Controls: Easy navigation through large datasets
| Endpoint | Method | Description |
|---|---|---|
/api/hello |
GET | Simple API health check |
/api/entries |
GET | Get credentials with pagination |
/api/search |
GET | Search credentials with filters |
/api/import-logs |
POST | Trigger log import process |
/api/process-file |
POST | Process a specific log file |
/api/watcher-status |
GET | Check log watcher status |
/api/stats |
GET | Get database statistics |
/api/processed-files |
GET | List processed log files |
You can use the included PowerShell script to start both backend and frontend:
./start.ps1cd backend
go run main.goThe backend server will start on http://localhost:3000
cd frontend
npm install
npm run devThe frontend development server will start on http://localhost:5173
The application includes a sophisticated log processing system:
- Log Watcher: Monitors the
./logdirectory for new.txtfiles - Automatic Processing: New files are automatically detected and processed
- Record Tracking: Processed files are tracked to prevent duplicate entries
- Manual Import: Files can be manually imported through the API
The application uses PostgreSQL with the following tables:
-
entries: Stores credential data
- id (SERIAL PRIMARY KEY)
- url (TEXT)
- username (TEXT)
- password (TEXT)
- created (TEXT)
-
processed_log_files: Tracks processed log files
- id (SERIAL PRIMARY KEY)
- filename (TEXT UNIQUE)
- processed_at (TIMESTAMP)
- entries_added (INT)
The application supports the following environment variables:
DATABASE_URL: PostgreSQL connection string (default:postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable)
- Modify Go API endpoints in
backend/*.gofiles - Run tests with
go test ./...
- Modify Vue components in the
frontend/srcdirectory - Build for production with
npm run build
cd frontend
npm run buildThe build output will be in the frontend/dist directory.
cd backend
go build -o appThis will create an executable file that can be deployed to your server.
The application can be easily deployed using Docker and Docker Compose, which includes all required services:
- Backend (Go Fiber API)
- Frontend (Vue.js)
- Nginx (Web Server and Reverse Proxy)
- PostgreSQL (Database)
Ensure you have Docker and Docker Compose installed on your system:
# Installing Docker on Ubuntu/Debian
sudo apt update
sudo apt install docker.io docker-compose
# Start and enable Docker service
sudo systemctl start docker
sudo systemctl enable docker- Clone the repository:
git clone https://your-repository-url/intel-stealer.git
cd intel-stealer/hello-world- Build and start all services:
docker-compose up -d- Access the application:
- Web UI: http://localhost
- API: http://localhost/api
The Docker Compose configuration includes the following volume mounts:
- PostgreSQL data: Stored persistently on the host
- Backend data directory: Mounted from
./backend/dataon the host to/app/datain the container
# View logs
docker-compose logs -f
# View logs for a specific service
docker-compose logs -f backend
# Stop all services
docker-compose down
# Restart a specific service
docker-compose restart backend
# Rebuild and update services after changes
docker-compose up -d --buildYou can modify environment variables in the docker-compose.yml file to customize your deployment.
# Install PostgreSQL
sudo apt update
sudo apt install postgresql postgresql-contrib
# Start and enable PostgreSQL service
sudo systemctl start postgresql
sudo systemctl enable postgresql
# Install Node.js and npm
sudo apt install nodejs npm
# Install Go
wget https://go.dev/dl/go1.21.0.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc# Create log directory if it doesn't exist
mkdir -p backend/log
# Build and run backend
cd backend
go build -o app
./appIn another terminal:
# Build and serve frontend
cd frontend
npm install
npm run build
npx serve -s distThe easiest way to run the application in production mode is to use the included script:
# Make the script executable
chmod +x start_production.sh
# Run the production script
./start_production.shThis script will:
- Check for required dependencies
- Set up the environment
- Build both backend and frontend
- Start both services in production mode
- Use PM2 for process management if available
For manual production deployments, follow these steps:
Create a production environment file (.env.production):
# Create .env.production file
cat > backend/.env.production << EOL
DATABASE_URL=postgres://postgres:securepassword@localhost:5432/intel_stealer?sslmode=disable
PORT=3000
LOG_LEVEL=info
EOL# Start backend in production mode
cd backend
export NODE_ENV=production
export $(cat .env.production | xargs)
./appFor production environments, it's recommended to use a process manager like PM2:
# Install PM2
npm install -g pm2
# Start backend with PM2
cd backend
pm2 start ./app --name "intel-stealer-backend"
# Start frontend with PM2
cd frontend
pm2 start "npx serve -s dist" --name "intel-stealer-frontend"
# Configure PM2 to start on boot
pm2 startup
pm2 saveThis project is proprietary software.
Last updated: May 22, 2025