Development Setup
Prerequisites
Operating System
Linux with
ss command (from iproute2 package)Runtime
Node.js 18+ and npm
Optional
Docker for container detection features
Access
/proc filesystem access for process infoInstallation
Install dependencies
- Next.js 15
- React 19
- TypeScript 5
- Tailwind CSS
- shadcn/ui components
- React Flow
Start the development server
The development server uses Turbopack for fast hot-reloading. Changes to components will reflect instantly.
Project Structure
Understanding the codebase organization:Code Conventions
TypeScript
- Strict mode enabled: All code must pass TypeScript strict checks
- Type safety: Use explicit types for function parameters and return values
- No any: Avoid
anytype; useunknownor proper types - Exports: Use named exports for utilities, default export for components
React Components
- Client components: Use
"use client"directive when needed (hooks, events) - Props types: Define inline types or use TypeScript interfaces
- Hooks: Follow React hooks rules (eslint-plugin-react-hooks enforces this)
- File naming:
kebab-case.tsxfor components
Styling
- Tailwind CSS: Use utility classes for all styling
- cn utility: Use
cn()fromlib/utils.tsto merge classNames - Responsive: Add responsive breakpoints (
md:,lg:) where appropriate - Dark mode: Use CSS variables from
globals.css(e.g.,text-foreground)
Data Collection
- Error handling: Always wrap shell commands in try-catch
- Parsing: Use regex for parsing
ssoutput (seelib/connections.ts:35-36) - Normalization: Normalize addresses and ports consistently
- Performance: Cache Docker lookups when possible
Testing
Manual Testing Checklist
When making changes, verify:- Listeners are displayed correctly in both diagram and table views
- Connections are drawn properly between nodes
- Process icons match the detected service (Node.js, Redis, etc.)
- Docker containers are labeled with the container name
- Table sorting and filtering work as expected
- Kill process button sends correct PID to API
- Error states are handled gracefully (e.g.,
ssnot available) - Page auto-refreshes every 5 seconds
- No console errors in browser DevTools
Testing with Docker
To test Docker container detection:Pull Request Guidelines
Before Submitting
Commit Messages
Use clear, descriptive commit messages:- Format:
<type>: <description> - Types:
feat,fix,docs,style,refactor,perf,test,chore
Pull Request Template
When opening a PR, include:- Description: What does this PR do?
- Motivation: Why is this change needed?
- Testing: How did you test this?
- Screenshots: (if UI changes) Before/after screenshots
- Breaking changes: Does this break existing functionality?
Common Contribution Ideas
Features
- Support for UDP connections
- Process filtering and search
- Export data as JSON/CSV
- Historical connection tracking
Tests
- Unit tests for parsing logic
- Integration tests for API routes
- E2E tests with Playwright
Documentation
- Add JSDoc comments
- Create video tutorials
- Write troubleshooting guide
Performance
- Optimize React Flow rendering
- Reduce polling frequency options
- Memoize expensive computations
Getting Help
- Issues: github.com/alexcgomez/psys/issues
- Discussions: Use GitHub Discussions for questions
- Code review: Maintainers will review PRs and provide feedback
Code of Conduct
Be respectful and constructive in all interactions. We’re all here to build better software together.- Be kind: Respect different perspectives and experience levels
- Be helpful: Share knowledge and help others learn
- Be patient: Reviews take time; maintainers are often volunteers
- Be professional: Keep discussions focused on the code and technical matters