Execute npx create-next-app@latest
with support for NPM, TypeScript in the current directory (so you should first create a repo, clone locally, and run this command inside this repo).
This will:
- install all basic packages for code linting and styling (by fixing the eslint plugin used by default by Next and installing prettier).
- add husky and lint-staged in order to clean the code before committing to the repo.
- add the AppHead component
- add the GeNYG config file .genyg.json
It will install all MUI related dependencies, that is:
- MUI core
- MUI icons
- react-hook-form
- yup validation support
- _form basic components based on MUI and react-hook-form
It installs everything needed to add an SPA page into the Next application.
In particular it will install:
- react-router-dom libs
- redux libs plus plugins
- axios for ajax support
It creates a new model inside ./models/server
or ./models/client
folder, depending on the usage of the model, client if it is supposed to run in the frontend in React, server if it supposed to run in the backend with NodeJS.
Having different folders and files (even to represent the same entity) from backend and frontend avoids issues when loading browser-related code in the backend code, or file-system-related code in the frontend.
It creates a new scene for the specified SPA.
It creates a new page with a hook file [WIP]
It creates a new component with a hook file [WIP]
- Add support for mocked HTTP calls in order to test APIs
- It should support more envs (at least locale, test, staging and production ones)
- It should create a new model inside
./models/server
folder with the mongoDB model template
- It should allow creating dynamic routes (both single
[param]
and multiple[[params]]
- It should create static NextJS methods like getStaticProps or getStaticPaths
- It should allow selecting also subfolders of ./components and ./pages
- It should allow creating an AJAX function.\
- It should copy mongo db libraries inside the
lib
folder - It should install mongodb dependencies to the package json
- It should also add mongo env vars to the env files
- It should allow to create a new API starting from a route and a method
- It should create a new subfolder in the
./endpoints
folder with the API files inside - It should connect this endpoint function to the Next
./api
folder and its configuration files
- It should add all the backend library files inside the
./lib
folder - It should add all fe and be dependencies to the package json
- It should copy the CognitoAuthManager model to the
./models/client
folder - It should add all the required env vars to all env files
- It should add i18next and react-i18next dependencies
- It should add i18n as next config options
- It should add
./translations
folder with templates and setup files - It should add the Language models and LanguageSelector component