GithubHelp home page GithubHelp logo

mr55p-dev / pagemail Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 11.59 MB

Home Page: https://pagemail.io

CSS 0.11% Makefile 0.43% HTML 0.26% Go 57.36% JavaScript 20.93% Ruby 0.81% Dockerfile 0.28% HCL 2.79% TypeScript 2.85% templ 14.18%
tools web website

pagemail's Introduction

Pagemail

Pagemail is a tool for saving and rembering links.

## Environment

  • PM_ENV: dev, stg or prd
  • PM_LVL: DEBUG, INFO or WARN
  • PM_TEST_USER: user id to store session for
  • PM_DB_PATH: path to sqlite3 file

pagemail's People

Contributors

mr55p-dev avatar ellis-lunnon avatar sourcery-ai-bot avatar

Stargazers

Irfanul Hoque avatar  avatar  avatar

Watchers

 avatar

Forkers

sourcery-ai-bot

pagemail's Issues

User has to refresh before page preview will be loaded

The user has to refresh after adding a link before their page preview is rendered.
This is generally poor UX. It would be easier to just do the preview rendering synchronously, or can
add a callback delay to refresh when (if) the preview is found

Create readability microservice

Separate service accessible on the pagemail network only
Can accept requests for following actions (stubbed):

  • Check readability of a page
  • Create readability job for a page (returns job id)
  • Check job status (by job id)

Dependency on SQLX

SQLX is being used to manage all queries, while it has some advantages, SQLC is more suitable for
this use case of simple but lots of queries. Also will allow a declarative table structure which
will make implementing e2e tests a little easier.

Migrate to postgres

We are now a little beyond the model that sqlite3 supports with a single db consumer - it's time to
consider how to migrate to postgres or something similar.

Create new fields in database

Pages:

  • readable: bool NOT NULL DEFAULT false
  • reading_status: string NOT NULL DEFAULT unknown
  • reading_job_id: string
    Users:
  • has_readability: BOOL NOT NULL DEFAULT false

Use a proper session manager

the current session manager implementation was fine for now, but in fact a session store backed by
a database of kind (or at least a file...) needs to be implemented

handrolling is still an option (just a sqlite file in a docker volume is entirely doable) but it
might be easier to admit defeat and switch to gorilla sessions

Mail is not coming out

Since merging hack and slash (#58) there has been no mail coming out via SES.
Need to investigate and fix

Create articles and readings tables

Update the existing schema to add new tables:

Articles

Stores the pages text content extracted via readability service

Readings

Stores info for an articles reading (status, file location, progress and errors)

UI can present article text for users (and request caching can allow for offline capability down the line)
Should surface option to refresh an articles content (make sure to disallow spamming, keep requests to once per hour)
Track the progress of audio playback

Readability

There's a lot of work done on readability already. Can some of this be reused?
Now that we are using docker compose it'll be possible to host readability service in a separate
container and built it as a part of this project still. This allows using typescript anyways.

403 when accessing shortcut url

Shortcut token does not seem to be recognised at the /pages/shortcut endpoint, probably because the wrong auth middleware is attached

There are actually zero tests

There are extremely few tests which makes debugging quite hard.
Need to identify some of the key API routes which are suitable for testing and implement tests
Can use net/http/httpmock for full end to end testing done locally.
Need a tool for mocking the DB

cross-region aws access and deployment

new gen ai voices are only available in us-east-1
need a terraform deployment in that region as well as polly access for the ec2 instance in that region.
The pagemail solution must be able to presign links for that region as well, so the session will have to be either cross region or have two

Bcrypt the pages token

shortcut tokens should be hashed not just passwords, as this is another piece of access-granting info

OAuth with google needs implementing

Need to figure out how to implement the sign in with google from the previous site into this one

  • Configured to fetch credential from sign in succesfully
  • Added a /login/google endpoint to handle the request
  • Creates a new user if one does not already exist
  • Written DB migration to add an auth table so users can map multiple auth methods to one account
  • Need to rewrite all the user queries which handle auth

try to figure out if the sqlc driver supports having multiple query files all contribute to
the same pakage.

Also, is it better to just have the db connection stored in (*Router).Conn and instantiate
dbqueries.New as and when it is needed?

Add Articles page

Articles page is the hub for readability articles:

  • Ready to read section: shows pages which already have a reading generated
  • Create reading section: requests a new reading for the given compatable pages

Create a playback page

Playback page for an article should start playing the audio of a reading which has already been generated

AWS resources are not provisioned

Resources in AWS are currently hand deployed. We can move them into terraform very easily as AWS
auth is already done in github actions. Consider looking at atlantis
for PR based deployments.

Create synthesize endpoint

Synth endpoint needs connection to AWS via node aws sdk to polly.
Job endpoint should be able to lookup job status, error message and S3 location.

Script to run db migrations on server

  • Create a backup
  • Upload migration files
  • Run dbmate for the relevant env

OR

  • Create an ad-hoc docker image
  • Include migrations and then mount the db.
  • Run dbmate
  • remove image
  • can do this all in a GitHub action workflow, and include one for migrating up/down

Fix function call for preprod environment

Firebase ID token has incorrect "aud" (audience) claim. Expected "pagemail-2bc26" but got "pagemail-preprod". Make sure the ID token comes from the same Firebase project as the service account used to authenticate this SDK. See https://firebase.google.com/docs/auth/admin/verify-id-tokens for details on how to retrieve an ID token.

Search

Users need to be able to search for their pages (duh) on the dashboard

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.