This is a Next.js project bootstrapped with create-next-app
.
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
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.
To ananlyze build size and open up browser window visualizing bundle build up.
ANALYZE=true yarn build
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
export const roomFetch = RPCHandlerFactory(meta, async (reqData) => {
return await dynamoTableTapes.getRoomBySlug(reqData.uid);
});
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,
});
import { dynamoTableTapes } from "@/api/collection-storage/backends/dynamodb";
await dynamoTableTapes.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