Showing 1909-1920 of 2626 matches
The Following is a next.js 15 project, react 19, typescript, shadcn ui, tailwind css project. It is an ai resume builder. It is called "ResumeLM". Database Structure - Tables follow a relational structure with UUID primary keys and timestamps. Tables: 1. profiles - Stores user's base information and resume components - Contains JSON fields for complex data (work_experience, education, skills, etc.) - One-to-one relationship with auth.users 2. jobs - Stores job listings with requirements and details - Public read access, user-specific write access - Contains salary_range as JSONB for flexible structure - Tracks application status and requirements 3. resumes - Stores both base and tailored resumes - Links to jobs table for tailored resumes - Contains same fields as profiles for resume content - Uses JSONB for section_order and section_configs - section_configs controls visibility and display of resume sections Key Relationships: - profiles.user_id → auth.users.id - resumes.user_id → auth.users.id - resumes.job_id → jobs.id (optional, for tailored resumes) JSON Fields Structure: - work_experience: Array of work history with descriptions and technologies - education: Array of educational background with achievements - skills: Array of skill categories with grouped items - projects: Array of projects with highlights and technologies - certifications: Array of professional certifications - section_configs: Object controlling section display properties Row Level Security (RLS): - profiles: User can only access own profile - jobs: Public read, user-specific write - resumes: User can only access own resumes Design System: Soft Gradient Minimalism Core Principles: - Layered Depth: Multiple translucent layers create visual hierarchy - Organic Motion: Subtle animations suggest liveliness without distraction - Purposeful White Space: Generous spacing improves content digestion - Consistent Interaction: Predictable hover and active states across components Visual Hierarchy: 1. Background Layer - Base: Neutral gradient (rose-50/50 → sky-50/50 → violet-50/50) - Floating Orbs: Translucent gradients with slow animations - Mesh Overlay: Subtle grid pattern (#8882) 2. Content Layer - Glass Cards: bg-white/40 with backdrop-blur-md - Border: border-white/40 - Shadow: shadow-xl with backdrop-blur-xl 3. Interactive Elements - Hover State: Duration 500ms - Transform: -translate-y-1 - Background Shift: bg-white/50 Color Palette: Primary: - Teal: from-teal-600 to-cyan-600 - Purple: from-purple-600 to-indigo-600 (Base Resumes) - Accent: { bg: "purple-50", border: "purple-200", hover: "purple-300", text: "purple-600" } - Pink: from-pink-600 to-rose-600 (Tailored Resumes) - Accent: { bg: "pink-50", border: "pink-200", hover: "pink-300", text: "pink-600" } Background: - Gradients: pink-200/20, violet-200/20, blue-200/20, teal-200/20 - Overlays: teal-50/10, cyan-50/10, purple-50/10, indigo-50/10 Specific Resume Type Colors: - Base Resumes: - Gradient: from-purple-600 to-indigo-600 - Icon Background: from-purple-600/10 to-indigo-600/10 - Border: border-purple-600/10 - Text: text-purple-600 - Hover States: purple-700 - Tailored Resumes: - Gradient: from-pink-600 to-rose-600 - Icon Background: from-pink-600/10 to-rose-600/10 - Border: border-pink-600/10 - Text: text-pink-600 - Hover States: pink-700 Typography: - Headers: text-3xl, font-semibold with gradient text - Body: Base 16px, text-muted-foreground for secondary text - Font Stack: 'Inter', system-ui, -apple-system, sans-serif Animation Timings: - Hover Transitions: 500ms - Background Orbs: 8s/9s ease-in-out infinite - Transform Origin: Center Component Patterns: - Card Structure: rounded-2xl with nested content padding - Content Areas: Relative positioning with gradient overlays - Interactive Areas: Clear hover states with smooth transitions Responsive Behavior: - Mobile First: Base layout with single column - Breakpoints: md:p-8 lg:p-10 lg:grid-cols-12 - Max Width: 2000px with centered content Z-Index Layers: - Background: z-0 - Content: z-10 - Overlays: Relative to parent
Used in 1 repository
{ "version": "2.0.0", "projectType": ["nextjs", "fullstack", "ai-powered"], "ai": { "assistant": { "mode": "intelligent-complete", "capabilities": [ "context-aware-suggestions", "code-generation", "documentation-assistance" ] }, "openai": { "preferredModel": "gpt-4o", "maxTokens": 4096, "temperature": 0.7 } }, "codeStyle": { "javascript": { "indent": 2, "maxLineLength": 100, "trailingCommas": true, "semicolons": true }, "typescript": { "strictNullChecks": true, "noImplicitAny": true } }, "linting": { "eslint": { "extends": [ "next/core-web-vitals", "plugin:react-hooks/recommended", "plugin:@typescript-eslint/recommended" ], "rules": { "no-unused-vars": "warn", "react/prop-types": "off", "@typescript-eslint/explicit-module-boundary-types": "off" } } }, "frameworks": { "nextjs": { "appDir": true, "serverComponents": true, "preferredRouter": "app" }, "react": { "preferredHooks": ["useState", "useEffect", "useCallback"], "avoidUnsafeLifecycles": true } }, "backend": { "supabase": { "authStrategy": "row-level-security", "preferredClient": "supabase-js-v2" }, "node": { "engineVersion": ">=18.0.0", "preferredPackageManager": "pnpm" } }, "security": { "sensitiveData": { "masking": true, "envFileProtection": true }, "openai": { "apiKeyHandling": "strict-environment-variables" } }, "performance": { "optimization": { "imageOptimization": true, "serverSideRendering": true, "staticGeneration": true } }, "ignore": [ "node_modules/**", ".next/**", "/.git", "/.env.local", "/.env.production" ], "extensions": { "recommended": [ "tsx", "ts", "js", "jsx", "json", "md" ], "disabled": [ "lock files", "system files" ] }, "codeQuality": { "testing": { "unitTesting": "jest", "e2eTestingFramework": "playwright" }, "documentation": { "generator": "typedoc", "commentStyle": "tsdoc" } } }
You are an expert in modern full-stack development with Typescript, React, Remix, TailwindCSS. You are thoughtful, give nuanced answers, and are brilliant at reasoning. You carefully provide accurate, factual, thoughtful answers. # Technologies - Typescript for frontend and backend - React for frontend - Remix for Backend for frontend - TailwindCSS for styling - Radix UI for accessible UI components - Github Actions for CI/CD - pnpm for package manager # Guidelines ## Communication - Ask questions when you need to, don't make assumptions. - Summarize your changes distinctly and ask follow up questions. - Fully implement all requested functionality. - Leave NO todo’s, placeholders or missing pieces. - Ensure code is complete! Verify thoroughly finalised. ## Documentation - Suggest adding/extending/modifying documentation in a root `docs/` folder - Create user flow diagrams for complex interactions. ## Javascript/Typescript - Utilize Typescript and avoid using any! - Prefer types over interfaces - Prefer object params for a function in most cases (except when there is only 1 param) - kebab-case for filenames and folder-names - camelCase for functions and variables - PascalCase for React component functions - Handle errors and edge cases gracefully - Use typed error responses - Add sensible logging where appropriate - Use `const` for immutable variables. - Use template strings for string interpolation. - Use functional and declarative programming patterns; avoid classes. - Avoid enums; use maps instead. ## React - Write functional components - Don't use `React.FC` - Don't add too much boilerplate to the components – keep it clean - Inline component prop types if they are used only once - Always add loading and error states to data fetching components - Use Error Boundaries for React component error catching (in Remix) ## Accessibility - Use semantic elements (e.g., <header>, <main>, <footer>, <article>, <section>). - Make sure that all interactive elements are focusable and usable with the keyboard - Use `tabindex` where sensible - Don't duplicate information for screen readers - Use `aria-hidden` where sensible - Implement keyboard shortcuts where sensible (ESC, Enter, Tab, Arrow keys) - Use ARIA roles and attributes to enhance accessibility. - Ensure sufficient color contrast for text. - Use focus styles to indicate focus state. - Use landmarks (e.g., <nav>, <main>, <aside>) for screen readers. ## Styling - Implement responsive design with Tailwind CSS; use a mobile-first approach. - Use `clsx` for combining styles and conditional styles ## Routing and rendering - Do data fetching in `loader` functions - Move as much logic as possible to the `loader` functions - Filtering, sorting, pagination, etc - Use `cacheHeader` from `pretty-cache-header` to set cache headers - Always set sMaxage and stale-while-revalidate -
{ "defaultBranch": "main", "commitMessageTemplate": "feat: {type}: {description}", "types": [ "feature", "fix", "docs", "style", "refactor", "test", "chore" ], "conventionalCommits": true, "branchNameTemplate": "{type}/{description}", "packageManager": "npm", "technicalStack": { "framework": "next.js", "styling": ["tailwindcss", "shadcn-ui"], "database": "vercel-postgres", "auth": "clerk", "editor": "tiptap", "realtime": ["y.js", "socket.io"], "testing": "none" }, "folders": { "components": "src/components", "pages": "src/app", "lib": "src/lib", "types": "src/types", "public": "public" }, "componentTemplate": { "extension": ".tsx", "style": "functional-component", "includeTypes": true }, "dependencies": { "required": [ "@clerk/nextjs", "@vercel/postgres", "@tiptap/react", "next", "react", "tailwindcss" ], "development": [ "typescript", "eslint", "prettier" ] } }
[System Architecture] Below is the system architecture of the trading system. When writing code, follow the architecture. Add to this file as needed, and list created file names in this file. [Frontend - Angular] │ ├── Dashboard │ ├──→ [WebSocket Service] │ └──→ [Monitoring Dashboard] ├── Strategy Configuration │ ├──→ [REST API Service] │ └──→ [Strategy Management Service] ├── Performance Monitoring │ └──→ [WebSocket Service] ├── Notifications │ └──→ [Notification Service] └── Configuration Management └──→ [Configuration Service] [Backend - Go] │ ├── Core Services │ ├── Market Data Service │ │ ├── Data Ingestion Engine │ │ │ ├── historical_loader │ │ │ │ ├── daily_candles_fetcher │ │ │ │ └── company_info_fetcher │ │ │ │ │ │ │ └── realtime_streamer │ │ │ ├── websocket_client │ │ │ └── price_processor │ │ │ │ │ └── database (TimescaleDB) │ │ ├── market_data_repository │ │ └── timescale_connector │ ├── Trading Service │ │ ├──→ [Order Management] │ │ ├──→ [Broker API] │ │ └──→ [Simulation Engine] │ └── Risk Management Service │ ├──→ [Position Monitor] │ └──→ [Trading Service] │ ├── Support Services │ ├── WebSocket Service │ ├── REST API Service │ ├── Notification Service │ └── Scheduler Service │ └── Analysis Services ├── Strategy Engine │ └──→ [Signal Generator] ├── Backtesting Service │ └──→ [TimescaleDB] └── Performance Analytics Service └──→ [TimescaleDB] [Database - TimescaleDB] │ ├── Market Data │ ├── stocks_daily_candles │ │ ├── bucket (TIMESTAMP, partitioned) │ │ ├── symbol (TEXT) │ │ ├── open (DECIMAL) │ │ ├── high (DECIMAL) │ │ ├── low (DECIMAL) │ │ ├── close (DECIMAL) │ │ └── day_volume (BIGINT) │ │ │ └── stocks_real_time │ ├── time (TIMESTAMP, partitioned) │ ├── symbol (TEXT) │ ├── price (DECIMAL) │ └── day_volume (BIGINT) │ ├── Reference Data │ └── companies │ ├── symbol (TEXT, primary key) │ └── name (TEXT) │ ├── Trade Data ├── System Data ├── Strategy Configurations ├── User Data └── Performance Metrics [Additional Components] │ ├── Caching Service │ └──→ [Redis] └── Logging and Monitoring └──→ [Prometheus]
In this project we have a /web for frontend and a /Api for backend. /web is a vite react project with tailwindcss and shadcn/ui. /Api is a .NET 8 project with sqlite and entity framework. # API Implementation Guide You are a C#, .NET Core and integration expert, focusing on building clean, maintainable APIs using modern best practices. ## Core Setup ### Entity Framework + SQLite ```csharp // Models/Note.cs public class Note { public int Id { get; set; } public required string Title { get; set; } public required string Content { get; set; } public DateTime CreatedAt { get; set; } } // Data/AppDbContext.cs public class AppDbContext : DbContext { public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { } public DbSet<Note> Notes { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity<Note>(entity => { entity.Property(e => e.Title).IsRequired(); entity.Property(e => e.Content).IsRequired(); entity.Property(e => e.CreatedAt).IsRequired(); }); // Seed data with fixed date to avoid migration issues modelBuilder.Entity<Note>().HasData( new Note { Id = 1, Title = "Welcome", Content = "Welcome to this workshop!", CreatedAt = new DateTime(2024, 1, 1, 0, 0, 0, DateTimeKind.Utc) } ); } } ``` ### Controller Pattern ```csharp [ApiController] [Route("api/[controller]")] public class NotesController : ControllerBase { private readonly AppDbContext _context; public NotesController(AppDbContext context) { _context = context; } [HttpGet] public async Task<ActionResult<IEnumerable<Note>>> GetNotes() { return await _context.Notes.ToListAsync(); } [HttpGet("{id}")] public async Task<ActionResult<Note>> GetNote(int id) { var note = await _context.Notes.FindAsync(id); if (note == null) return NotFound(); return note; } [HttpPost] public async Task<ActionResult<Note>> CreateNote(Note note) { note.CreatedAt = DateTime.UtcNow; _context.Notes.Add(note); await _context.SaveChangesAsync(); return CreatedAtAction(nameof(GetNote), new { id = note.Id }, note); } } ``` ### Program.cs Setup ```csharp var builder = WebApplication.CreateBuilder(args); // Add services builder.Services.AddControllers(); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); // Configure CORS builder.Services.AddCors(options => { options.AddPolicy("AllowAll", builder => builder .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader()); }); // Add SQLite builder.Services.AddDbContext<AppDbContext>(options => options.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection"))); var app = builder.Build(); // Apply migrations on startup using (var scope = app.Services.CreateScope()) { var db = scope.ServiceProvider.GetRequiredService<AppDbContext>(); db.Database.Migrate(); } // Configure pipeline if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseHttpsRedirection(); app.UseCors("AllowAll"); app.MapControllers(); ``` ### Configuration (appsettings.json) ```json { "ConnectionStrings": { "DefaultConnection": "Data Source=app.db" }, "Kestrel": { "Endpoints": { "Http": { "Url": "http://localhost:5001" } } } } ``` ## Project Structure ``` Api/ ├── Controllers/ │ └── NotesController.cs ├── Models/ │ └── Note.cs ├── Data/ │ └── AppDbContext.cs ├── Migrations/ │ └── XXXXXX_InitialCreate.cs ├── Properties/ │ └── launchSettings.json ├── Program.cs └── appsettings.json ``` ## Development Workflow ### Database Management - SQLite database is stored in `app.db` - To reset database: 1. Stop application 2. Delete `app.db` 3. Restart application (migrations will run automatically) ### Adding New Features 1. Create/modify models in `Models/` 2. Update `AppDbContext` if needed 3. Add new migration: `dotnet ef migrations add MigrationName` 4. Create/update controllers in `Controllers/` ### External API Integration When integrating with external APIs: 1. Create interfaces in `Services/` 2. Implement service classes 3. Register services in `Program.cs` 4. Use dependency injection in controllers Example: ```csharp public interface IExternalService { Task<Data> GetDataAsync(); } public class ExternalController : ControllerBase { private readonly IExternalService _service; public ExternalController(IExternalService service) { _service = service; } [HttpGet] public async Task<ActionResult<Data>> GetData() { return await _service.GetDataAsync(); } } ``` # Web Implementation Guide This guide outlines the key technologies and patterns to follow when implementing features in this repository. ## Core Technologies ### TanStack Query - Use TanStack Query for all data fetching and state management - Implement custom hooks for data fetching using `useQuery` and `useMutation` - Follow the pattern: ```typescript export function useData() { return useQuery({ queryKey: ['data'], queryFn: async () => { const response = await fetch('/api/data'); return response.json(); } }); } ``` ### Tailwind CSS - Use Tailwind CSS for all styling - Follow the project's design system using custom colors and variables - Utilize the `cn()` utility for conditional class names: ```typescript import { cn } from "@/lib/utils"; export function Component({ className, ...props }) { return ( <div className={cn("base-classes", className)} {...props}> {/* content */} </div> ); } ``` ### shadcn/ui Components - All shadcn/ui components are pre-installed and ready to use, if not, install by npx shadcn@latest add [component] - Import components from `@/components/ui` - Follow the component patterns: ```typescript import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; export function Form() { return ( <div> <Input placeholder="Enter text" /> <Button>Submit</Button> </div> ); } ``` #### Available Components 1. **Directly Installable Components** ```bash npx shadcn@latest add accordion alert alert-dialog aspect-ratio avatar badge button card checkbox collapsible command context-menu dialog drawer dropdown-menu form hover-card input label menubar navigation-menu popover progress radio-group scroll-area select separator sheet skeleton slider switch table tabs textarea toast toggle toggle-group tooltip ``` 2. **Composite Components** (built using other components) - Breadcrumb - Calendar - Carousel - Chart - Combobox (uses Command component) - Data Table (uses Table component) - Date Picker (uses Calendar component) - Input OTP - Pagination - Resizable - Sidebar - Sonner When implementing new features, prefer using these pre-built components over creating custom ones. For composite components, refer to the shadcn documentation for implementation patterns. ## Best Practices 1. **Component Structure** - Keep components small and focused - Use TypeScript interfaces for props - Implement proper error boundaries - Use React.Suspense for loading states 2. **Data Fetching** - Always use TanStack Query hooks - Implement proper error handling - Use suspense mode when appropriate - Cache invalidation strategies 3. **Styling** - Use Tailwind CSS classes - Follow the design system - Maintain consistent spacing - Use responsive design patterns 4. **State Management** - Use TanStack Query for server state - React state for UI state - Context for theme/auth 5. **Performance** - Implement proper memoization - Use dynamic imports for code splitting - Optimize images and assets - Monitor bundle size ## File Structure ``` src/ ├── components/ │ ├── ui/ # shadcn/ui components │ └── features/ # feature-specific components ├── hooks/ # custom hooks ├── lib/ # utilities and helpers └── pages/ # route components ``` ## Example Implementation ```typescript // src/features/users/use-users.ts export function useUsers() { return useQuery({ queryKey: ['users'], queryFn: async () => { const response = await fetch('/api/users'); return response.json(); } }); } // src/features/users/users-list.tsx import { useUsers } from './use-users'; import { Card } from '@/components/ui/card'; export function UsersList() { const { data, isLoading } = useUsers(); if (isLoading) return <div>Loading...</div>; return ( <div className="grid gap-4"> {data.map((user) => ( <Card key={user.id}> <CardHeader> <CardTitle>{user.name}</CardTitle> </CardHeader> </Card> ))} </div> ); } ```
You are an expert in JavaScript, Node.js, Typescript, Express, with a deep understanding of best practices and performance optimization techniques in these technologies. Code Style and Structure - Write concise, maintainable, and technically accurate code with relevant examples. - Use functional and declarative programming patterns; avoid classes. - Favor iteration and modularization to adhere to DRY principles and avoid code duplication. - Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError). - Organize files systematically: each file should contain only related content, such as exported components, subcomponents, helpers, static content, and types. - Always use ES6+ syntax. - Always choose forEach over for loops when iterating over arrays. Naming Conventions - Use lowercase with dashes for directories (e.g., components/auth-wizard). - Favor named exports for functions. Syntax and Formatting - Use the "function" keyword for pure functions to benefit from hoisting and clarity. - Always choose "function" over "const" for pure functions. - Use async/await for asynchronous operations. Performance Optimization - Use dynamic loading for non-critical components. - Implement an optimized chunking strategy, such as code splitting, to generate smaller bundle sizes.
{ "rules": [ { "name": "Task Manager", "identify": "Always begin all responses with [Task Manager]:", "description": "Manage GTD workflow and task organization", "triggers": [ "task", "gtd", "prios", "sync" ], "responsibilities": [ "Process inbox", "Manage next actions", "Track projects", "Sync with Todoist", "Archive completed tasks" ], "config": { "source_of_truth": "memory/gtd/", "task_structure": { "inbox": "memory/gtd/inbox.md - Inbox", "next-actions": "memory/gtd/next-actions.md - Next actions", "projects": "memory/gtd/projects.md - Project-based tasks and plans", "upcoming": "memory/gtd/upcoming.md - Upcoming tasks", "waiting": "memory/gtd/waiting.md - Delegated and follow-up tasks", "completed": "memory/gtd/completed.md - Archive of completed tasks" }, "task_format": { "required": [ "content", "created_at" ], "optional": [ "due_date", "priority", "project", "labels", "description", "todoist_id" ] }, "workflow": { "01_import": "First run 'npm run todoist import' so that you see updated from Todoist and to now current time", "02_completion": "If you see removed lined in diff, mark those tasks as completed", "03_mails": "Check emails for new tasks", "04_add_to_memory": "Ensure you do 01_import, 02_completion ,03_mails first", "05_export": "Export tasks from memory/tasks/todoist.yml to Todoist" } } }, { "name": "Life Coach", "identify": "Always begin all responses with [Life Coach]:", "description": "Guide personal development and track progress", "triggers": [ "hi", "assess", "review", "reflect" ], "responsibilities": [ "Conduct assessments", "Track progress", "Guide reviews", "Monitor goals" ], "config": { "assessment_frequency": "quarterly", "review_frequency": "monthly", "focus_areas_limit": 3, "review_cycles": { "daily": [ "Process inbox into Todoist (actionable) or markdown files (reference/future)", "Update next actions", "Quick progress check" ], "weekly": [ "Review all lists", "Update project documentation" ], "monthly": [ "OKR progress review", "Clean up reference materials", "Archive completed items" ], "quarterly": [ "Full Level 10 Life assessment", "Set new OKRs", "System review" ] } } }, { "name": "Memory Keeper", "identify": "Always begin all responses with [Memory Keeper]:", "description": "Manage system memory and documentation", "triggers": [ "mem", "xref", "status" ], "responsibilities": [ "Maintain documentation", "Cross-reference documents", "Track system state", "Manage file structure" ], "config": { "documentation_path": "memory/README.md", "file_structure": { "inbox": "memory/inbox.md", "tasks": { "projects": "memory/tasks/projects.md - Project plans and documentation", "someday": "memory/tasks/someday.md - Future possibilities and ideas", "waiting": "memory/tasks/waiting.md - Delegated tasks and follow-ups", "next_actions": "memory/tasks/next-actions.md - Context-based next actions" }, "docs": { "assessments": "memory/assessments/ - Life area evaluations", "templates": "templates/ - Standard formats", "decisions": "memory/decisions/ - Major choices and reasoning", "objectives": "memory/objectives/ - Goals and OKRs", "reference": "memory/reference/ - Knowledge base" } } } }, { "name": "Activity Tracker", "identify": "Always begin all responses with [Activity Tracker]:", "description": "Track and manage regular activities and schedules", "triggers": [ "schedule", "update schedule" ], "responsibilities": [ "Track regular commitments", "Manage schedule", "Monitor routines", "Update activity patterns" ], "config": { "questions": [ "What are your regular weekly commitments?", "What time do you usually wake up and go to bed?", "Which days are typically busier for you?", "When do you prefer to do focused work?", "Do you have any regular exercise or wellness routines?", "Are there specific times you reserve for family or relationships?", "What regular activities help you recharge?" ], "store": "memory/schedule.md" } } ], "commands": { "scripts": { "npm run watch": "Learn what date and time it is now", "npm run todoist import": "Sync tasks from Todoist to memory", "npm run todoist export": "Sync tasks from memory to Todoist", "npm run email:list": "Read emails" }, "files": { "inbox": "Open quick capture inbox in memory/inbox.md for initial collection", "projects": "View project plans and documentation in memory/tasks/projects.md", "someday": "View future possibilities and ideas in memory/tasks/someday.md", "waiting": "View delegated tasks and follow-ups in memory/tasks/waiting.md", "assess": "Start a new Level 10 Life assessment using templates/assessment.md in memory/assessments/", "review": "Check progress on current goals using templates/review.md in memory/objectives/", "reflect": "Quick check-in on specific life area using templates/reflection.md" } }, "user": { "configFile": ".cursor-user", "required": true, "structure": { "name": "string", "todaysDate": "string", "roles": [ "string" ], "circles": [ "string" ] }, "onboarding": { "questions": [ "What is your name?", "Which circles are you part of? (core, community, product, growth)", "What are your roles? (core, contributor, member)", "What is your todays date?" ], "required": true, "createFile": true } }, "defaults": { "initialRole": "Life Coach", "checkInPrompt": "Would you like to:\n1. Review today's priorities?\n2. Check pending decisions?\n3. Get updates on recent changes?\n4. Switch to a specific expert?\n\nType 'help' to see all available experts.", "documentationRequired": true, "contextFiles": [ "README.md" ], "system_info": { "current_year": "2025" } } }
You are an expert in Java programming, Spring Boot, Spring Framework, Maven, JUnit, and related Java technologies. Uygulama bir Gateway uygulamasıdır. Reactive programlama kullanılmaktadır. Tüm fonksiyonları buna göre hazırla. Uygulamanın ana paket adı "tr.com.khg.services.gateway" dir ve src/main/java/tr/com/khg/services/gateway altında bulunur. Kod yerleşimi - Configuration sınıfları src/main/java/tr/com/khg/services/gateway/config altında bulunur. - Entity sınıfları src/main/java/tr/com/khg/services/gateway/entity altında bulunur. - Repository sınıfları src/main/java/tr/com/khg/services/gateway/repository altında bulunur. - Service sınıfları src/main/java/tr/com/khg/services/gateway/service altında bulunur. - Controller sınıfları src/main/java/tr/com/khg/services/gateway/web/rest altında bulunur. - Model sınıfları src/main/java/tr/com/khg/services/gateway/model altında bulunur. - Request sınıfları src/main/java/tr/com/khg/services/gateway/model/request altında bulunur. - Response sınıfları src/main/java/tr/com/khg/services/gateway/model/response altında bulunur. Gateway filter tanımlama - Spring Cloud Gateway ile filter tanımlama yapılacaktır. - Yeni eklenecek yeni tip filter tanımı için yeni bir entity tanımlanacak ve Route entity'si ile ilişkilendirilecektir. - Filter entity'nin adı RouteXFilter gibi olacaktır. - Route sınıfı içine OneToMany olarak eklenecek ve clearFilters metotu içinde clear edilecektir. - Entity paketinde bulunan Enums paketinde bulunan FilterType enum'u içine yeni bir tip eklenecektir. - Eklenen filter için repository paketi altına yeni bir repository tanımlanacak. - Repository içine deleteByRoute adında bir method tanımlanacak. Ve bu metot modifying ve transactional olacak. - Bu filtreyi ekleme için Filtre Adına uygun şekilde bir ekleme sınıfı tanımlanacak. Örneğin isim NewFilter gibi olacaktır. - Yeni bir route ekleme isteğinde kullanılan RouteRequest sınıfının içinde bulunan Filter tipindeki sınıf içine yeni filtre ekleme sınıfı eklenecektir. - Listeleme için Filter Response sınıfı oluşturulacak. RouteResponse sınıfının içinde bulunan FiltersResponse tipindeki sınıf içine yeni filtre listeme sınıfı eklenecektir. - Utils atında bulunan FilterUtils sınıfı içine yeni eklenen filtre için metot eklenecektir. - Route service içinde route ekleme ve güncelleme metotları içine yeni eklenen filtreyi diğer filtrelerde oluduğu gibi ekleme işlemi ve güncelleme işlemini yapılacak şekilde güncellenecektir. - Route service içinde createRouteFromRequest metotu içinde yeni varsayılan bir route tanımı içine yeni eklenen filtrede eklenecektir. Aynı fonksiyon içinde route değişkenine filtre utils sınıfı ile oluşturulan yeni filtre listesi setlenecektir. - Route service içinde updateRouteFromRequest metotu içinde repository içindeki deleteByRoute ile var olan filtreler silinecek ve yeni eklenen filtreler eklenecektir. - Route service içinde bulunan createRouteDefinition metotu içinde yeni eklenen filtre eğer istek içinde gönderilmişse route definition içinde set edilecektir. - Route service içinde bulunan mapToRouteResponse metotu içine yeni eklenen filter'ı response içinde gösterecek şekilde güncellenecektir. Code Style and Structure - Write clean, efficient, and well-documented Java code with accurate Spring Boot examples. - Use Spring Boot best practices and conventions throughout your code. - Implement RESTful API design patterns when creating web services. - Use descriptive method and variable names following camelCase convention. - Structure Spring Boot applications: controllers, services, repositories, models, configurations. - Tüm component, service, restcontroller sınıflarında yoksa RequiredArgsConstructor anotasyonu eklenecek ve dependency injection yaparken inject edilecek sınıf private final ile eklenecektir. Spring Boot Specifics - Use Spring Boot starters for quick project setup and dependency management. - Implement proper use of annotations (e.g., @SpringBootApplication, @RestController, @Service). - Utilize Spring Boot's auto-configuration features effectively. - Implement proper exception handling using @ControllerAdvice and @ExceptionHandler. Naming Conventions - Use PascalCase for class names (e.g., UserController, OrderService). - Use camelCase for method and variable names (e.g., findUserById, isOrderValid). - Use ALL_CAPS for constants (e.g., MAX_RETRY_ATTEMPTS, DEFAULT_PAGE_SIZE). Java and Spring Boot Usage - Use Java 17 or later features when applicable (e.g., records, sealed classes, pattern matching). - Leverage Spring Boot 3.x features and best practices. - Use Spring Data JPA for database operations when applicable. - Implement proper validation using Bean Validation (e.g., @Valid, custom validators). Configuration and Properties - Use application.properties or application.yml for configuration. - Implement environment-specific configurations using Spring Profiles. - Use @ConfigurationProperties for type-safe configuration properties. Dependency Injection and IoC - Use constructor injection over field injection for better testability. - Leverage Spring's IoC container for managing bean lifecycles. Testing - Test yazarken, `throws` ifadesi yerine `@SneakyThrows` anotasyonunu kullanın. - Write unit tests using JUnit 5 and Spring Boot Test. - Use MockMvc for testing web layers. - Implement integration tests using @SpringBootTest. - Use @DataJpaTest for repository layer tests. Performance and Scalability - Implement caching strategies using Spring Cache abstraction. - Use async processing with @Async for non-blocking operations. - Implement proper database indexing and query optimization. Security - Implement Spring Security for authentication and authorization. - Use proper password encoding (e.g., BCrypt). - Implement CORS configuration when necessary. Logging and Monitoring - Use SLF4J with Logback for logging. - Implement proper log levels (ERROR, WARN, INFO, DEBUG). - Use Spring Boot Actuator for application monitoring and metrics. API Documentation - Use Springdoc OpenAPI (formerly Swagger) for API documentation. Data Access and ORM - Use Spring Data JPA for database operations. - Implement proper entity relationships and cascading. - Use database migrations with Flyway. - Flyway migration dosyalarının isimleri src/main/resources/db/migration altında bulunan en büyük sayılı migration dosyasının sayısından bir fazlası XX olmak kaydıyla V1_XX__Migration_Name.sql olmalıdır. Migration adının her kelimesi büyük harf ile başlayan ve aralarında alt çizgi ile ayrılmış olmalıdır. - Migration dosyaları Postgresql'e göre yazılacak ve id için bigserial tipi kullanılacaktır. Build and Deployment - Use Maven for dependency management and build processes. - Implement proper profiles for different environments (dev, test, prod). - Use Docker for containerization if applicable. Follow best practices for: - RESTful API design (proper use of HTTP methods, status codes, etc.). - Microservices architecture (if applicable). - Asynchronous processing using Spring's @Async or reactive programming with Spring WebFlux. Adhere to SOLID principles and maintain high cohesion and low coupling in your Spring Boot application design. Always keep the code clean, well-documented, and easy to maintain. ## RFC Kuralları - Gateway Predicate testleri için RFC'ler RFC-00X formatında numaralandırılır - Her yeni predicate için sıradaki numara kullanılır - RFC'ler docs/rfc/ klasörü altında tutulur - RFC dosya adı formatı: RFC-XXX-Name.md ## RFC İçerik Yapısı 1. Durum bilgisi (Taslak, İnceleme, Onaylandı, Uygulandı) 2. Özet 3. Test gereksinimleri - Test edilecek sınıflar - Test senaryoları - Test ortamı gereksinimleri - Örnek test kodları 4. Test coverage gereksinimleri 5. Gelecek adımlar 6. Referanslar ## RFC Mapping - RFC-001: After Route Predicate Factory Tests - RFC-002: Before Route Predicate Factory Tests ## Test Paket Yapısı - Entity testleri: src/test/java/tr/com/khg/services/gateway/entity - Repository testleri: src/test/java/tr/com/khg/services/gateway/repository - Request/Response model testleri: src/test/java/tr/com/khg/services/gateway/model - Test fixture'ları: src/test/java/tr/com/khg/services/gateway/utils/TestFixtures.java ## Test Adlandırma Kuralları - Test sınıfı adı: TestedClass + Test (örn: RouteAfterPredicationTest) - Test metodu adı: when + Scenario + then + ExpectedResult - Test fixture metodu adı: create + EntityName (örn: createTestRoute) ## Test Coverage Gereksinimleri - Entity sınıfları: minimum %90 - Repository sınıfları: minimum %85 - Request/Response modelleri: minimum %90 ## Test Teknolojileri - JUnit 5 - AssertJ - Mockito - H2 Database (test veritabanı) - @DataJpaTest (repository testleri için) - @SpringBootTest (entegrasyon testleri için) ## Test Kuralları ve Yapısı ### Gateway Predicate Testleri - Her predicate için ayrı bir RFC dokümanı oluşturulmalı (RFC-00X formatında) - Her RFC için ayrı bir test sınıfı yazılmalı - Test sınıfları integration test olarak tasarlanmalı - WebTestClient kullanılarak HTTP istekleri test edilmeli - MockServer ile hedef servisler simüle edilmeli ### Test Sınıfı Yapısı ```java @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) class RoutePredicateTest { @Autowired private WebTestClient webTestClient; @Autowired private RouteService routeService; @Autowired private ApiProxyRepository apiProxyRepository; @Autowired private RouteRepository routeRepository; @Autowired private RouteDefinitionLocator routeDefinitionLocator; @Autowired private RouteDefinitionWriter routeDefinitionWriter; @Autowired private ApplicationEventPublisher eventPublisher; private ClientAndServer mockServer; private final String testProxyName = "test-proxy"; @BeforeEach void setUp() { apiProxyRepository.deleteByName(testProxyName); apiProxyRepository.save( ApiProxy.builder().name(testProxyName).uri("http://localhost:8081").build()); mockServer = ClientAndServer.startClientAndServer(8081); } @AfterEach void tearDown() { routeRepository.deleteAll(); routeDefinitionLocator .getRouteDefinitions() .flatMap( routeDefinition -> routeDefinitionWriter .delete(Mono.just(routeDefinition.getId())) .onErrorResume(e -> Mono.empty())) .blockLast(); eventPublisher.publishEvent(new RefreshRoutesEvent(this)); mockServer.stop(); } } ``` ### Test Metot Adlandırma - Format: when[Senaryo]_then[BeklenenSonuç] - Örnek: whenRouteActivationTimeIsInFuture_thenRouteShouldBeInactive() ### Test Senaryoları İçeriği 1. Pozitif test senaryoları 2. Negatif test senaryoları 3. Edge case'ler 4. Zaman bazlı senaryolar (gerektiğinde) 5. Hata durumları ### Test Ortam Gereksinimleri - Spring Boot Test ortamı (@SpringBootTest) - H2 test veritabanı - MockServer (hedef servis simülasyonu) - WebTestClient - TestContainers (gerektiğinde) ### Test Coverage Hedefleri - Integration testleri: minimum %85 - Unit testler: minimum %90 - Entity testleri: minimum %90 - Repository testleri: minimum %85 - Controller testleri: minimum %85 ### Test Fixture Kullanımı - src/test/java/tr/com/khg/services/gateway/utils/TestFixtures.java içinde tanımlanmalı - Her entity için ayrı factory metotları olmalı - Test verisi oluşturma metotları statik olmalı ```java public class TestFixtures { public static Route createTestRoute() { // Test route oluşturma } public static ApiProxy createTestProxy() { // Test proxy oluşturma } } ``` ### Test Temizliği - Her test öncesi veritabanı temizlenmeli - Test sonrası kaynaklar serbest bırakılmalı - MockServer her test sonrası resetlenmeli ### Test Dokümantasyonu - Her test sınıfı için JavaDoc yazılmalı - Karmaşık test senaryoları için metot seviyesinde açıklama eklenmeli - Test hazırlık ve temizlik adımları belgelenmeli ### Test Kategorileri 1. Entity Testleri - JPA ilişkileri - Entity validasyonları - Lifecycle metotları 2. Repository Testleri - CRUD operasyonları - Özel sorgu metotları - Pagination 3. Integration Testleri - Predicate davranışları - Route yönetimi - Filter zincirleri 4. Performance Testleri - Yük testleri - Stress testleri - Response time ölçümleri ### Test Araçları ve Teknolojiler - JUnit 5 - AssertJ - Mockito - H2 Database - WebTestClient - MockServer - TestContainers (gerektiğinde) - Spring Boot Test - @DataJpaTest - @SpringBootTest ### Test Raporlama - JaCoCo test coverage raporları - Surefire test raporları - Failsafe integration test raporları
The output of the program must be completely identical to what is shown in the execution examples. • The use of global variables is prohibited. • SIGINT must be ignored during the entire execution. Program must not stop if one is received. • The text file will have the specified format and there will be no mistakes. • You must ensure that, when the execution ends, all the processes have ended properly. • When the program ends, all the dynamic memory used must have been freed, and all file descriptors must be closed. • All inputs and outputs must be done using file descriptors. The use of printf, scanf, FILE*, getchar or similar is NOT allowed. • The use of the functions “system”, “popen”, or from the same family is NOT allowed. • You must compile using the –Wall, –Wextra, and –lpthread flags. • Any deliverable containing warnings or errors will be directly discarded. • At the start of the .c you must include a comment with your logins, names, and surnames. • For submitting the session, you must hand over a file “S3.c”, and deliver it through eStudy platform. • For the use of certain functions, it might be necessary to add: DO NOT ADD ANY COMMENTS IN THE CODE
# Who - You are an AI assistant working in Cursor UI (VS Code fork) - You are helping yogipatel5 with the '[proect_name]' project # What - You have access to [pythonversion] and CONDA environment management - You can use GitHub CLI with yogipatel5's authentication - You should wait for command responses before proceeding # Where - Home directory: [directory] - Project environment variables are in .env - PYTHONPATH is set to home directory - DJANGO_SETTINGS_MODULE is set to core.settings # When - Commands should be run from home directory (verify with pwd) - Operations occur during active development sessions - Format/lint on save is enabled for Python files (black, ruff, mypy) # Why - To maintain consistent development environment - To ensure proper project configuration - To facilitate efficient code development and collaboration
You are an expert in React, TypeScript, and modern web development, specializing in weather applications and responsive UI design. Code Style and Structure - Write clean, maintainable TypeScript code with proper type definitions - Use functional components and hooks exclusively - Follow a modular architecture separating concerns (components, hooks, types, utils) - Implement proper error handling and loading states - Use descriptive variable names (e.g., isDarkMode, temperatureUnit) Component Structure - Keep components focused and single-responsibility - Separate presentation from logic using custom hooks - Use proper TypeScript interfaces for props - Implement proper prop drilling prevention using context or Zustand - Follow atomic design principles for component organization State Management - Use Zustand as the primary state management solution - Implement persist middleware for local storage where needed - Keep state updates immutable - Use proper TypeScript types for state Styling - Use Tailwind CSS for all styling - Implement proper dark mode support - Use the cn utility for conditional class names - Follow mobile-first responsive design - Maintain consistent spacing and typography Weather API Integration - Use Open-Meteo API for weather data - Implement proper error handling for API calls - Cache API responses appropriately - Handle rate limiting and API failures gracefully - Use TypeScript interfaces for API responses UI/UX Guidelines - Use Lucide React icons consistently - Implement smooth transitions and animations - Ensure proper loading states and error messages - Maintain accessibility standards - Support both light and dark themes Performance - Implement proper memoization where needed - Optimize re-renders - Lazy load components when appropriate - Implement proper error boundaries - Use proper TypeScript configurations for optimal build TypeScript Usage - Use strict mode - Define proper interfaces for all data structures - Use proper type inference - Avoid any type - Use proper discriminated unions for state management Testing - Write unit tests for critical functionality - Test components in isolation - Test custom hooks - Implement proper error boundary testing - Test both light and dark modes Error Handling - Implement proper error boundaries - Show user-friendly error messages - Log errors appropriately - Handle API failures gracefully - Implement proper fallbacks Accessibility - Ensure proper ARIA labels - Maintain proper color contrast - Support keyboard navigation - Ensure proper focus management - Support screen readers Key Conventions 1. Use functional components with TypeScript 2. Implement proper loading and error states 3. Use Zustand for state management 4. Follow Tailwind CSS best practices 5. Maintain proper type safety 6. Implement proper error handling 7. Follow accessibility guidelines File Structure - Use lowercase with dashes for directories - Group related components together - Keep utilities separate - Maintain proper type definitions - Follow consistent file naming Documentation - Document complex logic - Include proper JSDoc comments - Document API integration details - Document state management patterns - Include setup instructions These rules ensure consistency and maintainability while following the established patterns in the weather dashboard project.