Skip to content

Allows (grand) parents to remotely read books to their (grand) children. A rudimentary recording studio + a simple listening room for kids.

Notifications You must be signed in to change notification settings

jasperhartong/pod

Repository files navigation

This is a Next.js project bootstrapped with create-next-app.

Open Takeaways

Many side-projects come and go, some stick around slightly longer, but most of them never outgrow their initial best intentions.

Just making the code publicly available and calling that "Open Source" doesn't feel like adding much value for anyone. So, I'm trying something else:

"Open Takeaways" (OT): short articles containing ideas, code-fragments and demo's with the intention to guide others that tackle similar challenges.

Read the Open Takeaways of this project on tapes.me/open-takeaways

Getting Started

First, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.js. The page auto-updates as you edit the file.

Analyze Build size

To ananlyze build size and open up browser window visualizing bundle build up.

ANALYZE=true yarn build

RPC creation and usage

1. Define a Meta describing domain, action and shape of request & response

export const roomFetchMeta = RPCMeta(
  "room",
  "fetch",
  t.type({
    uid: t.string,
  }),
  TRoom
);

Note: put meta in separate file of below handler as it will be used both on the client and server

2. Create handler

export const roomFetch = RPCHandlerFactory(meta, async (reqData) => {
  return await dynamoTableTapes.getRoomBySlug(reqData.uid);
});

3. Call from server side or client side

Server side:

// export type IResponse<T> = IOK<T> | IERR;
// type IRoom = t.TypeOf<typeof TRoom>;
const room: IResponse<IRoom> = await roomFetch.call({
  uid,
});

Client side:

const room: IResponse<IRoom> = await RPCClientFactory(roomFetchMeta).call({
  uid,
});

DynamoDB Backups

Remote AWS Table backups

import { dynamoTableTapes } from "@/api/collection-storage/backends/dynamodb";
await dynamoTableTapes.backup();

Local backup

Creating a local backup of the DynamoDB table. Uses npm install -g dynamodump

AWS_ACCESS_KEY_ID=[KEY] AWS_SECRET_ACCESS_KEY=[KEY] dynamodump export-all-data --region=eu-central-1

About

Allows (grand) parents to remotely read books to their (grand) children. A rudimentary recording studio + a simple listening room for kids.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published