Simple ATProto Handles allows you to use your domain as a handle on Bluesky, such as @name.example.com
, leveraging Cloudflare’s free tier. This is especially useful for communities and individuals who want a personalized, branded Bluesky handle.
- Easy Setup: Quick to configure
- User-Friendly: Simple to use and deploy on your own domain
This project uses:
Before starting 🏁, ensure you have Git and Node.js installed, as well as a domain for which you can manage DNS settings.
First, sign up for a Cloudflare account if you don’t have one. Create a D1 database and take note of the database name and Database ID
shown.
Add your domain to Cloudflare:
- Go to Websites in your Cloudflare dashboard.
- Enter your domain, then follow the prompts to change your domain's nameservers to Cloudflare’s.
With Cloudflare configured, we can start setting up the project.
# Clone this repository
$ git clone https://github.com/fursudo/simple-atptoto-handles
# Enter project directory
$ cd simple-atptoto-handles
# Install dependencies
$ npm install
Next, rename .dev.vars.example
to .dev.vars
and fill in the values, including Bluesky account credentials (email
and password
).
Update the wrangler.toml
file with your Cloudflare database details:
name = "simple-atptoto-handles" # Edit as desired
[[d1_databases]]
binding = "DB"
database_name = "your-database-name" # Replace with your database name
database_id = "your-database-id" # Replace with your database ID
Cloudflare D1 databases exist in two states: local
and remote
. Start by applying migrations locally:
$ npx wrangler d1 migrations apply your-database-name --local
# Follow prompts to deploy 0001_db_init.sql
If everything is successful, start the project:
$ npm run dev
# Now let's make our changes to the remote database
$ npx wrangler d1 migrations apply your-database-name --remote
To version your project, you can push it to a GitHub repository. Run:
$ git add .
$ git commit -m "Initial commit"
$ git push
Avoid committing .dev.vars
to keep sensitive information secure.
-
Connect your GitHub repository to Cloudflare Pages from the Cloudflare dashboard.
-
Authenticate, then select your repository to build and deploy. Be Sure to Select the
Qwik
Framework Preset.
In the Settings of your Cloudflare Page, add the Environment Variables and Secrets from your .dev.vars
file. Bind the D1 database to DB
, referencing your previously created database.
For custom domain support, navigate to Custom Domains in Cloudflare and add your domain (e.g., example.com
).
For DNS settings:
For URL forwarding:
-
In Page Rules, set up a rule for
*.example.com/*
with aForwarding URL
(301 redirect) pointing tohttps://example.com/$1/$2
.
Your handle setup is now complete!
This project is licensed under GNU General Public License v3.0. For more details, see the LICENSE file.
Built with ❤️ & sleep deprivation by furSUDO