nvm use node v20.11.0
- Until form login is working again login with discord and then copy paste the userId from prisma studio into the seed file
https://sergiodxa.com/tutorials/find-and-remove-unused-code-with-knip
- Accordian - https://github.com/AllanSimoyi/PersonalWebsite/blob/main/app/core/components/AccordionItem.tsx
- Resizeable image component reference
- Blog Category Filter
I use Render for hosting a postgress database using Prisma ORM.
Create a new database and then add the following environment variables to your .env
file.
DATABASE_URL=''
Create a Cloudinary account and add the following environment variables to your .env
file.
CLOUDINARY_API_KEY= CLOUDINARY_API_SECRET= CLOUDINARY_CLOUD_NAME=
-
Sign up and log in to Fly
flyctl auth signup
- Setup Fly. It might ask if you want to deploy, say no since you haven't built the app yet.
flyctl launch
📖 See the Remix docs and the Remix Vite docs for details on supported features.
- [] Rewrite, refactor, or create new components derived from the original project.
- [] brand-icon.tsx
- [] user-placeholder.tsx
- [] resume/index.ts
- [] Prisma seed data
- []
I am trying to do a bunch of automation and one thing is to seed my db AND scan my project for updated content and update the db with the new content.
"firstSeed": "npx prisma db push && npx prisma generate && npx prisma db seed && tsx scripts/init-seed.ts",
This should only be run once during the initial dev and production set up. Using this at any other time will wipe your db. I should add some type of warning!
// This adds type narrowing by the intent property const Schema = z.discriminatedUnion('intent', [ z.object({ intent: z.literal('delete'), id: z.string() }), z.object({ intent: z.literal('create'), name: z.string() }), ]);
export async function action({ request }: ActionArgs) { const data = await zx.parseForm(request, Schema); switch (data.intent) { case 'delete': // data is now narrowed to { intent: 'delete', id: string } return; case 'create': // data is now narrowed to { intent: 'create', name: string } return; default: // data is now narrowed to never. This will error if a case is missing. const _exhaustiveCheck: never = data; } };
- use
openssl rand -hex 32
to generate a secret key for the .env file
Run the Vite dev server:
npm run dev
First, build your app for production:
npm run build
Then run the app in production mode:
npm start
Now you'll need to pick a host to deploy it to.
If you're familiar with deploying Node applications, the built-in Remix app server is production-ready.
Make sure to deploy the output of npm run build
build/server
build/client
📖 See the Remix docs and the Remix Vite docs for details on supported features.
https://github.com/jolbol1/JamesShopland.com
Run the Vite dev server:
npm run dev
First, build your app for production:
npm run build
Then run the app in production mode:
npm start
Now you'll need to pick a host to deploy it to.
If you're familiar with deploying Node applications, the built-in Remix app server is production-ready.
Make sure to deploy the output of npm run build
build/server
build/client