Skip to content

Instantly share code, notes, and snippets.

@joshnuss
Last active January 13, 2023 19:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshnuss/51f36f34b723378184718513b3f3a40a to your computer and use it in GitHub Desktop.
Save joshnuss/51f36f34b723378184718513b3f3a40a to your computer and use it in GitHub Desktop.
Build progress for 24-hour startup

The idea

A way to create physical signage for a business by uploading the company's logo. The app will use a 3rd party to 3D print or laser cut the sign.

Main flow

  1. Upload a logo in SVG format
  2. Choose fabrication style (3d print, laser cut) and colors
  3. Place the order
  4. Job is sent to printer via API

Hour #1

  • Reviewed TODO list
  • Planning to resolve unknowns first with experiments, then will combine solutions and work on UI last.
  • Set up SvelteKit project
  • Created mockups in Balsamiq
  • Testing svelte-file-dropzone to handle uploading files

Hour #2

  • Figured out the drag-and-drop file upload. It uploads file and redirects to "designer" page.
  • Figured out the OAuth flow with using Auth.js (using this guide). Routes are protected based on paths in src/hooks.server.js

Hour #3

  • Took a quick break to eat something
  • Researched if vercel/og would work with Three.js/Threlte. I want user to be able to share previews on Twitter/Facebook etc. But it seems it would not work because Satori is a server-side thing and three.js is rendering client-side. So I will have to use pupeteer to render instead. Will leave it for later.
  • Figured out how to integrate Prisma with Auth.js
  • Getting closer to having all the unknowns figured out

Hour #4

  • Figured out how to extend Prisma user with additional models based on user and set them in event.locals so they can be used in the route's load() function.
  • Created sitemap
  • Started integrating solutions into main repo

Hour #5

  • Continue to integrate solutions into main repo
    • Setup Auth.js
    • Setup Prisma
    • Added logo model
  • Figured how to redirect after sign in
  • Build data fetching to /logos and /logos/:id
  • Added logic to convert svg to data url (safer to use <img> over {@html ...})

Hour #6

  • Added drag'n'drop uploading of SVG using svelte-file-dropzone
  • Added svgo to optimize SVG file
  • Added resvg to get dimensions of SVG file
  • Added Threlte to project
  • Added logic to insert logo into DB
  • Refactored logo query & create to a service

Hour #7

  • Took 30 minute break
  • Debugging issues with SVGLoader. Turned out SVG was just offscreen

Hour #8

  • Figured out how to rotate the SVG (it was upside down because in SVG-land y increases as you move downward)

Hour #9

  • Added config rules for fabrication methods (3d-printing, laser-cutting and LED)
  • Added logic to update logo (name, fabrication, color etc...)

Hour #10

  • Added ability to change color and fabrication method.
  • Next, I'll work on adding ordering and payment

Hour #11

Dinner break

Hour #12

Dinner break

Hour #13

  • Added stripe-svelte and support for ApplePay, GooglePay and Link

Hour #14

  • Added Order model to Prisma
  • Added logic to create unpaid order
  • Added logic to make order paid from confirmation page and Stripe payment_intent.succeeded webhook

Hour #15

  • Debugged coding error with receiving Stripe webhook. I was using old SvelteKit syntax, doh.
  • Added a slider to adjust depth of 3D model

Hour #16

  • Solved issue with SVG spaces causing rendering issue. Switched to data urls with base64 encoding.
  • Made some notes about landing page content.
  • Starting working on UI.

Hour #17

  • Added landing page
  • Created layouts for marketing and app site

Hour #18

  • Working on styling logo listing page
  • Working on styling logo designer page

Hour #19

  • Continued stlying designer page
  • Added vertical slider for changing extrusion depth

Hour #20

  • Back from sleep
  • Reviewing todo list and prioritizing
  • Fixed issue with zoom button
  • Made fabrication selection a drop down
  • Started looking into better textures

Hour #21

Hour #22

  • Extracted Scene and Logo 3D code into components
  • Added 3D view to Logo listing page
  • Looking into weird flickering issue in Chrome Desktop, still haven't tracked down the issue. Works fine in FF and Chrome mobile.

Hour #23

  • Cleaning up styling in preparation for a demo video
  • Setup app to test app in dev mode with local mobile device (with SSL) pnpm dev --host 0.0.0.0 --https

Hour #24

  • Spent the last hour cleaning things up so I can record a demo video.

All done!!! and it works pretty well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment