Layout and UI
Goal
This snapshot advances Tidepool Notes by teaching you to render SSR pages with Bootstrap 5.
Every numbered folder is a complete app. Run this stage independently, then compare it with the previous folder.
Prerequisites
Use Node.js 20+, npm, and a terminal. You should recognize React components, TypeScript modules, and HTTP verbs.
Port 3004 must be free. Copy .env.example before starting database stages.
- Node.js and npm
- A code editor and terminal
- Docker from part 4 onward
Concepts
The root layout wraps every route. Bootstrap utility classes keep spacing and typography consistent without page-specific CSS.
Keep the server boundary visible: Remix loaders read trusted data on the server; actions must validate input and re-check authorization before mutations.
Walkthrough
Configure the shared layout, pass sample posts to the home loader, and verify server-rendered HTML in view source.
Read the example, then open the matching snapshot. The repository includes the surrounding setup and error handling.
<article className="post-card"><h2>{post.title}</h2></article>
Run and verify
Enter 03-Layout-And-UI, install dependencies, copy .env.example when present, and start Remix on port 3004.
Open http://127.0.0.1:3004. Watch the terminal for validation and database errors.
git clone https://github.com/michaeldunga1/fcc-remix-blog.git
cd fcc-remix-blog/03-Layout-And-UI
npm install
cp .env.example .env
npm run dev
Troubleshooting
If styles are missing, confirm Bootstrap is linked in root.tsx and site.css is imported.
Missing-module errors usually mean npm install ran in another snapshot. For Postgres failures, confirm Docker and the tidepool_NN database name.
- Read the first error first
- Restart after environment changes
- Never commit .env or node_modules
Try this
Render a friendly empty state when the posts list is empty.
Test a happy path and one invalid or unauthorized request.
- Make one small change
- Test it in the browser
- Compare with the next snapshot only after it works
Next: Data Layer
Comments
One comment per signed-in account. Comments are saved with this page’s URL.