- Updated docker-entrypoint.sh to improve ClamAV service initialization and logging. - Added checks for ClamAV and freshclam daemon status. - Optimized freshclam configuration for container usage, including logging to stdout and setting database directory. - Introduced caching mechanism for enabled file extensions in vinejs_provider.ts to reduce database queries. - Implemented a new command to list datasets needing DataCite DOI updates, with options for verbose output, count only, and IDs only. - Updated package dependencies to include p-limit and pino-pretty. - finalized ace command 'detect:missing-cross-references' |
||
|---|---|---|
| .gitea/workflows | ||
| app | ||
| bin | ||
| commands | ||
| config | ||
| contracts | ||
| database | ||
| docs/commands | ||
| providers | ||
| public | ||
| resources | ||
| src | ||
| start | ||
| tests | ||
| .babelrc | ||
| .dockerignore | ||
| .editorconfig | ||
| .env.example | ||
| .eslintrc.json | ||
| .gitignore | ||
| .prettierignore | ||
| .prettierrc | ||
| ace.js | ||
| adonisrc.ts | ||
| clamd.conf | ||
| components.d.ts | ||
| docker-entrypoint.sh | ||
| Dockerfile | ||
| freshclam.conf | ||
| index.d.ts | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.cjs | ||
| readme.md | ||
| tailwind.config.js | ||
| tsconfig.json | ||
| vite.config.ts | ||
| webpack.config.cjs | ||
Tethys Research Repository Backend System
Welcome to the Tethys Research Repository Backend System! This is the backend component responsible for managing datasets, users, and the core functionality of the Tethys Data Research Repository.
Table of Contents
- Getting Started
- Usage
- Configuration
- Database
- API Documentation
- Commands
- Documentation
- Contributing
- License
Getting Started
Prerequisites
Before you begin, ensure you have met the following requirements:
- Node.js and npm installed on your development machine.
- A running PostgreSQL database instance.
- AdonisJS CLI globally installed.
Installation
-
Clone this repository:
git clone git clone https://gitea.geologie.ac.at/geolba/tethys.backend.git cd tethys-backend -
Install dependencies:
npm install -
Configure environment variables (see Configuration)
-
Run database migrations:
node ace migration:run -
Start the development server:
npm run dev
Usage
The Tethys Backend provides RESTful APIs for managing research datasets, user authentication, DOI registration, and search functionality.
Configuration
Copy the .env.example file to .env and configure the following variables:
Database Configuration
DB_CONNECTION=pg
DB_HOST=localhost
DB_PORT=5432
DB_USER=your_username
DB_PASSWORD=your_password
DB_DATABASE=tethys_db
DataCite Configuration
# DataCite Credentials
DATACITE_USERNAME=your_datacite_username
DATACITE_PASSWORD=your_datacite_password
DATACITE_PREFIX=10.21388
# Environment-specific API endpoints
DATACITE_API_URL=https://api.test.datacite.org # Test environment
DATACITE_SERVICE_URL=https://mds.test.datacite.org # Test MDS
# For production:
# DATACITE_API_URL=https://api.datacite.org
# DATACITE_SERVICE_URL=https://mds.datacite.org
OpenSearch Configuration
OPENSEARCH_HOST=localhost:9200
Application Configuration
BASE_DOMAIN=tethys.at
APP_KEY=your_app_key
Database
The system uses PostgreSQL with Lucid ORM. Key models include:
- Dataset: Research dataset metadata
- DatasetIdentifier: DOI and other identifiers for datasets
- User: User management and authentication
- XmlCache: Cached XML metadata
Run migrations and seeders:
# Run migrations
node ace migration:run
# Run seeders (if available)
node ace db:seed
API Documentation
API endpoints are available for:
- Dataset management (
/api/datasets) - User authentication (
/api/auth) - DOI registration (
/api/doi) - Search functionality (
/api/search)
Detailed API documentation can be found in the /docs/api directory.
Commands
The system includes several Ace commands for maintenance and data management:
Dataset Indexing
# Index all published datasets to OpenSearch
node ace index:datasets
# Index a specific dataset
node ace index:datasets --publish_id 123
DataCite DOI Management
# Update DataCite records for modified datasets
node ace update:datacite
# Show detailed statistics for datasets needing updates
node ace update:datacite --stats
# Preview what would be updated (dry run)
node ace update:datacite --dry-run
# Force update all DOI records
node ace update:datacite --force
# Update a specific dataset
node ace update:datacite --publish_id 123
For detailed command documentation, see the Commands Documentation
Documentation
Comprehensive documentation is available in the /docs directory:
- Commands Documentation - Detailed guides for Ace commands
- DataCite Update Command - DOI synchronization and management
- Dataset Indexing Command - Search index management
- API Documentation - REST API endpoints and usage
- Deployment Guide - Production deployment instructions
- Configuration Guide - Environment setup and configuration options
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Guidelines
- Follow the existing code style and conventions
- Write tests for new features
- Update documentation for any API changes
- Ensure all commands and migrations work properly
Testing Commands
# Run tests
npm test
# Test specific commands
node ace update:datacite --dry-run --publish_id 123
node ace index:datasets --publish_id 123
License
This project is licensed under the MIT License.