The 2020 Next.js rewrite, now being merged into impress!
Find a file
Matchu 1875931a48 simplify canvas code, just use separate elements
Previously I tried to be clever and pre-optimize by putting all the layers onto one canvas… I think this probably helped by batching their paints, but it made fades less smooth by not taking advantage of native CSS transitions, and it made us dip into JS way more often than necessary.

Here, I take the simpler approach: just layers of <img> and <canvas> tags, with each animated layer on its own canvas, and letting the browser handle transitions and compositing, and separate `setInterval` timers to manage their framerates.

I have a suspicion that batching the paints could help performance more, but honestly, maybe that batching is already happening somehow, because things look pretty great on my big-screen stress test now; and so if it _is_ relevant, I want to wait and see after testing on low-power devices.
2020-10-08 04:13:47 -07:00
.storybook install storybook 2020-09-21 21:16:40 -07:00
.vscode another cute fun react vs code snippet :) 2020-09-12 17:54:34 -07:00
api add more valid urls to asset proxy 2020-09-24 08:30:39 -07:00
public draft of animated layers in storybook 2020-09-22 03:03:01 -07:00
scripts add logging to modeling 2020-10-06 07:06:19 -07:00
src simplify canvas code, just use separate elements 2020-10-08 04:13:47 -07:00
.gitignore add .vercel to .gitignore 2020-07-02 14:12:36 -07:00
config-overrides.js enable Fast Refresh 2020-07-22 21:03:04 -07:00
dev-todos.txt change validPetPoses bit order, add dims to blob 2020-05-03 13:03:02 -07:00
package.json add logging to modeling 2020-10-06 07:06:19 -07:00
README.md update README to mention Rails app is gone 2020-09-04 04:09:01 -07:00
yarn.lock fix conflict between storybook and jest 2020-09-22 03:23:07 -07:00

Dress to Impress beach logo

Dress to Impress 2020

This is a rewrite of the Neopets customization app, Dress to Impress!

It's a React app, built with create-react-app, running on Vercel, JAMstack-style.

The motivating goals of the rewrite are:

  • Mobile friendly, to match Neopets's move to mobile.
  • Simple modern tech, to be more maintainable over time and decrease hosting costs.

If you want to contribute, please reach out to Matchu! This repository is almost shareable, but the main limitation is that we currently run even our development server against the production database, and those credentials are private. But we can change that if there's interest!

Architecture sketch

First, there's the core app, in this repository.

  • React app: Runs on Vercel's CDN. Code in src/app.
  • API functions: Run on Vercel's Serverless Functions. Code in api and src/server.

Then, there's our various data storage components.

  • MySQL database: Runs on our Linode VPS, colocated with the old app.
  • Amazon S3: Stores PNGs of pet/item appearance layers, converted from the Neopets SWFs. (Once Neopets releases HTML5-compatible assets for all their items, we can hopefully remove this!)

Finally, there's our third-party integrations.

  • Auth0: For authentication. Data imported from our old OpenNeo ID auth database.
  • Honeycomb: For observability & performance insights on the backend.
  • Discord: For logging Support users' actions to a private Discord server.
  • Neopets: We load pet data from them! And plenty of assets!

Notable old components not currently included in Impress 2020:

  • Elasticsearch: Used for lightning-fast item search queries. So far, we're finding the MySQL queries to be fast enough in practice. Might consider using some kind of fulltext query engine if that doesn't scale with more users!
  • Resque: Used to schedule background tasks for modeling and outfit thumbnails.
  • Outfit thumbnail generation: Used for outfit thumbnails in the app. I'm wondering if there's a way to get away with not doing this, like just rendering the layers... but I suppose if we want a good social share experience, then we'll probably want this. Maybe we can generate them on the fly as API requests, instead of adding a data storage component?
  • Memcache: Used to cache common HTML and JSON snippets. Not yet needing anything similar in Impress 2020!
  • The entire old Rails app! No references to it in here, aside from some temporary URL links to features that aren't implemented here yet.