# Frontend Rules
Apply the following rules to the frontend codebase
## Shadcn Rule
1. You must use `npx shadcn@latest add <component-name>` to add new shadcn components. Never use `npx shadcn-ui@latest add <component-name>` because it is deprecated.
## EsLint and Component Import/Export Rules
1. Make sure you fix all the linting errors and warnings and component import and export rules.
## Vite + React + Tailwind CSS + TypeScript Rule
1. Style with Tailwind CSS utility classes for responsive design
2. Do not export pages as default, instead export them as named exports and import them with the page name.
3. Import components using absolute paths. Never use relative paths.
4. Remove all the unused imports, variables, and components.
# Backend Rules
Apply the following rules to the backend codebase
## Module installation rules
- Insall necessary python modules for generated code on your own using poetry instead of pip.
- Especially for EmailStr, install pydantic[email].
## Type expression rules
- Do not use call expressions like constr() for type annotations. Instead, use the type annotation directly.
## Import rules
- Do not use relative imports. Instead, use absolute imports.
- Import necessary python modules for generated code.
- Import db dependencies from app.dependencies.database instead of app.dependencies.db.
## Database rules
- Create a new directory for each database model in backend/app/database directory with __init__.py, model.py and service.py.
- New model should be derived from BaseModel and new service should be derived from BaseService. Never miss table=True at the model class definition.
- After every change in database, update __init__.py file in app/database directory to include all the models except for the base model. Then, execute "make initialMigration" to create the initial migration. After that, execute "make applyMigration" to apply the migration on your own. Before executing these commands, make sure to be in the backend directory.
css
dockerfile
eslint
express.js
html
javascript
makefile
mako
+7 more
First Time Repository
Python
Languages:
CSS: 3.3KB
Dockerfile: 0.8KB
HTML: 0.4KB
JavaScript: 3.0KB
Makefile: 0.8KB
Mako: 0.6KB
Python: 7.5KB
Shell: 0.2KB
TypeScript: 1.5KB
Created: 1/13/2025
Updated: 1/13/2025