- Initialize project:
npm init
oryarn init
- Install dependencies:
npm install
oryarn
- Start development server:
npm run dev
oryarn dev
- Build for production:
npm run build
oryarn build
- Run tests:
npm test
oryarn test
- Run single test:
npm test -- -t "test name"
oryarn test -t "test name"
- Formatting: Use Prettier with 2-space indentation
- Naming:
- Components: PascalCase (e.g.,
MoleculeViewer
) - Functions/variables: camelCase (e.g.,
loadMolecule
) - Constants: UPPER_SNAKE_CASE (e.g.,
MAX_CONCURRENT_SESSIONS
)
- Components: PascalCase (e.g.,
- Imports: Group imports by external libraries, then internal modules
- Types: Use TypeScript for type safety when possible
- Error Handling: Use try/catch blocks for ChimeraX operations
- Documentation: JSDoc for functions, inline comments for complex logic
- ChimeraX Integration: Use REST API via localhost for all operations