- Backend Node.js/Express con PostgreSQL - Frontend React 19 con Vite - Docker Compose para orquestacion - Documentacion completa en README.md - Scripts SQL para base de datos - Configuracion de ejemplo (.env.example)
2.4 KiB
2.4 KiB
Copilot Instructions for AI Coding Agents
Project Overview
- This is a React (Vite) frontend for a hotel management system.
- Main app entry:
src/main.jsx, root component:src/App.jsx. - Pages are in
src/pages/(e.g.,Dashboard.jsx,LoginPage.jsx,Employees.jsx). - Reusable UI components are in
src/components/(e.g.,Navbar/,Sidebar.jsx,Modals/,Table/). - Service modules for API calls are in
src/services/(e.g.,api.js,employeeService.js). - Styles are in
src/styles/and component subfolders.
Architecture & Patterns
- Routing: Managed in
src/routes/ProtectedRoute.jsxand page components. - State: Local state via React hooks; no global state manager detected.
- API: All backend communication is abstracted in
src/services/. - Component Structure: Prefer functional components and hooks. Group related files (JSX, CSS) in subfolders.
- UI: Uses Tailwind CSS (see
tailwind.config.cjs), with custom styles insrc/styles/and per-component CSS files.
Developer Workflows
- Start dev server:
npm run dev(Vite) - Build for production:
npm run build - Preview production build:
npm run preview - Install dependencies:
npm install - Lint:
npm run lint(useseslint.config.js) - No test scripts or test files detected
Conventions & Tips
- Component Naming: PascalCase for components, camelCase for files/variables.
- Pages vs Components: Pages in
src/pages/, reusable elements insrc/components/. - Service Layer: All API logic should go in
src/services/, not in components. - Assets: Place images/icons in
public/orsrc/assets/. - Modals, Tables, Filters: Use the subfolders in
src/components/as templates for new UI patterns. - Protected Routes: Use
src/routes/ProtectedRoute.jsxfor auth-guarded navigation.
Integration Points
- API Base URL: Likely configured via
.env(not shown here). - External Libraries: React, Vite, Tailwind CSS, ESLint.
Examples
- To add a new page: create a file in
src/pages/, add a route, and (if needed) update navigation inSidebar.jsxorNavbar.jsx. - To add a new API call: add a function in the relevant
src/services/*.jsfile and import it in your component/page.
For questions about unclear patterns or missing documentation, ask the user for clarification or examples from their workflow.