This project was bootstrapped with the Epic Stack. It is my attempt to learn the full development cycle, and it also serves as a component for my résumé.
More often than not, a Remix route module can contain both the UI and the interactions with the models (data entities in the database) in the same file, which leads to seamless developer ergonomics and productivity.
Route modules have three primary exports:
loader
: for server-side data loading to provide data to your component on GET requests.action
: for data mutations. It only runs on the server and handlePOST
,PUT
,PATCH
, andDELETE
requests to provide data to your component.default
: the React component that runs both on the server and the client. It will be rendered when a route matches the URL.
Checkout the Remix route convention and remix-flat-routes to understand how routing works.
Let's see how Remix serves as a fullstack framework by describing what's going on when you click on the "Log In" button on the app's header:
The server-client data flow is defined in the app/routes/_auth+/login.tsx
file. You can see that:
- The
loader
function prepares data for initial render - The
action
function handles form submissions - The
LoginPage
component uses bothloader
andaction
data to render UI and manage state - All server-client communication happens through standard HTTP methods (GET/POST)
- Session state is maintained via cookies
If you want to run the app locally, make sure to have the same environment as I do to get it working properly. Please download and install these 2 softwares (if you don't have them already):
- nvm-setup.zip from its latest release
- Git
Then open up your terminal with Admin privilege and run the following commands:
nvm install 22.13.0
nvm use 22.13.0
node -v
(the output should bev22.13.0
)- Pick a folder of your choice, or create an empty folder and then
cd path-to-that-folder
git clone https://github.com/HelpMe-Pls/Fullstack-notes.git
cd Fullstack-notes
In the project directory, you can run:
Installs all required dependencies to run the app.
Prepares the database so that the backend can start properly.
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits in your code and save.
You will also see any lint errors in the console.
Runs unit tests using Vitest in the interactive watch mode.
Test files are identified by the .test.ts
or .test.tsx
extensions and are located in the app/routes
and app/utils
folders.
Runs all tests once (not in watch mode) and generates a coverage report using the Vitest's built-in coverage reporting.
It shows which parts of your code are covered by tests.
Runs end-to-end tests using Playwright. Test files are located in the ./tests/e2e
folder.
You must run the npm run build
or npm run pretest:e2e:run
and stop your dev server before running this command.
Builds the app for production to the build
folder.
It runs all build scripts sequentially by using the run-s
command from the npm-run-all
package.
Once the build
folder is created, you can run the app locally in production mode with the npm start
command.
According to the documentation, you can also deploy to Fly.io. Notice that there's a trial period for using their services.
For the purpose of learning the fullstack development cycle, deploying with a Docker image is an essential skill to have.
If you're running a single instance, LiteFS (configured in Dockerfile) will still work but won't be replicating data (since Docker volume is sufficient).
If you later decide to scale to multiple instances, having LiteFS already configured (in the other/litefs.yml
file) will make the transition easier.
To quickly learn React for free, check out the React documentation.
For a paid course, I highly recommend The Joy of React course.
My personal preference of a learning path to become a React Frontend developer.
Checkout the reasons why I chose Remix as a framework to learn about fullstack development.
Pull requests are most welcome. For breaking changes suggestion, please open an issue first to discuss what you would like to change or improve.
Contact me if you need further support.