Skip to content

code-matter/ReacteD

Repository files navigation

This project was bootstrapped with Create Next App, using the TypeScript template.

Walkthrough

Setup

Versions used

  • Node : 16.18.1
  • Yarn : 1.22.19
  • Next : 13.1.5

Starting the app

  • Clone this repo
  • Run yarn install
    Install the dependecies locally.
  • Run yarn dev
    Starts the app in development mode.

Building the app

  • Run yarn build
    Builds the app for production to the build folder.

Learn More

You can learn more in the NextJS Documentation.

References

About the code

Key dependecies :

  • next-i18n
  • Zustand
  • SASS
  • Ant Design
  • Cypress

Code Style

Prettier + Lint rules are defined at the project's root.

All imports in the Next App should be absolute (with the src/ folder as the base for all imports). See tsconfig.json.

Services are used to group all the interractions between the front-end and the back-end. When using services functions, make sure you have a basic error handling mechanism set in place.

To simplify imports, when creating a new component, please add its reference in the components/index.ts file. After, you can easily import any component with :

import { Component } from 'components'

The same should apply to pages, utilities functions and services.

Translations

i18n is used to handle all the translations of the app. The basic setup is done in src/next-i18next.config.js.

The locales files (containing the actual translations) are stored in the public/locales/{"en"|"fr"}/common.json.

To access the translations in the React App, see the useTranslation hook documentation.

There is a component (<IntlBtn>) already implemented to handle the switch between languages. It also changes the locales for dayjs and Ant Design.

Stores

Zustand is used to handle the data in the store. You cand find more information on their documentation

The store is configured in the src/store/{slice}.ts file. Each slice handle a specific data key in the store (UserSlice = state.user). See the configuration file and the documentation for more informations.

Forms

Insted of implementing a validation logic for each form, please refer to Ant Design's Form Component.

Assets

The src/assets/ folder contains all the assets for the app :

  • Images
  • Scripts
  • Styles

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages