Skip to content

Repository files navigation

Dal Banner

Dal

The official package registry for the Fidan programming language.

License   Build   Platform

Overview • Architecture • Getting Started • API Reference • Contributing


Overview

Dal is the package registry for the Fidan language — it lets developers publish, discover, and install Fidan packages. It follows a sparse-index protocol similar to crates.io and is built with a Rust backend, PostgreSQL, S3-compatible object storage such as Cloudflare R2 (package storage), AWS Cognito (auth), AWS SQS (background jobs), and a SvelteKit frontend.


Architecture

┌──────────────────────────────────────────────────┐
│  SvelteKit Frontend  (Cloudflare Pages)           │
└────────────────────┬─────────────────────────────┘
                     │ HTTP
┌────────────────────▼─────────────────────────────┐
│  dal-server  (Axum 0.8, 0.0.0.0:8080)            │
│  Routes: /auth  /packages  /users  /tokens        │
│          /search  /index/{name}  /health          │
└──┬──────────────────┬──────────────┬─────────────┘
   │ sqlx             │ Storage      │ SQS
   ▼                  ▼              ▼
PostgreSQL        dal-packages-  dal-jobs.fifo
                  prod (R2)      ──────────────
                                 dal-worker
                                 (email, etc.)

Crates

Crate Purpose
dal-common Shared error types, pagination, tracing init
dal-auth Cognito client, JWT validation, API token hashing
dal-db PostgreSQL queries, migrations, models
dal-manifest dal.toml parsing and validation
dal-storage S3-compatible package archive upload/download
dal-index Sparse NDJSON index served at /index/{name}
dal-server Axum HTTP API server (binary)
dal-worker SQS background job worker — sends emails (binary)

Getting Started

Prerequisites

  • Rust (stable, edition 2024)
  • Docker (for local Postgres)
  • Node.js 20+ (for frontend)
  • AWS account with Cognito and SQS configured, plus an S3-compatible object store such as Cloudflare R2 (or LocalStack for local dev)

1. Clone

git clone https://github.com/fidan-lang/dal.git
cd dal

2. Configure environment

cp .env.example .env
# Fill in AWS credentials, Cognito pool/client IDs, storage bucket, SQS URL
# For Cloudflare R2, use DAL_STORAGE_ACCESS_KEY_ID / DAL_STORAGE_SECRET_ACCESS_KEY
# instead of overriding the global AWS_* credentials used by task-role-backed AWS services.

3. Start Postgres

docker compose up postgres -d

4. Run the server

cargo run -p dal-server

5. Run the worker (optional for local dev)

cargo run -p dal-worker

6. Run the frontend

cd frontend
npm install
npm run dev

The frontend dev server starts at http://localhost:5173 and proxies API calls to http://localhost:8080.

7. Run the test stack

For the full backend integration suite, use the provided test scripts instead of bare cargo test so Postgres, LocalStack, and Cognito-local are started consistently.

./scripts/test.sh
./scripts/test.sh --with-cognito

On Windows:

scripts\test.bat
scripts\test.bat --with-cognito

8. Verify worker-delivered emails locally

For local worker testing without calling the real Mailjet API, use the helper scripts in LOCAL/:

LOCAL\start-mail-sink.ps1
LOCAL\start-dal-worker.ps1

The sink writes captured Mailjet-compatible requests to LOCAL/mail-sink.log.

9. Install Git hooks

To automatically run cargo fmt --all before each commit for staged Rust files:

./scripts/install-git-hooks.sh

On Windows:

scripts\install-git-hooks.ps1

API Reference

All endpoints are under the base URL configured in .env (DAL_BASE_URL).

Auth

Method Path Description
POST /auth/register Register a new account
POST /auth/login Log in, sets httpOnly cookies
POST /auth/logout Invalidate session
POST /auth/refresh Refresh access token
GET /auth/verify-email Verify email with token from link
POST /auth/forgot-password Request password reset email
POST /auth/reset-password Set new password with reset token
GET /auth/me Get current authenticated user

Packages

Method Path Description
GET /packages List all packages (paginated)
GET /packages/{name} Get package metadata
GET /packages/{name}/versions List versions
GET /packages/{name}/versions/{version} Get specific version
GET /packages/{name}/versions/{version}/download Download archive
POST /packages/{name}/publish Publish a new version
PUT /packages/{name}/versions/{version}/yank Yank a version
PUT /packages/{name}/versions/{version}/unyank Un-yank a version

Owners

Method Path Description
GET /packages/{name}/owners List package owners
POST /packages/{name}/owners/invite Invite a collaborator
DELETE /packages/{name}/owners/{username} Remove an owner
POST /packages/{name}/transfer Transfer ownership

Tokens

Method Path Description
GET /tokens List your API tokens
POST /tokens Create a new API token
DELETE /tokens/{id} Revoke a token

Search & Index

Method Path Description
GET /search?q=&page=&per_page= Full-text package search
GET /index/{name} Sparse index NDJSON for a package

Misc

Method Path Description
GET /health Liveness check
GET /readyz Readiness check (includes DB)

Contributing

See CONTRIBUTING.md for development setup, code style, and pull request guidelines.


License

Licensed under a modified version of the Apache License 2.0.

Copyright © 2026 Kaan Gönüldinc (AppSolves)

About

The official package registry for the Fidan programming language.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Contributors

Languages