Screen.Recording.2024-07-20.at.4.27.48.PM.mov
The open-source tool that provides access to premium Medium articles without the paywall
Learn more »
Introduction ·
Features ·
Tech Stack ·
Contributing
ReadiumX is an open source tool that provides access to premium Medium articles without the paywall, allowing you to bookmark, and manage your reading experience across any device
- Next.js – framework
- TypeScript – language
- Tailwind – CSS
- TursoDB – database
- Clerk – auth and auth emails
- DrizzleORM – ORM
- TipTap – editor
- Shadcn – component library
- Cloudflare Workers – deployments and article extraction cache
- Access Premium Articles: Bypass paywalls to access content freely.
- Bookmarking System: Save your favorite articles for later reading.
- Progress Tracking: Automatically saves your reading progress to resume where you left off.
- Reading History Management: View and manage your reading history with options to delete records.
-
Clone the repository
git clone https://github.com/JaleelB/readium-x.git
-
Install dependencies using pnpm
pnpm install
-
Copy the
.env.exampleto.env.localand update the variables.cp .env.example .env.local
-
Start the normal Next.js development server
pnpm run dev
This runs at
http://localhost:3156. In this mode, Cloudflare bindings are simulated through OpenNext's local dev bridge when available. If theREADIUMX_ARTICLE_CACHEbinding is not available, scraping still works; it simply skips the server-side KV cache and uses the existing client session cache. -
Push the database schema
pnpm run db:push
-
To test the app in the Cloudflare Workers runtime locally, copy
.dev.vars.exampleto.dev.vars, fill in the values, then run:cp .dev.vars.example .dev.vars pnpm preview
pnpm previewbuilds the OpenNext worker and starts Wrangler, usually athttp://localhost:8787. This is the mode to use when you specifically want to verify the Cloudflare KV cache behavior before deployment.
ReadiumX deploys to Cloudflare Workers through OpenNext.
-
Create separate remote KV namespaces for production and preview:
pnpm wrangler kv namespace create readiumx-article-cache pnpm wrangler kv namespace create readiumx-article-cache-preview
These commands create the real Cloudflare KV namespaces. They require
wrangler loginlocally orCLOUDFLARE_API_TOKENin CI. For day-to-daypnpm dev, you do not need to run them first; they are required before deploying or testing against real Cloudflare resources. -
Put the generated namespace IDs into
wrangler.jsoncfor theREADIUMX_ARTICLE_CACHEbinding. Keep the production namespace asidand the preview namespace aspreview_id. If Wrangler offers to add the binding for you, useREADIUMX_ARTICLE_CACHEas the binding name; the app does not read lowercase binding names. -
Add the application variables and secrets from
.dev.vars.exampleto Cloudflare Workers. -
Add these GitHub repository secrets for deployment:
CLOUDFLARE_ACCOUNT_IDCLOUDFLARE_API_TOKEN
-
Preview or deploy:
pnpm preview pnpm deploy
If you want google login, you'll need to setup a google project and create some keys:
- https://console.cloud.google.com/apis/credentials
- create a new project
- setup oauth consent screen
- create credentials - oauth client id
- for authorized javascript origins
- Authorized redirect URIs
- Set your google id and secret inside of .env
- GOOGLE_CLIENT_ID
- GOOGLE_CLIENT_SECRET
If you want github login, you'll need to setup a github project and create some keys:
- https://github.com/settings/developers
- Create a new OAuth App
- Create an application for the for local development:
- Homepage URL: http://localhost:3000
- Authorization callback URL: http://localhost:3000/api/login/github/callback
- Create an application for the for production:
- Homepage URL: https://your-domain.com
- Authorization callback URL: https://your-domain.com/api/login/github/callback
Contributions are welcome! Please open an issue if you have any questions or suggestions. Your contributions will be acknowledged. See the contributing guide for more information.
Licensed under the MIT License. Check the LICENSE file for details.