Skip to content

The Decentralised Creative Network Server is a high-performance C++ backend that exposes a simple HTML interface and a secure REST API for managing Performative Transactions entities

Notifications You must be signed in to change notification settings

hypermusic-ai/dcn-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

93 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Decentralised Art server

πŸ“š Documentation


Docs

View Doxygen API Docs



πŸ“¦ Dependencies

This project requires the following libraries:

Installed on the machine

Fetched automatically

Testing



βš™οΈ Configuring the Project

To configure the project using CMake, run the following command:

cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install -DDECENTRALIZED_ART_BUILD_TESTS=ON
  • -S .: Specifies the source directory.
  • -B build: Specifies the build directory.
  • -DCMAKE_INSTALL_PREFIX=install: Specifies install directory.
  • -DDECENTRALIZED_ART_BUILD_TESTS=ON: Enables tests.


πŸ› οΈ Building the Project (Debug Mode)

To build the project in Debug Mode, use:

cmake --build build --config Debug

This will compile the project with debugging enabled.

πŸ› οΈ Installing the Project (Debug Mode)

To install project in Debug Mode, use:

cmake --build build --config Debug --target install

This will install the project with debugging enabled.



πŸ–₯️ Start the server

./build/Debug/DecentralisedArtServer.exe


πŸ“š API Documentation

This section describes the available API endpoints for the server backend.

⚠️ All protected routes require authentication via a secure access_token cookie. After login, this cookie is automatically included in requests by the browser.


πŸ“„ Interface

OPTIONS /

Returns CORS headers for the simple HTML interface endpoint.

  • Authentication: ❌ Public

GET /

Returns the simple HTML interface to interact with the server.

  • Response Type: text/html
  • Authentication: ❌ Public

πŸ” Authentication

GET /nonce/<address>

Returns a nonce for the specified Ethereum address to use in the login message.

  • Params:
    • address: Ethereum address (e.g., 0x123...)
  • Response:
{ "nonce": "string" }
  • Authentication: ❌ Public

POST /auth

Verifies the signed nonce and sets an authentication cookie (access_token).

  • Request Body(JSON):
{
  "address": "0x...",
  "message": "Login nonce: ...",
  "signature": "0x..."
}
  • Response: 200 OK : Authentication successful

  • Authentication:

    • Header: Set-Cookie: access_token=...; HttpOnly; Secure; SameSite=Strict; Path=/
    • Header: Set-Cookie: refresh_token=...; HttpOnly; Secure; SameSite=Strict; Path=/refresh"
  • Authentication: ❌ Public

POST /refresh

Verifies refresh_token and access_token and generates new access_token.

  • Response: 200 OK : Authentication successful

  • Authentication:

    • Header: Set-Cookie: access_token=...; HttpOnly; Secure; SameSite=Strict; Path=/
    • Header: Set-Cookie: refresh_token=...; HttpOnly; Secure; SameSite=Strict; Path=/refresh"
  • Authentication: βœ… Required


🧩 Features

OPTIONS /feature

Returns CORS headers for the feature endpoints.

GET /feature/<name>/<ver?>

Fetches a feature object by name and version. If version is not given, returns newest feature of given name.

  • Params:

    • name: String identifier
    • ver?: Optional String identifier
  • Response: Feature data (JSON)

    {
      "name": "...",
      "dimensions": [...]
    }
  • Authentication: ❌ Public

POST /feature

Creates a new feature entry.

  • Request Headers: Cookie must include access_token

  • Request Body: JSON payload describing the feature

    {
      "name": "...",
      "dimensions": [...]
    }
  • Response: 201 Created or error

  • Response Body :

    {
      "name": "...",
      "version": "1823..."
    }
  • Authentication: βœ… Required


πŸ”„ Transformation

OPTIONS /transformation

Returns CORS headers for the transformation endpoints.

GET /transformation/<name>/<ver?>

Fetches a transformation by name and version. If version is not given, returns newest transformation of given name.

  • Params:

    • name: String identifier
    • ver: Optional String identifier
  • Response: Transformation data (JSON)

    {
      "name": "...",
      "sol_src": "..."
    }
  • Authentication: ❌ Public

POST /transformation

Creates a new transformation record.

  • Request Headers: Cookie must include access_token

  • Request Body: JSON payload describing the transformation

    {
      "name": "...",
      "sol_src": "..."
    }
  • Response: 201 Created or error

  • Response Body:

    {
      "name": "...",
      "version": "1823..."
    }
  • Authentication: βœ… Required


πŸ“œ License:

πŸ‘¨β€πŸ’» Contributors: Sawyer

πŸ’‘ Additional Notes:

About

The Decentralised Creative Network Server is a high-performance C++ backend that exposes a simple HTML interface and a secure REST API for managing Performative Transactions entities

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published