Skip to content

About

Generate authentic Sri Lankan names using AI. Filter by gender and IQ, explore meanings in multiple languages, and integrate via public API. Includes interactive web app with light/dark mode.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

AI-Powered Sri Lankan Name Generator

This project features both an interactive web application and a public API for generating authentic Sri Lankan names. The backend model is trained on a massive dataset of over 10 million names, blending cultural heritage with artificial intelligence.

1

Interactive Web Application

The web application provides a user-friendly interface to:

  • Generate Names: Filter names by gender and a desired IQ level (0-100).
  • Explore Meanings: Click on any generated name to get a detailed, AI-powered explanation of its meaning and origin.
  • Multi-Language Support: View name explanations in multiple languages, including English, Sinhala, Tamil, and more.

2

  • Light & Dark Mode: A sleek, modern interface with theme support for comfortable viewing.

3

Getting Started

Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • A modern web browser.
  • A Google Gemini API key to use the name-meaning feature. You can generate a free key from Google AI Studio.
  • Python 3 or Node.js installed on your machine to run a local server.

Installation & Running the Project

  1. Clone the Repository: Open your terminal and run the following command to clone the project:

    git clone https://github.com/ishanoshada/Ai-Sri-Lanka-Name-Generator.git
    cd Ai-Sri-Lanka-Name-Generator
  2. Set Up Your API Key: The application needs your Gemini API key to function. The App.tsx file is configured to read this key from process.env.API_KEY. For local development, you must replace process.env.API_KEY in App.tsx with your actual key string.

    Important: This method is for local testing only. Do not commit your API key to a public repository. In environments like Google AI Studio, you should use the provided secrets manager to set the API_KEY.


API Documentation

This section provides a concise overview of the API usage, detailing the endpoints, their purposes, request methods, parameters, and responses.

4

API Endpoints

The application exposes four endpoints, all accessible via https://names.ishanoshada.com/. Each endpoint supports CORS, allowing cross-origin requests with methods GET, POST, PUT, DELETE, PATCH, OPTIONS and headers Content-Type, Authorization, X-Requested-With.

1. /names

  • Method: GET
  • Purpose: Retrieve a random list of names filtered by gender and optional minimum IQ.
  • Query Parameters:
    • gender (required, string): Specifies the gender of names to return. Must be "male" or "female". Case-insensitive.
    • num (optional, integer): Number of names to return (1–1000). Defaults to 10 if not provided.
    • iq (optional, integer): Minimum IQ threshold (0–100). Filters names to include only those with IQ greater than or equal to the specified value.
  • Response:
    • Success (200): JSON array of objects with Name (string) and IQ (integer).
      [
        {"Name": "John Doe", "IQ": 85},
        {"Name": "Saman Perera", "IQ": 92}
      ]
    • Error (400):
      • {"error": "Gender must be 'male' or 'female'"}
      • {"error": "Number of names must be between 1 and 1000"}
      • {"error": "IQ must be between 0 and 100 if provided"}
      • {"error": "Not enough [gender] names available (found X, requested Y)"}
    • Error (500): {"error": "Internal server error"}
  • Example Request:
    curl "https://names.ishanoshada.com/names?gender=male&num=5&iq=80"
  • Example Response:
    [
      {"Name": "Kavinda Silva", "IQ": 82},
      {"Name": "Mohamed Fazil", "IQ": 90},
      {"Name": "Sujeewa Bandara", "IQ": 85},
      {"Name": "Nuwan Perera", "IQ": 88},
      {"Name": "Chamod Fernando", "IQ": 95}
    ]

2. /gender-percentage

  • Method: GET
  • Purpose: Return the percentage distribution of genders (male, female, unknown).
  • Response:
    • Success (200):
      {
        "male_percentage": 45.5,
        "female_percentage": 50.0,
        "unknown_percentage": 4.5
      }
    • Error (400): {"error": "No data available"}

3. /male-iq-ranges

  • Method: GET
  • Purpose: Return the count of male students in predefined IQ ranges.
  • Response:
    • Success (200):
      [
        {"range": "0-20", "count": 10},
        {"range": "20-35", "count": 15},
        {"range": "35-50", "count": 20},
        {"range": "50-75", "count": 30},
        {"range": "75-100", "count": 25}
      ]

4. /female-iq-ranges

  • Method: GET
  • Purpose: Return the count of female students in predefined IQ ranges.
  • Response:
    • Success (200):
      [
        {"range": "0-20", "count": 8},
        {"range": "20-35", "count": 12},
        {"range": "35-50", "count": 15},
        {"range": "50-75", "count": 28},
        {"range": "75-100", "count": 37}
      ]

About

Generate authentic Sri Lankan names using AI. Filter by gender and IQ, explore meanings in multiple languages, and integrate via public API. Includes interactive web app with light/dark mode.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Contributors

Languages