- Based On Create React App
- Get all the abilities of CRA out the box
- TypeScript
- Because we love types!
- MobX State Management
- Everything needed to get started with MobX
- Login + Authentication Management
- Login Page + Authentication implemented already for you
- Api Infrastructure
- Tired of writing API services all time ? Ready Api infrastucture for just add models/entities and focusing on the important parts of the development
- Antd Components Library
- Examples of antd components usage
- Ready Translations
- i18next ready translations, just add translations file and enjoy
- React Hook Form
- The best and most simple library to working with forms
- DayJS
- Because moment.js is dead :
- Sass
- Mock Service Worker
- Simple library to mock server during development
- Prettier + Husky
- Get your code cleaned on each commit
- Todo List Example
- Full example of todo list with api calls, mobx and React
- Ready For Production!
- Environment management supported, just build and deploy your app
- Everything is modifiable
- If you don't like any part of the boilerplate, you can just replace in seconds !
public/locale
- Add ${languageName}.json
to support additional language.
Any small components that are building blocks for the project can be added here.
Jsons by the name of the environment, e.g production.json
.
Anything added here will be available at the application in index.tsx
and create-store.ts
.
Here goes the more big "components", like the to-do list and big features like whole pages, chat, etc..
create-store.ts
- In charge of initializing everything we need for our application
- Creating the
env
object we can access in our mobx-stores by usinggetEnv()
- Creating the
RootStore
throughmobx-easy wrapRoot
function.
mobx-easy-wrapper.ts
- Wrapping
getEnv + getRoot
with the correct generic types, so we won't be forced to do it everywhere.
- Wrapping
store-provider.ts
- Provider for the rootStore so we can use our hook
useStore
in every react component.
- Provider for the rootStore so we can use our hook
Hooks for the project, just like useStore
gives us ability to access the rootStore
from every react component.
For those who are interested in mocks during development,
You can add mocks freely in mocks
folder.
If you want to disable - go to index.tsx
and remove lines 27-30
Here are all of the services of the project, for example: translation-service.ts
.
- Core Service
- Base Service - Common logic that relates to all services in the project that need to execute HTTP requests.
- Http Service - Axios wrapped in a service with support at setting JWT token.
- Crud Service - Service implements all CRUD functions, so we don't need to copy and paste it everywhere.
- Api Factory - Stores all of our HTTP Service/API Services, used there declaration merging, so we can add dynamically services easily by just adding object to the array.
- Api Services
- Auth Service - Implements logic regarding authentication.
- Todos Service - Plain and simple, extends CRUD Service.
MobX Stores and Models stored here, we are using RootStore
and DataStore
+ UiStore
to diffrenicate between our data in the application and the ui/views.
We Also use mobx-easy
for easier sharing of RootStore
between store and Env
object. (you can read about it in the resources section)
Here are the global styles of the project.
- There is a todo list feature consists of:
- Crud Service
- MobX Store, MobX Model
- React Components using mobx store and model
- Basic styles
- Environment
- Ready File for dev + prod
- Documentation:
- https://mobx.js.org/README.html
- https://reactjs.org/
- https://www.typescriptlang.org/
- https://create-react-app.dev/
- https://react-hook-form.com/
- https://github.com/stolenng/mobx-easy
- https://day.js.org/
- https://mswjs.io/
- http://mobx-easy.georgy-glezer.com/docs/intro.html
- https://react.i18next.com/
- https://ant.design/
- Articles:
- https://mobx.js.org/defining-data-stores.html
- https://levelup.gitconnected.com/mobx-tips-and-pitfalls-92e635108653
- https://levelup.gitconnected.com/react-hooks-rules-for-cleaner-code-3bceb5decf7
- https://levelup.gitconnected.com/react-hooks-mobx-todolist-c138eb4f3d04
- https://medium.com/front-end-weekly/separation-of-data-and-ui-in-your-web-app-2c3f1cc3fbda
- Course:
Feel free to talk to me on any social network, open pull requests, issues, suggest changes, and open pull requests :)
This project was bootstrapped with Create React App.
In the project directory, you can run:
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.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.