Skip to content

feat: completed Task 1 - database setup with projects/notes migration…#14

Open
abdullah-dev5 wants to merge 61 commits intodevkindhq:masterfrom
abdullah-dev5:feature/day-6-project-notes-frontend-abdullah
Open

feat: completed Task 1 - database setup with projects/notes migration…#14
abdullah-dev5 wants to merge 61 commits intodevkindhq:masterfrom
abdullah-dev5:feature/day-6-project-notes-frontend-abdullah

Conversation

@abdullah-dev5
Copy link
Copy Markdown

…s and seeders (D6T1)

- Added pinned notes feature with migration
- Implemented date sorting in controller
- Integrated markdown processing
- Updated seeder and routes
- Build Projects/Notes TSX components with Inertia hooks
- Implement project listing and editing
- Add pinned notes and sorting
Comment thread app/controllers/LabelController.ts Outdated
Comment thread app/controllers/LabelController.ts Outdated
Comment thread app/controllers/NoteController.ts Outdated
Comment thread app/controllers/NoteController.ts Outdated
* Update note
*/
async update({ params, request, response }: HttpContext) {
const note = await Note.findOrFail(params.id)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread app/controllers/NoteController.ts Outdated
Comment thread app/controllers/NoteController.ts Outdated
Comment thread inertia/pages/notes/index.tsx Outdated
const [notes, setNotes] = useState(initialNotes)
const [isFormVisible, setIsFormVisible] = useState(false)
const [viewType, setViewType] = useState<ViewType>('grid')
const [sortBy, setSortBy] = useState<'createdAt' | 'updatedAt'>('createdAt')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of creating multiple states for filters, create one and assign default values.

Comment thread inertia/pages/notes/index.tsx Outdated
content: data.content,
createdAt: new Date().toISOString(),
updatedAt: null
updatedAt: null,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont have to pass null, its computed variable.

))
}
} catch (error) {
console.error('Error toggling pin:', error)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use toast.

Comment thread start/routes.ts Outdated
// API Routes (Backend)
// ========================
// Projects (keep existing)
router.get('/projects', [ProjectsController, 'index'])
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…andling

- Added Cloudinary upload integration for media handling
- Fixed label, todo, and notes module bugs in backend
- Improved error handling across modules
- Refactored code for better readability and structure
- Implement secure image upload/delete via Cloudinary CDN
- Add label management system with validation
- Generate shareable links for notes
- Include production error handling and format validation
- Implement comprehensive Notes, Projects, and Todos management interfaces
- Add search, filtering, pagination, and sorting across all modules
- Create reusable components (Toast, ProjectCard, ViewSwitcher)
- Integrate label system with color coding and multi-selection
- Add image upload support with Cloudinary integration
- Implement pin/unpin functionality with visual feedback
- Add real-time status updates and form validation
- Create responsive design with smooth animations and transitions
- Add TypeScript definitions and enhanced error handling
- Configure middleware for better Inertia.js integration
…ionality

- Add full JWT + session-based authentication with login/register/logout endpoints
- Implement role-based access control (RBAC) with admin dashboard capabilities
- Add note sharing via protected UUID URLs with read-only public access
- Create comprehensive frontend auth flow with protected routes and dashboard
- Update database schema with users, roles, permissions, and auth tokens
- Add shared note viewer component with security indicators and 404 handling
- Reorganize routing structure with proper middleware guards
- Include test scripts, documentation, and package updates

Closes note sharing epic and establishes authentication
- Added Ally provider and configuration for Google OAuth
- Updated AuthController and User model for OAuth login and account linking
- Updated routes for OAuth endpoints
- Enhanced frontend login and dashboard for OAuth flow
- Updated environment and config files for OAuth support
…advanced weather with geo/IP fallback (D9T1&T2)

- Replaced Giphy integration with Klipy for GIF search and selection in notes.
  - Triggered by slash command (/klipy <keyword>) in note content.
  - Supports pagination (8 GIFs per page) with next/prev navigation.
  - Robust error handling for failed searches, invalid keywords, and API rate limits.
  - Custom toast notifications with adjustable duration for user feedback.
- Updated note form to support GIF insertion:
  - Stores gif_url and gif_slug in form data.
  - Inserts GIF markdown at cursor position and cleans up /klipy command.
- Improved user experience with graceful UI recovery and clear feedback.

Weather feature:
- Added weather widget to dashboard, showing current weather for the user’s location.
- Uses browser geolocation API to fetch precise latitude/longitude for weather data.
- If geolocation is denied or unavailable, falls back to IP-based location lookup.
- Fetches weather data from a public weather API using the determined coordinates or IP.
- Displays temperature, weather condition, and location name in a user-friendly format.
- Handles all error cases gracefully, showing fallback messages if weather cannot be determined.
- Ensures fast, non-blocking UI updates and a seamless experience regardless of user permissions.
Use centralized allLabels and Label component for displaying note labels
Remove all dynamic label fetching and legacy label display logic
Ensure NoteCard shows labels above the title, using new static label structure
Refactor Inertia responses in both todos and notes controllers for consistency and improved frontend integration
Core Changes:
- Add BaseController with standardized API responses
- Implement hybrid authentication (session + JWT) in AuthController
- Fix note creation flow with proper user_id assignment
- Add comprehensive middleware for security and error handling
- Create OAuthLogger service for OAuth operations
- Fix authentication middleware with standard cache control
- Update routing structure for better organization
- Fix Inertia responses to prevent JSON errors
- Add CSRF token to Inertia shared data
- Implement proper session management
- Fix frontend authentication context and note form
- Add user_id migration for notes table

Architecture Improvements:
- Standardized authentication flow
- Better error handling and logging
- Cleaner route organization
- Enhanced security middleware
- Improved frontend state management

Resolves:
- Browser back button authentication issues
- Note creation not saving/rendering
- Inertia response errors
- CSRF token issues
- Authentication state management
…issues

- Replace Tailwind with ShadCN UI components (Button, Input, Card, Badge, Select, Checkbox, Label, Textarea)
- Implement todo prioritization (High/Medium/Low) and status (In progress/Completed/pending) with color-coded badges
- Add note labeling system with search and filtering capabilities
- Implement Zustand state management for notes and todos with persistence
- Fix authentication issues: Inertia response errors, logout credential cleanup, dashboard counters
- Add logout button and dynamic dashboard statistics
- Fix todo priority/status update bugs and project navigation issues
- Update database schema for todo priority/status fields
- Modernize UI with consistent theming, animations, and responsive design
…idation

- Fix GIF not showing in note views by adding missing interface fields
- Resolve image URL persistence issues during note updates
- Update validators to handle imageUrl and relax title requirements
- Fix route conflicts and improve Inertia response handling
- Standardize file naming conventions (snake_case)
- Enhance form validation with real-time feedback
- Improve image/GIF preview logic in note forms
- Add bookmark model with Open Graph metadata support
- Create bookmark CRUD operations and API endpoints
- Integrate Google Gemini AI for label generation and summaries
- Add Open Graph service for URL metadata extraction
- Implement bookmark frontend with React/Inertia
- Add bookmark seeder with sample data
- Fix routing and Inertia response issues
…pdates

Browser Notification API with SweetAlert2 top toasts
Email sending on due reminders; respects user/channel prefs
Pusher-driven live updates; fallback to browser notifications
Minor UI polish and auto-refresh after create/update
…ture

- Added global error handling with Sentry integration
- Implemented React Error Boundaries for frontend error catching
- Created comprehensive test suite with Jest and React Testing Library
- Added API integration tests and component unit tests
- Enhanced error tracking and meaningful error messaging
🎯 Task 1: Write E2E Tests for Application
- ✅ Created comprehensive E2E test suites for all modules (Notes, Todos, Projects, Bookmarks)
- ✅ Implemented CRUD operation tests (Create, Read, Update, Delete)
- ✅ Added form validation tests with edge cases (empty fields, invalid input)
- ✅ Created error handling tests for various scenarios
- ✅ Added responsive design and cross-browser compatibility tests
- ✅ Implemented authentication flow testing (login, registration, logout)

🎯 Task 2: Test Integration with Backend
- ✅ Created API integration tests for all endpoints
- ✅ Added backend API response validation
- ✅ Implemented error handling for API failures (timeouts, 500 errors)
- ✅ Added security testing (SQL injection, XSS protection)
- ✅ Created performance testing (response times, concurrent requests)
- ✅ Added comprehensive error scenario testing

🚀 Technical Implementation:
- Installed and configured Cypress 15.5.0
- Created 11 comprehensive test files with 158 total tests
- Added custom Cypress commands for reusable test scenarios
- Implemented test fixtures for consistent mock data
- Added global error handling for React hydration issues
- Created API-only tests for protected routes
- Added visual testing capability with Cypress UI

📊 Test Coverage:
- Authentication flows (8 tests)
- CRUD operations (56 tests across 4 modules)
- API integration (19 tests)
- Error handling (17 tests)
- Performance testing (14 tests)
- Security testing (12 tests)
- Cross-browser compatibility (13 tests)
- Form validation (19 tests)

All tests passing ✅ - Complete E2E testing implementation ready for production
- Add password visibility toggle to login/register forms with Eye/EyeOff icons
- Implement client-side validation for email and password fields
- Improve error handling with SweetAlert2 integration
- Refactor preferences from dedicated page to popup component (removed 239 lines)
- Enhance Header component with improved user menu, avatar handling, and mobile responsive design
- Update AuthContext with better session management and error handling
- Improve controllers (auth, notes, todos, user_preferences) with better validation
- Streamline notification services and remove unused hooks
- Add comprehensive styling improvements and CSS enhancements
- Update project documentation and timeline with latest changes

52 files changed: +2135/-1771 lines
@abdullah-dev5 abdullah-dev5 force-pushed the feature/day-6-project-notes-frontend-abdullah branch from cd16052 to cbca11b Compare October 27, 2025 20:35
abdullah-dev5 and others added 24 commits October 28, 2025 01:50
…se DB columns; correct migration to add user_id to projects; remove incorrect duplicate/rename migrations
…r queries for consistency with Todo/Note controllers
…BLE_SCHEDULER; reduce noise during migrations
…and cleanup project

- Fix React hydration mismatch by using explicit locale for date formatting
  - Update TodoCard, NoteCard, and Bookmark components to use 'en-US' locale
  - Move ReminderListener component outside setup function to prevent recreation
  - Align SSR and client-side component structures

- Fix validators to handle null/undefined values properly
  - Update bookmark, note, reminder, and todo validators
  - Add transform functions to safely handle empty strings and null values
  - Prevent 'Cannot read properties of null' errors

- Sync database schema with models
  - Add @columnName decorators to all models for snake_case mapping
  - Fix many-to-many relationships for labels (notes, todos, bookmarks)
  - Create missing migrations for bookmarks and label pivot tables
  - Make password column nullable for OAuth users

- Clean up project files
  - Remove all documentation files (project-docs/, README files)
  - Delete temporary debugging scripts (check_users_schema.js, etc.)
  - Remove test pages and components (test-toast, ErrorTestComponent)
  - Delete test images and build artifacts
  - Remove duplicate database files

- Update routes
  - Remove test route for reminders/test page
  - Fix auth routes to handle unauthenticated users gracefully
- Add isProduction flag to Inertia shared data
- Conditionally load Vite dev client scripts only in development
- Fixes 404 errors for /@vite/client and /@react-refresh in production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants