Skip to content

Commit

Permalink
docs: add accounting intro pages (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
openoms authored Jun 25, 2024
1 parent 66c746a commit 779fe91
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 31 deletions.
9 changes: 9 additions & 0 deletions website/docs/accounting/accounting-intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
id: accounting-intro
title: Accounting Intro
slug: /accounting/intro
---

# Introduction to Accounting in Cala

Welcome to the introduction to accounting with Cala! This guide is designed to help developers understand the essential accounting terms and concepts used in the Cala product. By the end of this section, you'll have a solid foundation to start building banking software with Cala.
20 changes: 20 additions & 0 deletions website/docs/accounting/double-entry-accounting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
id: double-entry-accounting
title: Double-Entry Accounting
slug: /accounting/double-entry-accounting
---

### What is Double-Entry Accounting?
Double-entry accounting is a bookkeeping system that requires every financial transaction to be recorded in at least two accounts: one account will be debited and another will be credited. This system ensures that the accounting equation (Assets = Liabilities + Equity) always remains balanced, providing a more accurate picture of a company's financial health.

### How It Works
For each transaction:
- **Debits** must equal **credits**.
- Each transaction affects at least two accounts to keep the equation balanced.
- For example, if a company takes out a loan, it will debit its cash account (an asset) and credit a loans payable account (a liability).

### Importance of Double-Entry Accounting
- **Accuracy**: Reduces errors by ensuring that debits and credits are always balanced.
- **Comprehensive Records**: Provides a complete record of financial transactions, making it easier to track financial performance.
- **Regulatory Compliance**: Meets the standards required by regulatory bodies and provides transparency.
- **Financial Health**: Helps in understanding the financial position of a business by providing detailed information on assets, liabilities, and equity.
31 changes: 31 additions & 0 deletions website/docs/accounting/glossary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
id: glossary
title: Glossary of Terms
slug: /accounting/glossary
---

## Account
An account is a record in the general ledger that tracks financial transactions. Accounts are categorized as assets, liabilities, equity, revenues, or expenses. In Cala, each account has a unique identifier (`accountId`).

## Journal
A journal is a chronological record of all financial transactions. Each journal entry includes the date, accounts affected, and the amounts debited or credited. In Cala, each journal has a unique identifier (`journalId`).

## Transaction
A transaction is a financial event that affects the accounts in the general ledger. Transactions are recorded in journals and typically involve debits and credits to different accounts.

## Debit and Credit
These are the two sides of every financial transaction:
- **Debit**: An entry on the left side of an account ledger that increases asset or expense accounts and decreases liability, equity, or revenue accounts.
- **Credit**: An entry on the right side of an account ledger that increases liability, equity, or revenue accounts and decreases asset or expense accounts.

## Balance
The balance of an account is the difference between the total debits and total credits recorded in that account. It indicates the current amount available or owed.

## Currency
Currency represents the type of money being used in transactions, such as USD (United States Dollar).

## Transaction Template
A transaction template is a predefined structure for a specific type of transaction, such as deposits or withdrawals. It ensures consistency and accuracy in recurring transactions by specifying the required parameters and transaction details.

## UUID (Universally Unique Identifier)
A UUID is a 128-bit number used to uniquely identify information in computer systems. In Cala, it is used to uniquely identify accounts, journals, and transactions.
15 changes: 15 additions & 0 deletions website/docs/accounting/step-by-step.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
id: step-by-step
title: Accounting with Cala Step-by-Step
slug: /docs/step-by-step
---

1. [**Create Journals and Accounts**](/docs/create-journal-and-accounts): Start by setting up journals and accounts. Journals will hold the records of all transactions, and accounts will be used to categorize these transactions.

2. [**Define Transaction Templates**](/docs/tx-template-create): Create templates for common transactions like deposits and withdrawals. This ensures that each transaction follows a consistent structure.

3. [**Post Transactions**](/docs/post-transaction): Use the transaction templates to post transactions. This involves specifying the necessary parameters and ensuring that the correct accounts are debited or credited.

4. [**Check Account Balances**](/docs/check-account-balance): Regularly query the balances of accounts to monitor the financial status. This helps in maintaining accurate and up-to-date financial records.

By following these steps and understanding the glossary of terms, you'll be well-equipped to use Cala to build robust banking software. This structured approach ensures that your financial transactions are accurate, consistent, and compliant with accounting standards.
6 changes: 3 additions & 3 deletions website/docs/demo/check-account-balance.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: check-account-balance
title: Check account balance
slug: /docs/demo/check-account-balance
title: Check Account Balance
slug: /docs/check-account-balance
---

The functionality is essential for users (e.g., account holders, financial managers) to view the balance of a specific account in a particular journal and currency. This allows for real-time financial monitoring and decision-making based on up-to-date account information.
Expand All @@ -22,7 +22,7 @@ The functionality is essential for users (e.g., account holders, financial manag
}
```

### GraphQL body
### GraphQL Request Body

The `accountWithBalance` query is executed with the provided inputs. The query fetches the account's name and its settled balance in the specified journal and currency.

Expand Down
14 changes: 7 additions & 7 deletions website/docs/demo/create-journal-and-accounts.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
id: create-journal-and-accounts
title: Create a journal and accounts
slug: /demo/create-journal-and-accounts
title: Create a Journal and Accounts
slug: /docs/create-journal-and-accounts
---

Create different types of accounts (journal, checking, and debit accounts) through the GraphQL API.

## Create a journal
## Create a Journal

Initiate the creation of a journal, specifically a "General Ledger," which is fundamental in accounting for keeping track of all the financial transactions of a company.

Expand All @@ -23,7 +23,7 @@ The GraphQL mutation request input contains the unique ID and the name of the jo
}
```

### GraphQL body
### GraphQL Request Body

```graphql
mutation journalCreate($input: JournalCreateInput!) {
Expand Down Expand Up @@ -53,7 +53,7 @@ The system returns the details of the newly created journal, including its ID an
}
```

## Create a checking account
## Create a Checking Account

Next create a checking account named `Alice - Checking`. Checking accounts are typically used for day-to-day banking transactions.

Expand Down Expand Up @@ -103,7 +103,7 @@ The response confirms the creation of the checking account with the specified de
}
```

## Create a debit account
## Create a Debit Account

Create a debit account labeled `Assets`. Debit accounts are crucial for tracking resources owned by a business.

Expand All @@ -122,7 +122,7 @@ Similar to the previous account creation, the mutation includes unique identifie
}
```

### GraphQL body
### GraphQL Request Body

```graphql
mutation accountCreate($input: AccountCreateInput!) {
Expand Down
6 changes: 3 additions & 3 deletions website/docs/demo/post-transaction.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: post-transaction
title: Post a transaction
slug: /docs/demo/post-transaction
title: Post a Transaction
slug: /docs//post-transaction
---

This functionality allows to execute financial transactions based on predefined parameters and templates. The specific transaction being posted here is based on a deposit template, which facilitates adding funds to a user's account.
Expand All @@ -28,7 +28,7 @@ This functionality allows to execute financial transactions based on predefined
}
```

### GraphQL body
### GraphQL Request Body

The `postTransaction` mutation is called with the inputs below. This mutation processes the transaction based on the provided template and parameters.

Expand Down
6 changes: 3 additions & 3 deletions website/docs/demo/tx-template-create.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: tx-template-create
title: Create transaction templates
slug: /docs/demo/tx-template-create
title: Create Transaction Templates
slug: /docs/tx-template-create
---

This functionality allows a user (an administrator or financial manager) to define templates for recurring transaction types - specifically deposits and withdrawals. By defining these templates, the user ensures consistency, accuracy, and efficiency in transaction processing.
Expand All @@ -25,7 +25,7 @@ This functionality allows a user (an administrator or financial manager) to defi

- **Transaction and Entries Definition**: This template defines how funds will be withdrawn, including debiting the customer's account and crediting an asset account, with specifics on the transaction type and conditions.

### GraphQL body
### GraphQL Request Body

```graphql
mutation CreateDepositAndWithdrawalTxTemplates(
Expand Down
8 changes: 4 additions & 4 deletions website/docs/intro.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: intro
title: Try Cala
slug: /
slug: /docs
---

## Install Docker and Docker Compose
Expand All @@ -12,15 +12,15 @@ slug: /
wget https://raw.githubusercontent.com/GaloyMoney/cala/main/docker-compose.yml
```

## Run the Cala server with a PostgresQL instance
## Run the Cala Server with a PostgresQL Instance
```bash
docker-compose up -d cala-server
```

## GraphQL demo
## GraphQL Demo
* open the local GraphQL playground: <br />
http://localhost:2252/graphql
* continue with the [GraphQL API demo](/docs/demo/create-journal-and-accounts)
* continue with the [GraphQL API demo](/docs/create-journal-and-accounts)

## Cleanup
* run in the directory where the docker-compose.yml file is
Expand Down
30 changes: 23 additions & 7 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ const config: Config = {
{
docs: {
sidebarPath: './sidebars.ts',
routeBasePath: '/docs', // This changes the base path from /docs
editUrl: ({versionDocsDirPath, docPath}) => {
return `https://github.com/GaloyMoney/cala/edit/main//website/${versionDocsDirPath}/${docPath}`;
},
showLastUpdateAuthor: false,
showLastUpdateTime: false,
routeBasePath: '/', // This changes the base path from /docs
//editUrl: ({versionDocsDirPath, docPath}) => {
// return `https://github.com/GaloyMoney/cala/edit/main//website/${versionDocsDirPath}/${docPath}`;
//},
//showLastUpdateAuthor: false,
//showLastUpdateTime: false,
},
theme: {
customCss: './src/css/custom.css',
Expand All @@ -62,6 +62,22 @@ const config: Config = {
position: 'left',
label: 'Docs',
},
{
type: 'docSidebar',
sidebarId: 'accountingSidebar',
position: 'left',
label: 'Accounting Intro',
},
{
href: 'https://cala.sh/api-reference.html',
label: 'API Reference',
position: 'left',
},
{
href: 'https://docs.rs/cala-ledger/latest/cala_ledger/',
label: 'Rust crate docs',
position: 'left',
},
{
href: 'https://github.com/GaloyMoney/cala',
label: 'GitHub',
Expand All @@ -81,7 +97,7 @@ const config: Config = {
},
{
label: 'GraphQL API demo',
to: '/docs/demo/create-journal-and-accounts',
to: '/docs/create-journal-and-accounts',
},
],
},
Expand Down
6 changes: 6 additions & 0 deletions website/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ const sidebars: SidebarsConfig = {
href: 'https://docs.rs/cala-ledger/latest/cala_ledger/',
},
],
accountingSidebar: [
'accounting/accounting-intro',
'accounting/glossary',
'accounting/double-entry-accounting',
'accounting/step-by-step',
],
};

export default sidebars;
8 changes: 4 additions & 4 deletions website/src/components/HomepageFeatures/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ const FeatureList: FeatureItem[] = [
link: "https://cala.sh/api-reference.html",
},
{
title: "Double Sided Accounting",
image: require("@site/static/img/double-sided-accounting-logo.png").default,
title: "Double-Entry Accounting",
image: require("@site/static/img/double-entry-accounting-logo.png").default,
description: (
<>
Every transaction is recorded accurately on both sides of the ledger
providing a complete and transparent view of your financial operations.
</>
),
link: "https://cala.sh/docs/demo/create-journal-and-accounts",
link: "/accounting/double-entry-accounting",
},
{
title: "Transaction Templates",
Expand All @@ -43,7 +43,7 @@ const FeatureList: FeatureItem[] = [
financial workflows.
</>
),
link: "https://cala.sh/docs/docs/demo/tx-template-create",
link: "/docs/tx-template-create",
},
{
title: "Embeddable",
Expand Down

0 comments on commit 779fe91

Please sign in to comment.