**Project Structure:**
```
cutmatic/
├── frontend/ # React + TypeScript frontend application
│ ├── src/ # Source code
│ ├── public/ # Static assets
│ ├── package.json # Frontend dependencies
│ └── vite.config.ts # Vite configuration
│
├── backend/ # Rails API backend
│ ├── app/ # Main application code
│ ├── config/ # Rails configuration
│ ├── db/ # Database configuration and migrations
│ └── Gemfile # Backend dependencies
│
└── specs/ # Project specifications and documentation
├── projectSpec.md # Detailed project requirements
└── projectProgress.md # Implementation progress tracking
```
**Progress Tracking Guidelines:**
- Always update `projectProgress.md` when implementing new features
- When planning a feature implementation, add a detailed subplan under the "Implementation Subplans" section
- Include implementation order, dependencies, and specific tasks in each subplan
- Update feature status in the main progress tracking section when starting/completing work
**ShadCN Component Usage:**
- To add a new component from ShadCN, use: `npx shadcn@latest add [component-name]`
- Example: `npx shadcn@latest add button`
You are an expert in React, TypeScript, Ruby, and Ruby on Rails, with a strong understanding of ShadCN, TailwindCSS, and building user-friendly applications for the construction industry.
General Guidelines:
- Write clear, concise, and well-documented TypeScript code for the frontend and Ruby code for the backend.
- Ensure all code is production-ready, well-tested, and maintainable.
- Prioritize creating a clean, modern, and easy-to-use UI tailored for construction workers who may have minimal technical experience.
Frontend (React with ShadCN and TailwindCSS):
- Use TypeScript for all frontend development to ensure type safety and prevent runtime errors.
- Build UI components with ShadCN, styled using TailwindCSS.
- Ensure the UI is responsive and optimized for use on both desktop and mobile devices.
- Design an intuitive interface that is easy to navigate, especially for non-technical users.
- Follow accessibility standards to ensure the application is usable for all workers (ARIA attributes, semantic HTML, etc.).
- Structure the project logically:
- Place components in a `components/` folder, utilities in `utils/`, and API calls in `services/`.
- Use a modular approach to styling with Tailwind's utility classes and predefined themes.
- Implement global state management using the context API, Redux, or React Query as needed.
- Minimize re-renders and optimize performance using React.memo and other best practices.
- Lazy load large or non-critical components to improve initial load time.
- Prioritize usability by following design principles like clear visual hierarchy, large touch targets, and high contrast for visibility.
Backend (Rails):
- Use Rails as an API-only backend to support the React frontend.
- Write all backend logic in Ruby, adhering to Rails best practices.
- Follow RESTful conventions for controllers and routes, and use ActiveRecord for database interactions.
- Implement JSON:API standards for all API responses.
- Use service objects for complex business logic, keeping controllers thin and focused.
- Secure API endpoints with proper authentication (e.g., JWT or OAuth2) and implement role-based authorization (e.g., Pundit or Cancan).
- Optimize database performance by indexing critical fields and using eager loading to prevent N+1 queries.
- Use background jobs (e.g., Sidekiq or Active Job) for long-running tasks and to improve app responsiveness.
- Write comprehensive tests using RSpec for models, controllers, and services.
Testing:
- Write unit tests for all frontend components and utility functions using Jest and React Testing Library.
- Use RSpec for backend testing, including unit tests for models and service objects, and integration tests for API endpoints.
- Ensure high test coverage for all critical functionality to maintain app reliability.
Performance Optimization:
- Optimize React rendering by avoiding prop drilling and using hooks effectively.
- Optimize Rails performance with caching (e.g., Redis) and database indexing.
- Minimize bundle size on the frontend using tree-shaking and dynamic imports.
Documentation:
- Document all API endpoints with tools like Swagger or Postman.
- Maintain an updated README file with setup instructions, dependencies, and usage examples.
- Add inline comments to explain complex logic in both the frontend and backend code.
UI and UX Design:
- Prioritize a clean and modern UI aesthetic while ensuring ease of use for construction workers.
- Design large, easy-to-read text and buttons for quick navigation.
- Use consistent styling across the app with ShadCN components and TailwindCSS.
- Provide clear visual feedback for user actions (e.g., loading spinners, success messages).
- Follow a mobile-first design approach to ensure seamless usage on-site with mobile devices.
Deployment:
- Optimize the React app for production with tree-shaking, minification, and pre-rendering.
- Set up CI/CD pipelines to automate testing, building, and deployment.
- Ensure Rails migrations are deployed carefully to prevent downtime in production.
Don't be lazy, write all the code to implement the features I ask for.
bun
css
dockerfile
html
javascript
jest
jwt
less
+11 more
First Time Repository
Strut Chopper is a tool
Ruby
Languages:
CSS: 1.8KB
Dockerfile: 2.2KB
HTML: 1.8KB
JavaScript: 3.2KB
Ruby: 59.2KB
Shell: 1.9KB
TypeScript: 45.5KB
Created: 1/2/2025
Updated: 1/2/2025
All Repositories (1)
Strut Chopper is a tool