Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feat/templates from server#12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Seboran wants to merge5 commits intolyonjs:main
base:main
Choose a base branch
Loading
fromSeboran:feat/templates

Conversation

@Seboran
Copy link

@SeboranSeboran commentedOct 24, 2024
edited
Loading

what does this PR do?

live templates loading from appwrite

you can test here:https://code-in-the-dark-editor-git-feat-templates-seborans-projects.vercel.app/compete

How does it work?

Set an appwrite collection with every attributes implementingTemplateInformations interface:

interfaceTemplateInformations{eventName:string;referenceImage:string;instructions:string;injectCode?:string;showPreview:boolean;demoMode:boolean;}

CreatedfetchTemplates.ts which plugs to appwrite in server side.

Long pooling using SWR.

page previews are hosted in an appwrite bucket to keep them hidden.

I don't think we should move the other images and logos because we it makes relative URLs simpler

New env variables

You need to set 4 new environments variables:

APPWRITE_PROJECT_ID=""APPWRITE_DATABASE_ID=""APPWRITE_COLLECTION_ID=""APPWRITE_READ_TOKEN=""

Some ideas and questions

  • long pooling with SWR works fine, but I wonder if won't make huge requests spikes...
    Thinking about this point, at the very worst we would have 8 participants long pooling every 2 seconds during 5 minutes, which would amount to 1200 requests, don't think it would make a huge impact
  • I refactored page.tsx to make it server side only because it looked cool, but now we're long pooling I wonder if it's useful
  • it's a bit cumbersome to change an entry
  • I don't think setting a timestamp is a good idea. we should manually change timings because we never know when a competition will start for real or if everybody is ready.
  • sorry forpnpm-lock.yml changes 🙈

@vercel
Copy link

vercelbot commentedOct 24, 2024
edited
Loading

The latest updates on your projects. Learn more aboutVercel for Git ↗︎

NameStatusPreviewCommentsUpdated (UTC)
code-in-the-dark-editor✅ Ready (Inspect)Visit Preview💬Add feedbackOct 29, 2024 6:44pm

@SeboranSeboran changed the titleFeat/templatesFeat/templates from serverOct 26, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@Seboran

[8]ページ先頭

©2009-2025 Movatter.jp