The 2020 Next.js rewrite, now being merged into impress!
Matchu
b84c8ba34e
Now, someone with production DB access can run `yarn db:export:public-data` to create `public-data-constants.sql` and `public-data-from-modeling.sql`. Then, someone setting up their dev database can run `yarn db:setup-dev:full` and get all the wearables data imported right into their dev database! I'm noticing just how poorly I'm keeping up with my own goals for finishing up DTI, and wondering if now is a good time to circle back to some old offers for code contributions I got last year… I also just figure that making this app Possible To Run with a backup of the basic public database is like. a pretty handy thing to have for archival's sake imo Note that, for this change, we also set up Git LFS (Large File Storage). Github should be automatically compatible with this! It's a way to not write the whole 30MB database dump into the repository history, and instead keep it in a secondary filestore, because Git's core algorithms aren't really built to handle large blobs of data very well. Users setting up their dev environment will therefore also need to have Git LFS installed for this script to work! (Otherwise, they'll see a "pointer" file in `public-data-from-modeling.sql.gz` that contains some metadata about the file state but not the data itself.) |
||
---|---|---|
.github/workflows | ||
.husky | ||
.vscode | ||
deploy | ||
pages | ||
public | ||
scripts | ||
src | ||
.eslintrc.json | ||
.gitattributes | ||
.gitignore | ||
LICENSE.md | ||
lint-staged.config.js | ||
next-env.d.ts | ||
next.config.js | ||
package.json | ||
README.md | ||
tsconfig.json | ||
yarn.lock |
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
andsrc/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.