Quickstart
Get up and running with Dimebia in 5 minutes. This guide will help you set up your development environment, create your first transaction, and explore the API.
Prerequisites
- Java 17+ or Node.js 18+ (for local development)
- MySQL 8.0+ or PostgreSQL (database)
- Git (for cloning the repository)
Option 1: Docker (Recommended)
The fastest way to get started is using Docker:
# Clone the repository
git clone https://github.com/alaikis/dimebia.git
cd dimebia
# Start the services
docker-compose up -d
This starts:
- Dimebia API server on
http://localhost:8080 - MySQL database on
localhost:3306 - phpMyAdmin on
http://localhost:8081
Option 2: Manual Setup
1. Clone the Repository
git clone https://github.com/alaikis/dimebia.git
cd dimebia
2. Set Up the Database
CREATE DATABASE dimebia CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'dimebia'@'%' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON dimebia.* TO 'dimebia'@'%';
FLUSH PRIVILEGES;
3. Configure Environment
Create a .env file or set environment variables:
export DB_URL="jdbc:mysql://127.0.0.1:3306/dimebia"
export DB_USERNAME="dimebia"
export DB_PASSWORD="your_password"
export APP_JWT_SECRET="your-secret-key-at-least-32-characters-long"
export DEPLOYMENT_MODE="private"
4. Build and Run
# Build the project
./gradlew build -x test
# Run the application
java -DDB_URL="jdbc:mysql://127.0.0.1:3306/dimebia" \
-DDB_USERNAME="dimebia" \
-DDB_PASSWORD="your_password" \
-DAPP_JWT_SECRET="your-secret-key-at-least-32-characters-long" \
-jar boot/build/libs/boot-0.0.1-SNAPSHOT.jar
The API will be available at http://localhost:8080/api.
Your First API Request
1. Register a User
curl -X POST http://localhost:8080/api/user/register \
-H "Content-Type: application/json" \
-d '{
"userName": "demo",
"password": "password123",
"email": "demo@example.com"
}'
Response:
{
"code": 200,
"message": "Register success",
"data": {
"id": 1,
"userName": "demo",
"email": "demo@example.com",
"state": 1
}
}
2. Login
curl -X POST http://localhost:8080/api/user/login \
-H "Content-Type: application/json" \
-d '{
"account": "demo",
"password": "password123"
}'
Response:
{
"code": 200,
"message": "Login success",
"data": {
"token": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 86400,
"tokenType": "Bearer"
},
"userType": "PLATFORM_ADMIN",
"tenantId": null,
"deploymentMode": "private",
"userName": "demo",
"userId": 1
}
}
3. Create a Transaction
Replace <YOUR_TOKEN> with the access token from the login response:
curl -X POST http://localhost:8080/api/transaction/create \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_TOKEN>" \
-d '{
"amount": 100000,
"currency": "USD",
"channelId": 1,
"description": "Test transaction"
}'
Next Steps
- Payments Guide - Learn about transaction processing
- Billing Guide - Set up invoicing and subscriptions
- Developer Keys - Generate API keys for server-to-server integration
- API Reference - Explore the full API documentation
SDK Quickstart
Install the official SDK for your language:
# Node.js
npm install @dimebia/node
# Python
pip install dimebia
# PHP
composer require dimebia/dimebia
# Go
go get github.com/alaikis/dimebia-go
# Java
implementation 'com.dimebia:dimebia-java:2.0.0'
// Node.js example
import { Dimebia } from '@dimebia/node';
const client = new Dimebia({
apiKey: 'sk_live_...',
});
const payment = await client.transactions.create({
amount: 100000,
currency: 'USD',
});