Development
Information for developers who want to contribute to AUCO or work with the source code.
Development Setup
Prerequisites
- Node.js: Version 18 or higher
- Git: For version control
- Database: PostgreSQL, SQLite, or MySQL for testing
Getting Started
-
Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/auco.git
cd auco -
Install dependencies:
npm install -
Setup development environment:
# Start local PostgreSQL (if using Docker)
docker run --name postgres-dev \
-e POSTGRES_PASSWORD=postgres \
-p 5432:5432 \
-d postgres:13
# Start local Starknet devnet
npm run chain -
Run tests:
npm test
Building from Source
Build the Project
npm run build
This compiles TypeScript to JavaScript in the dist/ directory.
Watch Mode (Development)
npm run dev
Runs the compiler in watch mode for active development.
Testing
Running Tests
# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watch
Test Structure
Tests are organized by component:
tests/unit/- Unit tests for individual componentstests/integration/- Integration tests with real databasestests/e2e/- End-to-end tests with real Starknet nodes
Code Quality
AUCO maintains high code quality standards through automated tools.
Linting
# Check code style
npm run lint
# Fix code style issues automatically
npm run lint:fix
Formatting
# Format code with Prettier
npm run format
# Check if code is properly formatted
npm run format:check
Type Checking
# Run TypeScript type checking
npm run typecheck
Contributing
We welcome contributions! Please follow these guidelines:
Code Style
- Use TypeScript for all new code
- Follow the existing code style (enforced by ESLint and Prettier)
- Write tests for new functionality
- Update documentation as needed
Pull Request Process
-
Create a feature branch:
git checkout -b feature/your-feature-name -
Make your changes following the code style guidelines
-
Run tests and quality checks:
npm test
npm run lint
npm run typecheck -
Commit your changes with a descriptive message:
git commit -m "feat: add support for new feature" -
Push your branch and create a pull request
Commit Message Format
Follow conventional commits format:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changesrefactor:- Code refactoringtest:- Test-related changeschore:- Build process or auxiliary tool changes
Project Structure
auco/
├── src/ # Source code
│ ├── core/ # Core indexer logic
│ ├── database/ # Database adapters
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Utility functions
├── tests/ # Test files
├── example/ # Example implementations
├── docs/ # Documentation
└── scripts/ # Build and utility scripts
Debugging
Enable Debug Logging
import { StarknetIndexer, LogLevel } from "auco";
const indexer = new StarknetIndexer({
logLevel: LogLevel.DEBUG,
// ... other config
});
Environment Variables
Set debug environment variables:
# Enable all debug output
DEBUG=auco:*
# Enable specific debug namespaces
DEBUG=auco:database,auco:websocket
Release Process
Versioning
AUCO follows Semantic Versioning:
- Major: Breaking changes
- Minor: New features (backward compatible)
- Patch: Bug fixes (backward compatible)
Creating a Release
- Update version in
package.json - Update CHANGELOG.md with release notes
- Run tests to ensure everything works
- Create a git tag:
git tag v1.2.3
git push origin v1.2.3 - Publish to npm:
npm publish
Performance Testing
Benchmarking
Run performance benchmarks:
npm run benchmark
Memory Profiling
Profile memory usage during development:
# Run with memory profiling
node --inspect --max-old-space-size=4096 dist/example/index.js
Documentation
Building Documentation
The documentation is built with Docusaurus:
# Install documentation dependencies
cd docs
npm install
# Start development server
npm run start
# Build documentation
npm run build
Writing Documentation
- Use clear, concise language
- Include code examples for all features
- Add troubleshooting information for common issues
- Keep documentation up-to-date with code changes
Getting Help
Community Resources
- GitHub Issues: Report bugs or request features
- GitHub Discussions: Ask questions and share ideas
- Discord: Join our community chat (link in README)
Maintainer Contact
For questions about contributing or the development process, reach out to the maintainers through GitHub issues or discussions.
Acknowledgments
AUCO is built with excellent open-source libraries:
- Starknet.js - Starknet JavaScript library
- abi-wan-kanabi - Type-safe ABI parsing
- node-postgres - PostgreSQL client
- better-sqlite3 - SQLite client
- mysql2 - MySQL client
Thank you to all contributors and the broader Starknet ecosystem!