mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-17 22:27:19 +00:00
3.2 KiB
3.2 KiB
AeThex-OS Copilot Coding Agent Instructions
Project Overview
AeThex-OS is a modular web desktop platform built with TypeScript, React, Vite, Drizzle ORM, and Supabase. It features a multi-service architecture with clear separation between client, server, shared schema, and data migration layers. The system is designed for extensibility, rapid prototyping, and integration with external APIs and authentication providers.
Key Architectural Patterns
- Client/Server Split:
client/contains the React SPA, UI components, hooks, and page logic.server/contains API routes, static asset serving, websocket logic, and Supabase integration.shared/schema.tsdefines all database tables and Zod validation schemas, used by both client and server.
- Drizzle ORM:
- All database schema and types are defined in
shared/schema.tsusing Drizzle'spgTableand Zod schemas. - Migrations are managed in
migrations/.
- All database schema and types are defined in
- Authentication:
- Supabase Auth is used for user management. Profiles are linked to
auth.users(id).
- Supabase Auth is used for user management. Profiles are linked to
- Component Organization:
- UI components are in
client/src/components/and subfolders. Shared hooks are inclient/src/hooks/. - Pages are in
client/src/pages/.
- UI components are in
Developer Workflows
- Build:
- Use Vite for client builds:
npm run build(seevite.config.ts). - Server scripts are in
script/andserver/.
- Use Vite for client builds:
- Test:
- Run shell script
./test-implementation.shfor implementation checks.
- Run shell script
- Migrations:
- Database migrations are in
migrations/. Use Drizzle migration commands as per project docs.
- Database migrations are in
- Debugging:
- Client debugging via Vite dev server. Server debugging via direct script execution or API route testing.
Project-Specific Conventions
- Type Safety:
- All data models use Zod schemas for validation and type inference.
- Default Values:
- Most tables use
.default()for status, roles, and timestamps. Seeshared/schema.tsfor examples.
- Most tables use
- Extensibility:
- New features should be added as new tables in
shared/schema.tsand new components/pages inclient/src/.
- New features should be added as new tables in
- Naming:
- Use
aethex_*prefix for core tables and features (e.g.,aethex_sites,aethex_projects).
- Use
Integration Points
- Supabase:
- Used for authentication and storage. See
client/src/lib/supabase.tsandserver/supabase.ts.
- Used for authentication and storage. See
- Websockets:
- Real-time features via
client/src/hooks/use-websocket.tsandserver/websocket.ts.
- Real-time features via
- API:
- API logic in
server/routes.tsandclient/src/lib/api.ts.
- API logic in
Examples
- Schema Definition: See
shared/schema.tsfor Drizzle/Zod table patterns. - Component Usage: See
client/src/components/Chatbot.tsxfor AI integration. - Migration: See
migrations/for SQL migration examples.
Recommendations for AI Agents
- Always update both schema and Zod types when adding new tables or fields.
- Reference existing patterns for new features (e.g., achievements, profiles, projects).
- Use default values and type-safe patterns as shown in
shared/schema.ts. - When in doubt, follow the naming and structure conventions in existing files.
If any section is unclear or missing, please provide feedback for further refinement.