Skip to content

Repository files navigation

Donate Latest Release Build Status License: GPL v3

Universal Name Generator API

Universal Name Generator API provides an ASP.NET Core REST API for generating random names from configurable generation schemas and reusable word lists.

📑 Table of Contents

✨ Capabilities

  • Generate names by generation schema identifier
  • Use random selector and Markov chain generation strategies

🚀 Usage

curl -G "http://localhost:5000/Names" \
  --data-urlencode "schema=arabic-toponyms" \
  --data-urlencode "count=5" \
  --data-urlencode "apiKey=YOUR_API_KEY"

🖥️ System Requirements

  • OS: Linux, macOS, Windows
  • RAM: 256 MB minimum
  • .NET 10.0 runtime

📦 Installation

Obtain it from GitHub

⚙️ Configuration

All settings are loaded from the configuration file. The subsequent keys are recognised:

Section Key Description
dataStoreSettings wordListsRootDirectory Path to the directory containing word list .lst files.
dataStoreSettings generationSchemasPath Path to the GenerationSchemas.xml file.
securitySettings apiKey API key required for authorisation.
nuciLoggerSettings logFilePath File path for persisted log output.
nuciLoggerSettings isFileOutputEnabled Enables or disables file log output.

🛠️ Development

Requirements

Setup

All NuGet dependencies are restored automatically by dotnet restore.

Build

dotnet build UniversalNameGenerator.API/UniversalNameGenerator.API.csproj

Run

dotnet run --project UniversalNameGenerator.API/UniversalNameGenerator.API.csproj

Test

dotnet test UniversalNameGenerator.API.slnx

Release

The repository includes release.sh, which delegates to the upstream deployment script used by the project maintainer.

bash ./release.sh 1.0.0

This script downloads and executes an external release helper from https://raw.githubusercontent.com/hmlendea/deployment-scripts/master/release/dotnet/10.0.sh.

Note: Piping into bash is an intensely controversial topic. Please review any external scripts before running them in your environment!

Dependencies

Package Purpose
NuciAPI Core API abstractions and response models.
NuciAPI.Controllers Controller utilities for request handling.
NuciAPI.Middleware Base middleware infrastructure.
NuciAPI.Middleware.ExceptionHandling Structured exception handling middleware.
NuciAPI.Middleware.Logging Request and operation logging middleware.
NuciAPI.Middleware.Security API security middleware integration.
NuciDAL Data access abstractions for repository patterns.
NuciExtensions Shared helper extensions used across the service.
NuciGenerators.Text Text generation primitives.
NuciGenerators.Text.MarkovChain Markov chain generator implementation.
NuciLog Logging providers.
NuciLog.Core Logging core contracts.
NuciSecurity.HMAC HMAC generation and verification support.

🗂️ Project Structure

The solution contains the subsequent projects:

  • UniversalNameGenerator.API: ASP.NET Core Web API application.
  • UniversalNameGenerator.API.UnitTests: Unit test project for API and service components.

The key directories inside UniversalNameGenerator.API/ are:

Directory Purpose
Configuration/ Application configuration models and settings contracts.
Controllers/ HTTP endpoints for name generation requests.
DataAccess/ Data objects and repository implementations for word sources and schemas.
Logging/ Logging operation and key definitions.
Models/ Request and response API models.
Service/ Name generation service logic, models, and strategy implementations.

🤝 Contributing

You are welcome to submit any suggestion, feedback, or modification to this project.

When doing so, please:

  • Maintain cross-platform compatibility
  • Maintain the existing public contract intact unless a breaking change is intentional
  • Maintain the pull requests as focused and consistent with the existing code style
  • Maintain your branch up-to-date with master
  • Revise the documentation when behaviour changes
  • Properly test all changes, including edge cases and error conditions
  • Add unit tests for any new or changed functionality

🔗 Related Projects

💝 Supporting the Project

Discovered a problem or have a suggestion? Open an issue!

If you find this project useful, consider funding it or starring ⭐️ it on GitHub!

Donate

📄 License

This project is being distributed under the GNU General Public License v3.0 or later. See LICENSE for further information.

About

ASP.NET Core REST API for generating random names based on configurable generation schemas backed by wordlists

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages