Skip to content

sbetav/akina

Repository files navigation

Akina

Modern electronic invoicing platform for Colombia, built with Next.js, Elysia, Better Auth, and Drizzle ORM.

Powered by Factus, the electronic invoicing provider used by Akina for document issuance and validation workflows.

Akina Dashboard

Overview

Akina is a full-stack invoicing application focused on the Colombian market. It streamlines the creation and management of invoices, support documents, customers, providers, and products while integrating with Factus for electronic document workflows and DIAN-facing validation flows.

The project combines:

  • a polished Next.js App Router frontend,
  • a typed API layer powered by Elysia,
  • a PostgreSQL data layer with Drizzle ORM,
  • secure auth/session flows with Better Auth,
  • transactional email delivery through Resend.

Core Features

  • Invoice lifecycle management with creation, listing, details, and PDF download.
  • Support documents flow for purchases to non-obligated invoice issuers.
  • Credit notes and adjustment notes with dedicated forms and export flows.
  • Customer, provider, and product master data management.
  • Dashboard analytics (monthly revenue, invoice status, KPI summary, top customers).
  • Factus credential management per user plus shared sandbox fallback.
  • Authentication flows: register, login, email verification, password reset, and 2FA plugin support.
  • Server-side environment validation and encryption key handling for sensitive fields.

Tech Stack

Frontend

Backend and Data

Tooling

Project Structure

app/                 Next.js App Router pages and layouts
components/          Reusable UI + domain components
elysia/              API modules, services, and typed route layer
db/                  Drizzle schema and migrations
lib/                 Shared utilities (auth, env, crypto, Factus client)
hooks/               Reusable application hooks (API, state, and UI logic)
emails/              Transactional email templates (React Email)
public/              Static assets

Environment Variables

Copy .env.example to .env.local and fill in your values.

cp .env.example .env.local

The required variables are documented in .env.example:

  • NEXT_PUBLIC_BASE_URL
  • DATABASE_URL
  • BETTER_AUTH_SECRET
  • RESEND_API_KEY
  • RESEND_FROM
  • FACTUS_USERNAME
  • FACTUS_PASSWORD
  • FACTUS_CLIENT_ID
  • FACTUS_CLIENT_SECRET
  • ENCRYPTION_KEY (64-char hex string / 32 bytes)

Getting Started

1) Install dependencies

bun install

2) Configure environment

cp .env.example .env.local

3) Run the development server

bun dev

Open http://localhost:3000.

Available Scripts

  • bun dev - starts the development server.
  • bun build - builds the production app.
  • bun start - serves the production build.
  • bun lint - runs Biome checks.
  • bun lint:fix - runs Biome with auto-fix.
  • bun format - formats code with Prettier.
  • bun email - runs React Email preview server on port 3001.

API and Architecture Notes

  • Elysia app is mounted under /api and exposed through app/api/[[...slugs]]/route.ts.
  • Better Auth is configured server-side and integrated with Drizzle-backed persistence.
  • Factus has a shared sandbox fallback client when users do not have active credentials.
  • Sensitive provider/client credentials are encrypted before persistence and decrypted only for runtime use.

Build for Production

bun build
bun start

Contributing

If you want to contribute, please open an issue first to discuss major changes and implementation approach.

About

Electronic invoicing platform for Colombia, built with Next.js, Elysia, Better Auth, and Drizzle ORM.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages