Template Web is a quick starter kit project to build a complete web app using React and Redux.
Template Web |
---|
![]() |
template.azobu.com |
The complete list of all features are located at azobu-projects/template
or live on template.azobu.com
- π¦ Repositories
- 𧱠Tech Stack
- ποΈ Application Structure
- π Getting Started
- π€ Authors
- π€ Contribution
- π Support
- π License
π¦ Repositories π
You should clone all of the required repositories:
template
: Main documentation and designtemplate-web
: Frontend applicationtemplate-api
: Backend application
𧱠Tech Stack π
All the frontend/web dependencies sorted by priority:
- Git β Distributed version control system
- GitHub β Provides hosting for software development and version control using Git
- JavaScript β The primary programming language
- REST API β REpresentational State Transfer, architectural style for distributed hypermedia systems
- React β JavaScript library for building user interfaces
- Redux β Predictable state container for JavaScript apps
- React Redux β Official React binding for Redux
- React Router β Declarative routing for React
- React Hook Form β Simple React forms handling and validation
- Connected React Router β Redux binding for React Router v4
query-string
β Parse and stringify URL query strings
- Redux DevTools Extension β Tools for debugging Redux state changes
- Redux Logger β Logger for Redux
- Redux Thunk β Redux middleware for asynchronous actions with Thunk
- React Helmet (Async) β Document head manager to enhance SEO
- CSS-in-JS β Pattern which CSS is composed using JavaScript
- Styled System β Style props for rapid UI development
- xstyled β Consistent theme based on Styled System for
styled-components
andemotion
- Emotion β Library designed for writing CSS styles with JavaScript
- Google Fonts β Library of free licensed font families
- Axios β Promise based HTTP client for the browser and Mode.js
- React Query β ...
- SWR β ...
- React-GA β React Google Analytics Module
react-snap
β Pre-renders a web app into static HTML- Sentry β Application monitoring and error tracking software
- LogRocket β Logging and Session Replay for JavaScript Apps
- JSON Web Token (JWT) β Compact URL-safe means of representing claims
jwt-decode
β Library that helps decoding JWT
dayjs
β Small immutable date time library alternative to Moment.js- React HTML Parser β Converts HTML strings directly into React components
- React Lazy Load Image Component β React Component to lazy load images and components using a HOC
- Draft.js β Rich Text Editor Framework for React
- Serve β Static website serving for local development
- ESLint β Pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript
- Netlify β All-in-one platform for automating modern web projects
- Cloudflare β Enterprise-grade authoritative DNS service
- Uniregistry β Retail domain name registrar
Alternative or future dependencies:
- Alternative of REST API:
- GraphQL API β Data query and manipulation language for APIs
- Apollo β Data graph platform to unify APIs, microservices, and databases with GraphQL
- GraphQL API β Data query and manipulation language for APIs
- Alternative of Maps API:
- Google Maps β Web mapping service developed by Google
- Mapbox β Mapping platform for custom designed maps
- D3.js β JavaScript library for producing dynamic, interactive data visualizations
- Cypress β JavaScript end-to-end testing framework
- Jest β Delightful JavaScript testing framework
- React Testing Library β Very light-weight solution for testing React components
- Sinon β Standalone test spies, stubs and mocks for JavaScript
- TypeScript β Typed JavaScript at application-scale JavaScript
- Redux Saga β Redux middleware for asynchronous actions or side effects with Saga
- Marked.js β Markdown parser and compiler
- New Relic β Single source of truth for infrastructure monitoring, APM agents, browser monitoring, and logging
- Docker β Virtualization to deliver software in packages called containers
- Docker Compose β Provides a way to document and configure all of the app service dependencies
Never be dependencies:
- Other non-JavaScript family languages
- Avoid Elm, ReasonML, and others. Template Web is scope limited to JavaScript or TypeScript ecosystem. For that other matters it's better to create different repositories.
- Other non-React libraries/frameworks
- Avoid Preact as some of the React features and integrations are missing
- Avoid jQuery and non-familiar ones
- Other non-Redux state management solutions
- Avoid Redux Toolkit as it is less flexible than plain Redux
- Avoid MobX and non-familiar ones
- High-level framework or wrapper for React
- Avoid Next.js and GatsbyJS because Template Web is focused on less magic and faster build time.
- The JWT is still just an
accessToken
, there's norefreshToken
yet. Also it should be saved inCookie
rather inlocalStorage
.
ποΈ Application Structure π
template-web
βββ LICENSE # License
βββ README.md # Documentation
βββ coverage # Test coverage files
βββ package.json # Node.js package configuration
βββ postinstall.sh # Script to be run after dependencies installation
βββ public
β βββ _redirects # Setup redirect index.html for static hosting like Netlify
β βββ assets # Various asset files
β βββ favicon.ico # Favicon
β βββ index.html # Primary HTML file for application root
β βββ manifest.json # Application manifest meta data
β βββ robots.txt # Rules for search engine crawlers
βββ src
β βββ App.js # Primary React application configuration
β βββ App.test.js # Test file for App.js
β βββ components # Stateless functional components or dumb components
β βββ containers # Stateful containers or smart components
β βββ data # JSON data files
β βββ index.js # Entry point for the React application
β βββ pages # Pages for React Router
β βββ redux # Files for Redux
β β βββ actions # Redux actions with thunks
β β βββ reducers # Redux reducers
β β βββ store.js # Redux store
β βββ serviceWorker.js # Setup Service Worker
β βββ setupTests.js # Setup Jest test suite
β βββ site.json # Metadata for the application
β βββ utils # Various utility functions
βββ yarn.lock # Lock version of dependencies
There are various dotfiles related to environment variables, Prettier, ESLint, and Git ignore.
π Getting Started π
Install dependencies using yarn
:
yarn
This will automatically run postinstall.sh
script which creates .env.*.local
files which also can be run with yarn postinstall
.
You should also install and run template-api
before continuing if you want to get real data from the API.
For development, edit .env.development.local
file:
REACT_APP_API_URL=http://localhost:3000
REACT_APP_GOOGLE_ANALYTICS_UA=UA-xxxxxxxxx-x
For production, edit .env.production.local
file:
REACT_APP_API_URL=https://api.example.com
REACT_APP_GOOGLE_ANALYTICS_UA=UA-xxxxxxxxx-x
yarn dev
# or
yarn start
Access the web app on http://localhost:8000.
yarn lint
To fix basic issues:
yarn lint --fix
yarn test
Watch for changes:
yarn test:watch
Generate coverage:
yarn test:coverage
yarn build
yarn serve
Access the built web app on http://localhost:5000.
- Setup a domain on Uniregistry.
- Setup name servers to connect the domain to Cloudflare.
- Setup application deployment with Netlify.
Build command:
yarn build
Publish directory:
build/
Environment variables:
REACT_APP_API_URL=https://api.example.com
REACT_APP_GOOGLE_ANALYTICS_UA=UA-xxxxxxxxx-x
π€ Authors π
π€ Contribution π
Contributions, issues, and feature requests are welcome!
π Support π
Give a βοΈ if this project helped or inspired you!
π License π
See LICENSE