Overview
In this section you'll learn the philosophy behind Treats creation, main concepts of Treats and how to customize your Treats project to better suits your need.
Philosophy
When we build Treats, our main goal was to be able to rapidly iterate our frontend-engineering process with React by eliminating some unnecessary repeated process such as setting up build tools, installing dependencies, setting up localization, state-management, GraphQL client, etc but still maintains the flexibility of customization that might be needed on each projects. We then tried to look at many starter kits, frameworks, tool kits that might cater our needs, but unfortunately we didn't find any. So, like all nerds out there, we decided to build our own React framework! We build Treats with the following philosophy in mind:
- Provides users with list of curated essential dependencies to kickstart their projects such as i18n, state management, graphQL client, head tag management and build tools.
- Can work with zero configuration but flexible enough for power users to configure their project.
- App implementation that easily customizable for power users, and for users who didn't need to customize their app, they could just use our default implementation.
- Easily extensible with addons.
- Painless update - update should be as simple as bumping Treats dependency on users
package.json
.
Scripts
Treats comes with useful treats
command line interface to manage your Treats project. The following commands are available:
- start - Start the development environment with Hot Module Replacement enabled.
- build - Build and bundle both client-side and server-side assets.
- generate - Generate source codes based on a treats generator folder.
- clean - Flush all files that had been built by treats.
- documentation - Manage code documentations.
- test - Ran unit tests with Jest
The detailed instructions about each of these commands can be found here
Filesystem Hooks
Treats uses several files and folders as APIs for customizing app implementations, throughout your journey on learning main concepts of Treats, you'll encounter many files and folders that serves as filesystem hooks for Treats. List of these files and folders can be found here.
Configuration Files
There are two type of configuration files that can be supplied to Treats app: