A desktop application for Windows that provides free games with ad-supported monetization. Games are automatically paused every 45 minutes using OS-level process suspension for 5-minute ad breaks.
- Process Suspension System: Robust game pausing using Windows NT APIs and thread-based fallback
- 45-Minute Timer: Automatic game suspension every 45 minutes for ad breaks
- 5-Minute Ad Breaks: Fullscreen ad overlay that cannot be closed or skipped
- Game Library: Steam-like interface with grid/list views, search, and categorization
- Developer Portal: Web interface for uploading games with mock analytics
- Safety Features: Save protection, crash recovery, and timeout protection
- Windows API Integration: Direct calls to
NtSuspendProcess
/NtResumeProcess
via ffi-napi - Fallback Mechanism: Thread-level suspension when NT API fails
- SQLite Database: Local storage for games, sessions, and analytics
- Electron Frontend: Modern desktop UI with responsive design
- Express Backend: Developer portal with file upload capabilities
- Windows 10/11 (required for process suspension APIs)
- Node.js 16+
- Administrator privileges (recommended for process suspension)
- Clone and install dependencies:
git clone <repository-url>
cd game-store-windows
npm install
- Start the main application:
npm start
- Start the developer portal (separate terminal):
npm run server
- Access developer portal: Open http://localhost:3001 in your browser
game-store-windows/
├── main/ # Electron main process
│ ├── index.js # Entry point and app initialization
│ ├── processManager.js # Windows process suspension logic
│ ├── gameWrapper.js # Game session management
│ ├── adManager.js # Ad scheduling and analytics
│ └── database.js # SQLite database operations
├── renderer/ # Electron renderer (UI)
│ ├── library.html # Main game library interface
│ ├── overlay.html # Ad overlay window
│ ├── styles/ # CSS styles
│ └── js/ # Frontend JavaScript
├── native/ # Windows-specific code
│ └── windowsAPI.js # FFI bindings for Windows APIs
├── server/ # Developer portal backend
│ ├── app.js # Express server
│ └── public/ # Web interface
└── data/ # Local storage
├── games.db # SQLite database
├── uploads/ # Uploaded game files
└── downloads/ # Downloaded games
The heart of the system - handles suspending and resuming game processes:
// Suspend a process with fallback logic
const suspensionInfo = await processManager.suspendProcess(processId, {
useNTAPI: true,
saveProtectionDelay: 3000,
maxRetries: 3
});
// Resume the process
await processManager.resumeProcess(processId);
Features:
- NT API calls (
NtSuspendProcess
/NtResumeProcess
) as primary method - Thread-based suspension as fallback
- Save protection delay (3 seconds default)
- Retry logic with exponential backoff
- Process state verification
Manages individual game sessions and timing:
const session = new GameSession(gameInfo, processManager, adManager);
await session.start();
// Session automatically:
// - Tracks 45-minute play timer
// - Triggers ad breaks
// - Handles crashes and errors
// - Records analytics
Features:
- 45-minute countdown timer
- Automatic process suspension for ads
- Play time tracking (excludes suspended time)
- Crash detection and recovery
- Health monitoring
Direct Windows API access via ffi-napi:
// Supported APIs:
- kernel32.dll: OpenProcess, SuspendThread, ResumeThread
- ntdll.dll: NtSuspendProcess, NtResumeProcess
- user32.dll: FindWindow, SetWindowPos
Security Note: Some operations require administrator privileges for process manipulation.
Fullscreen overlay that prevents user interaction:
- Always on top window that covers entire screen
- 5-minute countdown with progress bar
- Disabled controls - blocks Alt+Tab, Alt+F4, etc.
- Skip attempt tracking for analytics
- Auto-resume after timeout
-
Upload via Developer Portal:
- Visit http://localhost:3001
- Fill in game details (title, description, category)
- Upload .exe or .zip file
- Add optional cover image and screenshots
- Games are auto-approved for MVP
-
Supported Formats:
.exe
files (Windows executables).zip
files (will be extracted)- Single-player games only (multiplayer not supported in MVP)
-
Install Games:
- Browse library by category (Action, RPG, Puzzle, Strategy, Racing)
- Click "Download" to install
- Games are stored in
data/downloads/
-
Play Games:
- Click "Play" to launch
- Game runs normally for 45 minutes
- Automatic pause for 5-minute ad break
- Cycle repeats until game is closed
- $0.02 per ad view (base rate)
- $0.01 completion bonus (if user watches full ad)
- Mock analytics with realistic data for demonstration
- Total play time per game
- Ad completion rates
- Download statistics
- Player retention
- Revenue estimation
Access detailed analytics at http://localhost:3001:
- Game performance metrics
- Download trends
- Revenue estimation
- Player engagement data
- No multiplayer support
- No online features during ad breaks
- Network-dependent games may have issues
- Requires Windows 10/11
- Uses Windows-specific APIs
- May need administrator privileges
Some games may not suspend properly:
- Games with custom protection (anti-cheat)
- Games using specific engines
- Real-time multiplayer games
- Process manipulation requires elevated privileges
- Antivirus software may interfere
- Some corporate environments may block functionality
npm run dev # Start with developer tools enabled
// Access SQLite database directly
const Database = require('./main/database');
const db = new Database();
await db.initialize();
// View game sessions
const sessions = await db.getGameSessions();
// Test suspension on current process (BE CAREFUL!)
const pm = new ProcessSuspensionManager();
await pm.suspendProcess(process.pid);
// Process will be suspended - you'll need external tool to resume
1. Process Suspension Fails
- Ensure running as Administrator
- Check if antivirus is blocking
- Try different games (some may be incompatible)
2. Games Don't Launch
- Verify game executable path
- Check file permissions
- Ensure all dependencies are installed
3. Ad Overlay Doesn't Appear
- Check if process suspension succeeded
- Verify overlay window creation
- Look for JavaScript errors in developer tools
4. Database Errors
- Delete
data/games.db
to reset - Ensure write permissions in data directory
- Check SQLite installation
Main Process Logs:
# Console output shows:
- Process suspension attempts
- Game launch status
- Ad break triggers
- Database operations
Renderer Logs:
- Open Developer Tools (Ctrl+Shift+I)
- Check Console for UI errors
- Network tab for failed requests
Server Logs:
# Developer portal logs show:
- File upload progress
- API requests
- Database queries
- Games download successfully
- Games launch properly
- 45-minute timer counts down
- Process suspends after timer
- Ad overlay appears and cannot be closed
- Game resumes after 5 minutes
- Multiple suspend/resume cycles work
- Game state preserved during suspension
- Crashes handled gracefully
- Upload interface loads
- Files upload successfully
- Games appear in library after upload
- Analytics display correctly
- Mock revenue data shows
- Alt+Tab blocked during ads
- Process crashes handled
- Database corruption recovery
- Network interruptions
- Antivirus interference
- Real Ad Integration: Connect with ad networks
- Cloud Save System: Sync game saves across devices
- Multiplayer Support: Handle online games properly
- Advanced Analytics: Real user behavior tracking
- Game Recommendations: AI-powered suggestions
- Achievement System: Gamification features
- Better Compatibility: Support more game engines
- Performance Optimization: Reduce resource usage
- Security Hardening: Protect against tampering
- Cross-Platform: macOS and Linux support
- Auto-Updates: Seamless application updates
MIT License - See LICENSE file for details
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature
- Commit changes:
git commit -m 'Add amazing feature'
- Push to branch:
git push origin feature/amazing-feature
- Open a Pull Request
For issues and questions:
- Check the troubleshooting section above
- Review console logs for error messages
- Open an issue on GitHub with detailed information
- RAM: 4GB minimum (8GB recommended)
- Storage: 10GB free space for games
- CPU: Modern dual-core processor
- Network: Broadband for game downloads
- Main Process: ~100MB RAM
- Renderer Process: ~200MB RAM
- Database: Grows with usage (~1MB per 1000 sessions)
- Game Storage: Varies by game size
Built with ❤️ for the gaming community. Enjoy free games with fair advertising!