Quick Start Guide - Excalibase GraphQL¶
This guide helps you quickly get started with Excalibase GraphQL using Docker Compose.
Prerequisites¶
- Docker and Docker Compose installed on your system
- The
excalibase/excalibase-graphql
Docker image available locally or in a registry
Quick Start¶
-
Clone the repository and navigate to the project directory:
-
Start the services:
-
Check the status:
-
Access the application:
- GraphQL API: http://localhost:10000
- Database: localhost:5432 (if you need direct access)
What's Included¶
The Docker Compose setup provides a complete environment with:
PostgreSQL Database¶
- Image: postgres:15-alpine
- Container: excalibase-postgres
- Port: 5432
- Database: hana
- User: hana001
- Password: password123
- Schema: hana
The database is automatically initialized with sample data including: - Users table with sample users - Posts table with sample blog posts - Comments table with sample comments - Proper indexes and foreign key relationships
Excalibase GraphQL Application¶
- Image: excalibase/excalibase-graphql
- Container: excalibase-graphql
- Port: 10000
- Health Check: Available at
/actuator/health
Common Commands¶
Start services¶
Stop services¶
View logs¶
# All services
docker-compose logs -f
# Specific service
docker-compose logs -f excalibase-app
docker-compose logs -f postgres
Restart a service¶
Connect to PostgreSQL¶
Reset everything (including data)¶
Sample GraphQL Queries¶
Once the application is running at http://localhost:10000, you can try these sample queries:
Get all users¶
Get posts with authors¶
Get comments with post and author details¶
Composite Key Operations¶
The sample database includes tables with composite keys. Try these queries:
Query order items with composite primary keys:
Create order item with composite key:
mutation {
createOrder_items(input: {
order_id: 3
product_id: 2
quantity: 5
price: 199.99
}) {
order_id
product_id
quantity
price
}
}
Update order item using composite key:
mutation {
updateOrder_items(input: {
order_id: 3 # Required: part of composite PK
product_id: 2 # Required: part of composite PK
quantity: 10 # Updated field
price: 299.99 # Updated field
}) {
order_id
product_id
quantity
price
}
}
Delete order item with composite key:
mutation {
deleteOrder_items(input: {
order_id: 3
product_id: 2
}) {
order_id
product_id
quantity
price
}
}
Filter by composite key:
query {
order_items(where: {
order_id: { eq: 1 }
product_id: { eq: 2 }
}) {
order_id
product_id
quantity
price
}
}
Troubleshooting¶
Application won't start¶
-
Check if the database is healthy:
-
View application logs:
Database connection issues¶
- Ensure the PostgreSQL service is running and healthy
- Check if the database initialization completed successfully:
Port conflicts¶
If you get port conflicts, you can modify the ports in docker-compose.yml
:
Next Steps¶
- Explore the GraphQL schema at http://localhost:10000/graphql
- Check out the API Documentation for more details
- See Contributing Guidelines if you want to contribute
Configuration¶
The application uses these default settings: - Database: PostgreSQL with hana schema - Application port: 10000 - Database port: 5432 - Default credentials: hana001/password123 - CDC enabled by default for real-time subscriptions
To customize these settings, edit the environment variables in docker-compose.yml
:
Key CDC Configuration Options:
- APP_CDC_ENABLED=true
- Enable/disable real-time subscriptions
- APP_CDC_CREATE_SLOT_IF_NOT_EXISTS=true
- Auto-create PostgreSQL replication slot
- APP_CDC_CREATE_PUBLICATION_IF_NOT_EXISTS=true
- Auto-create publication