This project is a random family tree generator, refactored from an old static page into a modern web tool using Cloudflare Workers.
-
Clone the repository:
git clone <repository_url> cd <repository_directory>
-
Install the dependencies:
npm install
This project uses a .env file to manage environment variables for deployment.
-
Create a
.envfile in the root of the project by copying the example file:cp .env.example .env
-
Open the
.envfile and add your Cloudflare credentials:# Cloudflare Credentials CLOUDFLARE_ACCOUNT_ID="your_account_id_here" CLOUDFLARE_API_TOKEN="your_api_token_here"You can find your Account ID in the Cloudflare dashboard. You can create an API token in your profile settings under "API Tokens".
Important: The
.envfile is included in.gitignoreand should not be committed to the repository.
To run the application locally, use the following command:
npm run devThis will start a local development server, and you can view the application in your browser at the address provided in the output (usually http://localhost:8787).
To run the unit tests, use the following command:
npm testTo deploy the application to your Cloudflare account, use the following command:
npm run deployThis command will first build the client-side bundle and then deploy the worker to Cloudflare, using the credentials from your .env file.