You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fullstack approach, monolith NextJS app with combined Express, NextJs, Payload CMS backends in only 1 server or 1 serverless instance (AWS Lambda or GCP Function).
tRPC (Typescript Remote Procedure Call) to ensure end-to-end type-safty.
Install payload adapters for MongoDb (alternative: Postgres), and webpack bundler for our Express server:
npm i @payloadcms/richtext-slate @payloadcms/bundler-webpack @payloadcms
/db-mongodb --save
For viewing payload Admin dashboard, please see http://localhost:3000/sell
Important note: You should not have any users document in your database, in order to be redirected to http://localhost:3000/sell/create-first-user. See more here
Alternatives are AWS SES, Google Mail (500 emails limit), Mailchimp. Make sure to use the email providers, which our confirmation emails would not be landed in Spam folder.
Note: we must add DNS records to prove our domain, so resend can work. See here
Application Architecture
Stripe Checkout
Go to Stripe account, activate Test Mode, and select Developers tab.
Use this credit card number for testing: 4242 4242 4242 4242. Other details can be anything.
We will keep polling /thank-you page until order is set with isPaid = true.
Create Stripe webhook in Stripe dashboard, under Developer mode. Update environment variable STRIPE_WEBHOOK_SECRET.
Build the docker image and run with external port of 8080, and internal port of 3000
Make sure to ignore node_modules in .dockerignore to avoid platform issues between x86-64 and arm64
Railway could build the app with or without Docker. But with Docker, we need to specify environment variables that we pass from Railway app to Docker container.