An anonymous suggestion box application built with SolidJS and Zero. This app allows users to:
- Submit anonymous suggestions
- View all submitted suggestions
- Comment on suggestions (including selection-based comments)
- Add nested replies to comments
- React to suggestions and comments with emojis
- Edit their own suggestions
- Delete their own comments
- Node.js (v16 or later)
- Docker and Docker Compose
- npm or yarn
- Clone the repository
- Install dependencies:
bun i
-
Start a postgres db at port 5469 (or modify port in package.json)
-
Run the Zero Cache development server:
bun dev:zero-cache
-
In a separate terminal, start the frontend development server:
bun dev:ui
-
Open your browser and navigate to the URL shown in the terminal (typically http://localhost:5173)
Users are assigned a random identifier stored in localStorage when they first visit the site. This identifier is used to:
- Track which suggestions, comments, and reactions belong to them
- Allow them to edit or delete their own content
- Prevent them from reacting multiple times with the same emoji
- Anyone can create suggestions
- Users can only edit their own suggestions (not delete them)
- Users can only delete their own comments and reactions
- Anyone can view all content
- Frontend: SolidJS
- Database: PostgreSQL
- Data Sync: Zero (Rocicorp)
- Storage: Client-side localStorage for user identification
src/- Frontend codeApp.tsx- Main application componentschema.ts- Zero schema definition
docker/- Docker configurationdocker-compose.yml- Container setupseed.sql- Database initialization
The application uses HyperDX for logging in production environments. In development, logs are formatted and displayed in the console.
import { logger } from './hyperdx-logger';
// Basic logging
logger.info('User logged in');
logger.warn('Failed login attempt', { username: 'testuser' });
logger.error('Request failed', new Error('Network error'), { url: '/api/data' });
logger.debug('Debug information', { requestId: '123' });
// Setting user information
logger.setUserInfo({
userId: 'user123',
userEmail: 'user@example.com',
userName: 'Test User',
teamName: 'Engineering'
});
// Tracking custom actions
logger.trackAction('Button-Clicked', {
buttonId: 'submit-form',
formName: 'Signup Form'
});In development, logs are formatted for the console. In production, logs are sent to HyperDX for centralized logging and monitoring.
HyperDX will also automatically capture:
- Console logs
- Network requests (XHR/fetch/websocket)
- Exceptions
- Session replays (to see what users were experiencing)