12 |
13 | Page not found.
17 |Sorry, we couldn’t find the page you’re looking for.
18 |├── src ├── ui │ ├── button │ │ ├── index.ts │ │ └── button.tsx │ ├── dialog │ │ ├── index.ts │ │ └── dialog.tsx │ └── loading-indicator │ │ ├── index.ts │ │ ├── linear-loading-indicator.tsx │ │ └── circular-loading-indicator.tsx ├── main.scss ├── routes │ ├── index.ts │ └── app-route.tsx ├── core │ ├── splash-screen │ │ ├── index.ts │ │ ├── splash-screen.tsx │ │ └── splash-screen.scss │ └── error │ │ ├── error-boundary │ │ ├── index.ts │ │ └── error-boundary.tsx │ │ ├── index.ts │ │ └── not-found-page │ │ └── not-found-page.tsx ├── features │ ├── auth │ │ ├── routes │ │ │ ├── index.ts │ │ │ └── auth-routes.tsx │ │ └── views │ │ │ ├── sign-in-page │ │ │ └── sign-in-page.tsx │ │ │ └── sign-up-page │ │ │ └── sign-up-page.tsx │ ├── home │ │ ├── routes │ │ │ ├── index.ts │ │ │ └── home-routes.tsx │ │ ├── components │ │ │ ├── Feature │ │ │ │ └── Feature.tsx │ │ │ ├── Header │ │ │ │ └── Header.tsx │ │ │ ├── Navbar │ │ │ │ └── Navbar.tsx │ │ │ └── Footer │ │ │ │ └── Footer.tsx │ │ └── views │ │ │ └── home │ │ │ └── home.tsx │ ├── users │ │ ├── routes │ │ │ ├── index.ts │ │ │ └── users-routes.tsx │ │ └── views │ │ │ ├── users-page │ │ │ ├── users-page.tsx │ │ │ └── users-page.unit.tsx │ │ │ ├── user-detail-page │ │ │ └── user-detail-page.tsx │ │ │ └── user-creation-page │ │ │ └── user-creation-page.tsx │ └── dashboard │ │ ├── routes │ │ ├── index.ts │ │ └── dashboard-routes.tsx │ │ └── views │ │ └── dashboard-page │ │ └── dashboard-page.tsx ├── assets │ ├── styles │ │ └── tailwind.css │ └── logo.png ├── layout │ ├── portal-layout │ │ ├── components │ │ │ └── topbar │ │ │ │ └── topbar.tsx │ │ ├── portal-layout.tsx │ │ └── stacked-layout │ │ │ └── stacked-layout.tsx │ └── minimal-layout │ │ └── minimal-layout.tsx ├── main.tsx └── app.tsx ├── .browserslistrc ├── cypress.json ├── .husky ├── pre-commit └── commit-msg ├── commitlint.config.js ├── docs └── assets │ ├── logo.png │ └── react-stater-template.png ├── public ├── images │ ├── logo.png │ ├── react-stater-template.png │ ├── services-shape-1.svg │ ├── services-shape.svg │ ├── about-shape-1.svg │ ├── about-shape-2.svg │ ├── banner-bg.svg │ └── about1.svg └── favicon.svg ├── .editorconfig ├── postcss.config.js ├── cypress ├── tsconfig.json ├── fixtures │ └── example.json ├── integration │ └── example.spec.ts ├── .eslintrc.json ├── support │ ├── index.ts │ └── commands.ts └── plugins │ └── index.ts ├── .eslintignore ├── tailwind.config.js ├── jest.setup.ts ├── CHANGELOG.md ├── .vscode ├── extensions.json └── settings.json ├── .prettierrc.json ├── tsconfig.json ├── vite.config.ts ├── LICENSE ├── .github ├── workflows │ └── pull-request-checks.yml └── pull_request_template.md ├── .eslintrc.json ├── index.html ├── package.json ├── .gitignore ├── README.md └── jest.config.ts /src/ui/button/index.ts: -------------------------------------------------------------------------------- 1 | export * from './button'; 2 | -------------------------------------------------------------------------------- /src/ui/dialog/index.ts: -------------------------------------------------------------------------------- 1 | export * from './dialog'; 2 | -------------------------------------------------------------------------------- /src/main.scss: -------------------------------------------------------------------------------- 1 | @import './assets/styles/tailwind.css'; 2 | -------------------------------------------------------------------------------- /.browserslistrc: -------------------------------------------------------------------------------- 1 | defaults 2 | not IE 11 3 | not op_mini all 4 | -------------------------------------------------------------------------------- /src/routes/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './app-route'; 2 | -------------------------------------------------------------------------------- /src/core/splash-screen/index.ts: -------------------------------------------------------------------------------- 1 | export * from './splash-screen'; 2 | -------------------------------------------------------------------------------- /src/core/error/error-boundary/index.ts: -------------------------------------------------------------------------------- 1 | export * from './error-boundary'; 2 | -------------------------------------------------------------------------------- /src/features/auth/routes/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './auth-routes'; 2 | -------------------------------------------------------------------------------- /src/features/home/routes/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './home-routes'; 2 | -------------------------------------------------------------------------------- /src/features/users/routes/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './users-routes'; 2 | -------------------------------------------------------------------------------- /cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseUrl": "http://localhost:3000", 3 | "video": false 4 | } 5 | -------------------------------------------------------------------------------- /src/features/dashboard/routes/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './dashboard-routes'; 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx lint-staged 5 | -------------------------------------------------------------------------------- /src/ui/dialog/dialog.tsx: -------------------------------------------------------------------------------- 1 | export const Dialog = () => { 2 | return
7 | {description}
37 |
12 |
13 | Sorry, we couldn’t find the page you’re looking for.
18 |Something went wrong:
122 |{error.message}
123 |
124 | 9 | © 2022 truonghungit 10 |
11 | 12 | 13 | Facebook 14 | 21 | 22 | 23 | Instagram 24 | 31 | 32 | 33 | Twitter 34 | 37 | 38 | 44 | GitHub 45 | 52 | 53 | 54 | Dribbble 55 | 62 | 63 | 64 |
React Starter Template
2 |
3 | [](https://github.com/truonghungit/react-starter-template/actions/workflows/pull-request-checks.yml)
4 | [](https://sonarcloud.io/summary/new_code?id=truonghungit_react-starter-template)
5 | 
6 | 
7 | 
8 | [](https://github.com/truonghungit/react-starter-template/blob/master/LICENSE)
9 | [](https://github.com/prettier/prettier)
10 |
11 | 
12 |
13 | This is a [React](https://reactjs.org) + [TypeScript](https://www.typescriptlang.org/) starter template built with [Vite](https://vitejs.dev). We provide everything you'll need to get started building React Apps.
14 |
15 |
16 | #### [Live Demo](https://react-starter-template.vercel.app)
17 | #### [Changelog](https://github.com/truonghungit/react-starter-template/blob/master/CHANGELOG.md)
18 |
19 | ## 🎯 Goals
20 |
21 | ### Get started in seconds
22 |
23 | This starter allows you to focus on development rather than learn and configure build tools.
24 | We've prepared the fantastic below for you.
25 |
26 |
27 | - [Vite](https://vitejs.dev) Next Generation Frontend Tooling
28 | - [ReactJS](https://reactjs.org) with [TypeScript](https://www.typescriptlang.org) Always update to the latest version
29 |
30 | #### Testing
31 | - [Jest](https://jestjs.io/) Test runner
32 | - [Testing Library](https://testing-library.com/) Test UI from a users perspective (for React and Cypress)
33 | - [Cypress](https://www.cypress.io)
34 |
35 | #### Format and lint
36 | - [ESLint](https://eslint.org/) Enforce code standards & [Prettier](https://prettier.io/) Code formatting
37 | - [Browserslist](https://github.com/browserslist/browserslist) Supported browsers
38 | - [Commitizen](https://github.com/commitizen/cz-cli)
39 | - [Commitlint](https://commitlint.js.org)
40 | - [Lint Staged](https://github.com/okonet/lint-staged) 🚫💩 slip into your code base!
41 |
42 | #### Workflow
43 | - Github action for pull request checks
44 | - [Pull Request template](https://github.com/truonghungit/react-starter-template/blob/master/.github/pull_request_template.md) Consistent and helpful colabouration.
45 |
46 | #### Library
47 | - [React Router](https://reactrouter.com/) Single Page App **(SPA)** navigation
48 | - TailwindCSS Integrated
49 | - Headless ui & heroicons
50 |
51 | #### Example pages
52 | - Home page as landing page
53 | - Sign In, Sign Up pages,
54 | - Dashboard page
55 |
56 | ### Recent best practices
57 |
58 | This repository provide an up to date example of React application following all recent best practices in various areas
59 |
60 | ## 💻 Getting started
61 |
62 | #### Create project
63 |
64 | Clone the latest version
65 |
66 | ```bash
67 | git clone https://github.com/truonghungit/react-starter-template.git my-app
68 | cd my-app
69 | ```
70 |
71 | [Previous versions](https://github.com/truonghungit/react-starter-template/tags) are also available for download.
72 |
73 | You can also click on **_Use this template_** on GitHub
74 |
75 | 
76 |
77 | #### Install dependencies.
78 |
79 | ```bash
80 | yarn install
81 | ```
82 |
83 | #### Start
84 |
85 | Start your application in local development server with hot reload at http://localhost:3000.
86 |
87 | ```bash
88 | yarn start
89 | ```
90 |
91 | ## 🤖 Testing
92 |
93 | ### Unit tests
94 |
95 | Execute all unit tests
96 |
97 | ```bash
98 | yarn test:unit
99 | ```
100 |
101 | Execute all unit tests and collect coverage
102 |
103 | ```bash
104 | yarn test:unit:coverage
105 | ```
106 |
107 | ### End to end testing
108 |
109 | Run e2e tests
110 |
111 | ```bash
112 | yarn test:e2e
113 | ```
114 |
115 | ## 😎 Make It Your Own
116 |
117 | When using this starter project to build your own application you might consider some of the following steps:
118 |
119 | - rename project in `package.json` `name` property and set appropriate version (eg `0.0.1` or `1.0.0`)
120 | - delete pre-existing `CHANGELOG.md` (you will generate your own with future releases of your features)
121 | - update the `README.md` content with your context
122 | - edit the title and Open Graph metadata properties in `index.html`
123 | - replace logo in `/public/images` folder
124 | - update github workflow if you need in `.github/workflows`
125 |
126 |
127 | ## 🌲 Branching
128 |
129 | We use [Trunk Based Development](https://trunkbaseddevelopment.com/) to accommodate short-lived branches and a _**"trunk"**_ _(our `master` branch)_ as a source of truth.
130 |
131 | - **Feature: `feature/*`**
132 |
133 | Example: `feature/JIRA-123-my-new-feature`
134 |
135 | - **Bug: `bugfix/*`**
136 |
137 | Example: `bugfix/JIRA-123-fix-an-issue`
138 |
139 | - **Release: `release/*`**
140 |
141 | Example: `release/JIRA-123-brand-new-product`
142 |
143 | ## 🏆 Making Commits
144 |
145 | We format our commit messages using [Commitizen](https://github.com/commitizen/cz-cli). This provides the project a consistent, easy structure that allows for automation opportunities.
146 |
147 | - It is **important** that you use Commitizen when making commits
148 |
149 | - In your **terminal** run `yarn commit` when making a commit to enter the interactive GUI.
150 |
151 | ## 💾 Pull Requests
152 |
153 | This project has a template that sets the pull request structure that we expect from contributors.
154 |
155 | - It is **important** to _**give**_ as much context to _**get**_ the best review from your peers.
156 |
157 | _(write the pull request that you would love to encounter yourself)_
158 |
159 | - You do not have to fill out each section if it is not applicable.
160 |
161 | ## 🗜️ Merging
162 |
163 | We always _**Squash**_ our _Pull Requests_. This makes a `cherry-pick` from `master` to a `release/*` branch when addressing a Bug Fix easy.
164 |
165 | Make sure to _**ALWAYS**_ rebase _(not merge)_ `master` into your local branch when developing. We strive for a flat Git commit history when possible.
166 |
167 | ## 🧰 Recommended VS Code extensions
168 |
169 | - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
170 | - [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
171 | - [Gitlens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens)
172 | - [Tailwind CSS](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss)
173 | - [VS Code Jest](https://marketplace.visualstudio.com/items?itemName=orta.vscode-jest)
174 |
175 | ## 📝 License
176 |
177 | Copyright © 2022 truonghungit. This source code is licensed under the MIT license found in the
178 | [LICENSE](https://github.com/truonghungit/react-starter-template/blob/master/LICENSE) file.
179 |
180 | ---
181 |
182 | Made with ♥ by truonghungit.
183 |
--------------------------------------------------------------------------------
/jest.config.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * For a detailed explanation regarding each configuration property and type check, visit:
3 | * https://jestjs.io/docs/configuration
4 | */
5 |
6 | export default {
7 | // All imported modules in your tests should be mocked automatically
8 | // automock: false,
9 |
10 | // Stop running tests after `n` failures
11 | // bail: 0,
12 |
13 | // The directory where Jest should store its cached dependency information
14 | // cacheDirectory: "C:\\Users\\Admin\\AppData\\Local\\Temp\\jest",
15 |
16 | // Automatically clear mock calls, instances and results before every test
17 | clearMocks: true,
18 |
19 | // Indicates whether the coverage information should be collected while executing the test
20 | collectCoverage: false,
21 |
22 | // An array of glob patterns indicating a set of files for which coverage information should be collected
23 | // collectCoverageFrom: undefined,
24 |
25 | // The directory where Jest should output its coverage files
26 | coverageDirectory: 'coverage',
27 |
28 | // An array of regexp pattern strings used to skip coverage collection
29 | // coveragePathIgnorePatterns: [
30 | // "\\\\node_modules\\\\"
31 | // ],
32 |
33 | // Indicates which provider should be used to instrument code for coverage
34 | // coverageProvider: "babel",
35 |
36 | // A list of reporter names that Jest uses when writing coverage reports
37 | // coverageReporters: [
38 | // "json",
39 | // "text",
40 | // "lcov",
41 | // "clover"
42 | // ],
43 |
44 | // An object that configures minimum threshold enforcement for coverage results
45 | // coverageThreshold: undefined,
46 |
47 | // A path to a custom dependency extractor
48 | // dependencyExtractor: undefined,
49 |
50 | // Make calling deprecated APIs throw helpful error messages
51 | // errorOnDeprecated: false,
52 |
53 | // Force coverage collection from ignored files using an array of glob patterns
54 | // forceCoverageMatch: [],
55 |
56 | // A path to a module which exports an async function that is triggered once before all test suites
57 | // globalSetup: undefined,
58 |
59 | // A path to a module which exports an async function that is triggered once after all test suites
60 | // globalTeardown: undefined,
61 |
62 | // A set of global variables that need to be available in all test environments
63 | // globals: {},
64 |
65 | // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
66 | // maxWorkers: "50%",
67 |
68 | // An array of directory names to be searched recursively up from the requiring module's location
69 | // moduleDirectories: [
70 | // "node_modules"
71 | // ],
72 |
73 | // An array of file extensions your modules use
74 | // moduleFileExtensions: [
75 | // "js",
76 | // "jsx",
77 | // "ts",
78 | // "tsx",
79 | // "json",
80 | // "node"
81 | // ],
82 |
83 | // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
84 | // moduleNameMapper: {},
85 |
86 | // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
87 | // modulePathIgnorePatterns: [],
88 |
89 | // Activates notifications for test results
90 | // notify: false,
91 |
92 | // An enum that specifies notification mode. Requires { notify: true }
93 | // notifyMode: "failure-change",
94 |
95 | // A preset that is used as a base for Jest's configuration
96 | // preset: undefined,
97 |
98 | // Run tests from one or more projects
99 | // projects: undefined,
100 |
101 | // Use this configuration option to add custom reporters to Jest
102 | // reporters: undefined,
103 |
104 | // Automatically reset mock state before every test
105 | // resetMocks: false,
106 |
107 | // Reset the module registry before running each individual test
108 | // resetModules: false,
109 |
110 | // A path to a custom resolver
111 | // resolver: undefined,
112 |
113 | // Automatically restore mock state and implementation before every test
114 | // restoreMocks: false,
115 |
116 | // The root directory that Jest should scan for tests and modules within
117 | // rootDir: undefined,
118 |
119 | // A list of paths to directories that Jest should use to search for files in
120 | // roots: [
121 | // "
10 |
11 | 13 | Or{' '} 14 | 15 | sign up to start your 14-day free trial 16 | 17 |
18 |
12 |
13 | 15 | Already have an account? 16 | 17 | Sign in 18 | 19 |
20 |
60 |
61 |
195 |
196 | {item.name}
246 |{item.description}
247 |348 | Existing customer? 349 | 350 | Sign in 351 | 352 |
353 |381 | Anim aute id magna aliqua ad ad non deserunt sunt. Qui irure qui lorem cupidatat commodo. Elit sunt 382 | amet fugiat veniam occaecat fugiat aliqua. 383 |
384 |409 | Trusted by over 5 very average small businesses 410 |
411 |460 | Semper curabitur ullamcorper posuere nunc sed. Ornare iaculis bibendum malesuada faucibus lacinia 461 | porttitor. Pulvinar laoreet sagittis viverra duis. In venenatis sem arcu pretium pharetra at. 462 | Lectus viverra dui tellus ornare pharetra. 463 |
464 |476 |497 |477 |482 | 496 |478 | “Cras velit quis eros eget rhoncus lacus ultrices sed diam. Sit orci risus aenean 479 | curabitur donec aliquet. Mi venenatis in euismod ut.” 480 |
481 |
506 | 524 | Semper curabitur ullamcorper posuere nunc sed. Ornare iaculis bibendum malesuada faucibus lacinia 525 | porttitor. Pulvinar laoreet sagittis viverra duis. In venenatis sem arcu pretium pharetra at. 526 | Lectus viverra dui tellus ornare pharetra. 527 |
528 |
546 | 557 | Ac tincidunt sapien vehicula erat auctor pellentesque rhoncus. Et magna sit morbi lobortis. Blandit 558 | aliquam sit nisl euismod mattis in. 559 |
560 |{feature.description}
571 |603 | Get actionable data that will help grow your business 604 |
605 |606 | Rhoncus sagittis risus arcu erat lectus bibendum. Ut in adipiscing quis in viverra tristique sem. Ornare 607 | feugiat viverra eleifend fusce orci in quis amet. Sit in et vitae tortor, massa. Dapibus laoreet amet 608 | lacus nibh integer quis. Eu vulputate diam sit tellus quis at. 609 |
610 |613 | {item.stat} 614 | 615 | {item.emphasis} {item.rest} 616 | 617 |
618 | ))} 619 |