Remix Template Starter is designed to streamline your development process, enabling you to quickly launch highly effective web applications using the Remix full-stack framework. This template is a curated blend of application structures, dynamic UI components, and best practices in software engineering and web development workflows. It includes a range of functionality hooks, utilities, and seamless integration with key third-party services.
Powered by the following technologies:
Frontend:
Backend:
Others:
This template serves as a starting point for building your own application. You can customize and expand upon the existing components and features to fit your specific needs. It provides a foundation that you can build on top of, saving you time and effort in setting up the initial structure and common functionalities.
It's a collection of reusable components that you can copy and paste into your own projects. This approach gives you complete control over the code and allows you to modify and adapt the components to your specific requirements.
To use this template effectively, follow these steps:
Remember, this template is a starting kit, not a blank repository generator. It provides a foundation, but it's up to you to customize and shape it based on your actual application needs. Take the time to explore, understand, rename, and replace the contents as you build your application.
By leveraging the reusable components and following the provided structure, you can kickstart your development process and focus on implementing the unique aspects of your application. Feel free to modify, extend, and adapt the template to create a codebase that perfectly suits your project requirements.
This template can be used as a starting point, and be built on top of on, but can also be used to take the reusable components from this project, refer to the components to see what can be taken and used in your own project.
A live preview with the project deployed can be viewed here, it might take a while for the website to first load due to the VM sleeping (it only wakes up when someone is accessing the site, and sleeps after 10 minutes of inactivity).
You can either register a new account, log in with GitHub or log in using the following account:
Email:
test@test.com
Password:
test12345
Take into account that adding a new product, editing an existing product and deleting products won't work. The APIs are protected by ensuring that only users with the Administrator
role can modify them. If you enjoy the preview, then refer to the Getting Started section to get the project up and running on your own machine.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Before installing, ensure you have the following:
You can choose from the following 2 options:
Use the following command to clone the repository:
git clone https://github.com/aliabudal/Remix-Template-Starter.git
Use the following command to install using npx:
npx create-remix@latest --template aliabudal/Remix-Template-Starter
After cloning the repository or setting up the project using npx
Use the following command if you are using npm:
npm install
Use the following command if you are using yarn:
yarn install
Refer to the env-example.md file for the required environment variables. You need to create a .env
file in the root directory of your project and add the variables mentioned there with the appropiate values. Make sure to replace the empty quotes with the actual values corresponding to your setup. The project by default uses Turso for the database, if you want to use a different provider, you will have to modify the server and drizzle.config.ts with your desired config. The project also has GitHub OAuth 2.0 implemented, if you do not wish to use it, you don't have to fill in the clientID
and clientSecret
in the .env
file.
After setting up the environment variables, you are ready to proceed with either development or production.
For development purposes, you can use the following commands to start the project:
Use the following command if you are using npm:
npm run dev
Use the following command if you are using yarn:
yarn dev
Now your project should be up and running, and you can access it in your browser at localhost:3000.
When you are ready to deploy your project to a production environment, follow these steps:
Use the following command if you are using npm:
npm run build
Use the following command if you are using yarn:
yarn build
Then you can run the following commands to run the app in production mode:
Use the following command if you are using npm:
npm start
Use the following command if you are using yarn:
yarn start
For production deployment, the project also includes a Dockerfile. The Dockerfile provides instructions to build a containerized version of your application.
The Remix Template Starter comes with a set of pre-built components and features to help you quickly develop your application. It also comes with route protection via a parent route that acts as a wrapper around the other routes, ensuring that no unauthorized access is allowed to those routes. Linting and formatting with Prettier and ESLint, hosting and auto-deployment with Fly.io and GitHub, refer to this section.
The ui/ directory contains a collection of reusable UI components that are taken from either shadcn/ui or Aceternity UI. These components provide a consistent and stylish look and feel to your application. Some of the components may have undergone small modifications to fit the specific needs of this template.
The UI components include:
The components located outside the ui/ directory are built using the logic and styling from the UI components, along with additional functionality and design specific to their purpose.
These components include:
These components are designed to work together seamlessly, providing a cohesive and functional user interface for your application.
The template utilizes remix-auth and remix-auth-github for handling authentication. It provides support for both form-based authentication and GitHub OAuth 2.0 authentication. The latter can be extended to any other provider that you want (Google, Twitter, Microsoft OAuth 2.0 etc.), you will simply have to extend the following file, and use the appropiate callback, refer to the following GitHub repo for more details.
All essential routes are protected using the _shell route, this route acts as a parent route that wraps all the other routes in the application. It ensures that only authenticated users can access the protected routes. It also makes it so that the authentification is handled only 1 time throughout the entire application. The following image represents a representation of the routes:
Ensure that you define the directory inside the routes/ using the _shell
syntax if you wish the route to be protected.
This section explains some optional but beneficial features that are included in the template. You can easily remove them if you do not wish to use them.
The template comes with ESLint and Prettier configured for linting and formatting your code, with the appropiate plugins for them (TailwindCSS, React etc).
Run the following command to format the entire project:
npm run format
Run the following command lint the entire project:
npm run lint
View all other commands or modify the existing commands in package.json.
The template includes a GitHub Actions workflow configuration file that automatically checks for linting and formatting errors on pull requests and pushes to the master branch. It also deploys your application to Fly.io when changes are pushed to the master branch.
The workflow consists of two jobs:
build: Runs on every pull request and push to the master branch. It checks out the code, sets up Node.js, installs dependencies, and runs ESLint and Prettier to check for linting and formatting errors.
deploy: Runs only on pushes to the master branch, after the build job has completed successfully. It checks out the code, installs the Flyctl CLI, and deploys the application to Fly.io using the provided FLY_API_TOKEN secret.
If you want to remove either of those jobs, you can remove the job from the workflow configuration file at .github/workflows/workflows.yaml
.
Important: Make sure to set up the FLY_API_TOKEN secret in your GitHub repository's settings to enable automatic deployment to Fly.io.
These optional features help maintain code quality, consistency, and automated deployment, enhancing your development workflow.