Modern knowledge management system for Portuguese language questions, built with accessibility and internationalization in mind.
NoteX is a comprehensive knowledge management system designed specifically for Portuguese language questions and linguistic doubts. Built as a monorepo with modern web technologies, it provides fast search, accessibility-first design, and multi-market support.
- π Fast Search: Full-text search with Portuguese language support using PostgreSQL FTS
- π Internationalization: Multi-language support (PT-PT primary, extensible to PT-BR/CPLP)
- βΏ Accessibility First: WCAG 2.2 AA compliant with keyboard navigation and screen reader support
- π¨ Design System: Consistent UI with light/dark themes and responsive design
- π± PWA Ready: Progressive Web App with offline capabilities
- π Secure: Row-level security (RLS) and role-based access control
- β‘ Performance: Optimized for fast loading and smooth interactions
This is a pnpm monorepo with the following structure:
notex/
βββ apps/
β βββ web/ # Next.js App Router application
βββ packages/
β βββ config/ # Settings and internationalization
β βββ database/ # Database access and repositories
β βββ types/ # Shared TypeScript definitions
β βββ ui/ # Reusable UI components
β βββ utils/ # Utility functions
βββ tools/
β βββ eslint-config/ # Shared ESLint configuration
β βββ tsconfig/ # Shared TypeScript configuration
βββ scripts/ # Build and maintenance scripts
βββ _examples/ # Documentation and examples
- Frontend: Next.js 14 (App Router), React 18, TypeScript 5
- Styling: SCSS Modules with design tokens
- Database: PostgreSQL with Supabase (hybrid columns + JSONB)
- Search: Full-text search with
unaccentandpg_trgmextensions - Package Manager: PNPM with workspace support
- Deployment: Vercel
- Development: ESLint, Prettier, TypeScript strict mode
- Node.js 18+
- PNPM 8+
- Supabase account (for database)
-
Clone the repository
git clone https://github.com/mapherez/notex.git cd notex -
Install dependencies
pnpm install
-
Set up environment variables
cp .env.example .env.local # Edit .env.local with your Supabase credentials -
Start development server
pnpm dev
-
Open your browser
- Navigate to http://localhost:3000
# Start development server
pnpm dev
# Type checking
pnpm type-check
# Linting
pnpm lint
# Build all packages
pnpm build
# Format JSON files (locales, settings)
pnpm cleanupAll user-facing strings are externalized to locale files. Never hardcode strings directly in components.
// β Wrong
<h1>Knowledge Cards</h1>
// β
Correct
<h1>{localize('CARDS_PAGE_TITLE')}</h1>Locale files are stored in packages/config/src/i18n/ with support for multiple markets.
Application behavior is controlled through settings files with a layered approach:
- Base settings (common defaults)
- Market overrides (PT-PT, PT-BR, etc.)
- Environment settings (dev, staging, prod)
- User preferences (theme, accessibility settings)
// Usage in components
const { settings } = useSettings();
const buttonConfig = settings.HOMEPAGE?.buttons?.viewCards;Components follow a consistent pattern with proper separation of concerns:
ComponentName/
βββ ComponentName.tsx # Main component ('use client' if needed)
βββ ComponentName.module.scss # Styles
βββ index.ts # Clean exports
βββ types.ts # Type definitions (if complex)
apps/web: Main Next.js application- App Router with server/client component separation
- PWA manifest and service worker
- Responsive design with mobile-first approach
-
packages/config: Configuration management- Settings system with deep merge support
- Internationalization with locale loading
- Market-specific configurations
-
packages/database: Data access layer- Supabase client configuration
- Repository pattern for data operations
- Row-level security policies
-
packages/types: TypeScript definitions- Shared interfaces and types
- Database schema types
- Component prop types
-
packages/ui: UI component library- Reusable components (Button, Card, SearchBar, etc.)
- Design tokens and themes
- Accessibility-first components
-
packages/utils: Utility functions- Data validation with Zod
- Date formatting and manipulation
- Accessibility helpers
- Platform detection for responsive UI
tools/eslint-config: Shared ESLint configurationtools/tsconfig: Shared TypeScript configuration
- TypeScript Strict Mode: All code must pass strict type checking
- ESLint: Automated code quality checks
- Prettier: Consistent code formatting
- Accessibility: WCAG 2.2 AA compliance required
- Never hardcode user-facing strings
- Use SCREAMING_SNAKE_CASE for locale keys
- Group related keys logically
- Test with multiple locales (PT-PT, EN-US)
- Add new settings to the
AppSettingsinterface - Update default settings in
packages/config/src/settings/ - Consider market-specific overrides
- Use descriptive, nested keys
- Use existing UI components from
@notex/ui - Add 'use client' directive for React hooks
- Extract configuration to settings when applicable
- Follow the established component structure
The system uses a hybrid PostgreSQL schema:
entries: Knowledge cards with stable columns + flexible JSONB payloadentry_links: Relationships between entriestags&entry_tags: Tagging systemuser_notes: Private user notes on entries
- Full-Text Search: Optimized for Portuguese with
unaccentandpg_trgm - Row-Level Security: Automatic data isolation
- Defaults on Read: Graceful handling of missing data
- Audit Trail: Change tracking for content management
- Connect your GitHub repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on push to main branch
# Build all packages
pnpm build
# Build web application
cd apps/web && pnpm build- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes following the guidelines
- Run tests and linting:
pnpm type-check && pnpm lint - Format code:
pnpm cleanup - Commit with conventional commits
- Push and create a pull request
- TypeScript strict mode passes
- ESLint passes with no errors
- All user-facing strings are localized
- Settings are properly configured
- Accessibility requirements met
- Responsive design tested
- Cross-browser compatibility verified
# Development
pnpm dev # Start development server
pnpm build # Build all packages
pnpm lint # Run ESLint
pnpm type-check # Type check all packages
pnpm cleanup # Format JSON files
# Package-specific
pnpm --filter web dev # Start web app only
pnpm --filter @notex/types build # Build types packageCreate a .env.local file with:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
# Application
NEXT_PUBLIC_APP_URL=http://localhost:3000- Copilot Guidelines - Development best practices
- Start Instructions - Detailed project plan
- Architecture Decisions - ADRs and technical decisions
MIT License - see LICENSE file for details.
Built with β€οΈ for the Portuguese language community. Special thanks to the linguistic experts and educators who contribute to making language learning accessible to all.
Note: This project is part of an effort to democratize access to Portuguese language knowledge and promote linguistic clarity across Portuguese-speaking communities.