GithubHelp home page GithubHelp logo

haileyok / blug Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 0.0 1.55 MB

My little ATProtocol blog using Remix, Tailwind, and Redis

JavaScript 0.35% TypeScript 93.15% CSS 6.50%
atproto blog bluesky remix

blug's Introduction

Blug - An ATProtocol Blog

A simple little blog that pulls posts from your PDS, using the com.whtwnd.blog.entry lexicon. Uses Redis to keep them cached for a bit, in case you're popular and don't want to be constantly polling your PDS.

interface WhtwndBlogEntryRecord {
  $type: 'com.whtwnd.blog.entry'
  content?: string
  createdAt: string
  theme?: string
  title: string
  ogp?: {
    height: number | null
    url: string | null
    width: number | null
  }
}

interface WhtwndBlogEntryView {
  rkey: string
  cid: string
  title: string
  content?: string
  createdAt: string
  banner?: string
}

Configuration

Just a few things are needed in your .env file.

ATP_SERVICE=https://pds.haileyok.com/
ATP_IDENTIFIER=haileyok.com
ATP_DID=did:plc:oisofpd7lj26yvgiivf3lxsi
  • ATP_SERVICE is the URL of your PDS. It's probably hosted by Bluesky. Find it at internect.info.
  • ATP_IDENTIFIER is your handle. It's used to know which repo to get records from.
  • ATP_DID is...your DID. Again, find it at internect.info. Used to get your Bluesky profile (I use this just to get the already-hosted copy of your profile picture. You could rewrite this if you wanted to, would be faster too).

You also need to have Redis running. I didn't bother adding configuration for it, so if you want to change where it's hosted at check src/redis/redis.ts.

# macos
brew install redis
brew services start redis

# ubuntu
sudo apt-get install redis-server
sudo systemctl start redis

# centos
sudo yum install redis
sudo systemctl start redis

Development

Just run the vite server, you know, like usual?

yarn run dev

Deployment

Make sure you have dotenv-cli installed.

npm install -g dotenv-cli

Then build and serve.

yarn build
yarn start

Creating Posts

There's various ways you could do this. I just use a Markdown editor and then manually save them with createRecord. You can also use the editor at whtwnd's website to create them.

blug's People

Contributors

haileyok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.