/alexandrias-revenge

🔥The bold new archive that can’t be burned, bulldozed or battering-rammed #PoweredByArweave

Primary LanguageTypeScriptMIT LicenseMIT

Alexandria's Revenge Logo

Permanent Storage for Curated Knowledge

https://alexandriasrevenge.herokuapp.com/

🇪🇬 Inspiration

The Great Library of Alexandria in Alexandria, Egypt, was one of the largest and most significant libraries of the ancient world. Over time, however, it dilapidated into nothing but ash and rubble.
The Internet is the Library of Alexandria of our era, yet we take for granted just how vulnerable it is. Even with solar flares, natural disasters, and DDoS attacks aside, valuable knowledge is removed from the internet every day. Servers don't run for free, after all. Archive.org does a lot of great work in this space, but it is dangerous for our civilization to be so dependent on a centralized source. Arweave poises an opportunity to decentralize, and thereby secure the greatest library of our time. The purpose of this project is to capture that opportunity.

🏊‍♀️ Product Deepdive

  • Documents
    • Extractor: Scans for useful text and article metadata
    • Processor: Intelligently discovers useful metrics which users will be able to search and filter with in the future
      • AFINN Sentiment Score: Generated by the industry-standard sentiment scoring algorithm (displayed in human-readable format)
      • Reading Time: Inspired by Medium's estimated read time feature, the article estimates the read time for a user reading 200 words per minute. This is useful when deciding if you have enough time to read an article.
  • Images
    • Embedding: Archive Images are downloaded and injected directly into HTML archive documents as base64 data URI's.
    • Permaweb: Article processor extracts the most important image, uploads it to the Permaweb, and saves the Permalink to the tag data
  • SEO
    • Archive Metadata
      • OpenGraph
      • JSON-LD

🚀 Usage & Deployment

🖼 Client

If you only want to build an archive front-end, don't worry about setting up up a server. Simply send queries to https://alexandriasrevenge.herokuapp.com/graphql and you're good to go.
The production GraphQL Playground & Documentation (at /graphql) makes it a piece of cake! 🎂🍰

⚙️ Server

Requirements

  • A non-empty Arweave wallet
  • Node.js >=v10.1.0
  • NPM or Yarn
  • Git

Looking to spin up the backend? That's a piece of cake too.

Deploy

⬇️ Clone the repository

git clone https://github.com/mccallofthewild/alexandrias-revenge.git

⬇️ Install the node_modules

yarn

or

npm i

💰 Configure Wallet

  1. Move an Arweave JWK wallet into the root directory of the project.
  2. Name it wallet.json.
  3. Create a file named env.json. Fill it with:
{
	"WALLET_FILE_SECRET": "yourcomplexandcryptographicallysecurepassword"
}

WALLET_FILE_SECRET is used to encrypt your wallet when you deploy it to the server and push it to your git repository. Ensure that it is long, complex, random and secure. Both wallet.json and env.json are in .gitignore, and thereby will not be made public in git.

From the command line, run:

yarn dev

This simultaneously starts the development server and updates the encrypted wallet (wallet.json.enc) to be your Arweave wallet encrypted with your password.

🏨 Host

Publish to Heroku, or your host of choice. Set the following environment variables accordingly:

Name Value
NODE_ENV production
WALLET_FILE_SECRET yourcomplexandcryptographicallysecurepassword