Setup React
Introduction
Minia is a fully
featured premium
admin dashboard
template in ReactJs
with Redux
Hooks With
Typescript
with Firebase/fake-backend
with Google and
Facebook
authentication
and
developer-friendly
codes.
Note:
You need to fill
firebase credentials
and Social
( Google / Facebook
) credentials
in the .env
file.
Firebase
Set
REACT_APP_DEFAULTAUTH=firebase
in the
.env
file.
Also fill all the
firebase credentials
in the .env
file.
Remove the
fake-backend setup
code from the App.tsx
Now just uncomment
the below firebase
setup code in the
App.tsx
file.
// Import Firebase Configuration file
import { initFirebaseBackend } from "./helpers/firebase_helper";
//api config
// import config from "./config";
const firebaseConfig = {
apiKey: process.env.REACT_APP_APIKEY,
authDomain: process.env.REACT_APP_AUTHDOMAIN,
databaseURL: process.env.REACT_APP_DATABASEURL,
projectId: process.env.REACT_APP_PROJECTID,
storageBucket: process.env.REACT_APP_STORAGEBUCKET,
messagingSenderId: process.env.REACT_APP_MESSAGINGSENDERID,
appId: process.env.REACT_APP_APPID,
measurementId: process.env.REACT_APP_MEASUREMENTID,
};
// init firebase backend
// initFirebaseBackend(config["firebase"]);
Fake-Backend
Set
REACT_APP_DEFAULTAUTH=fake
in the
.env
file.
Remove the firebase
setup code from the
App.tsx
file.
Now just uncomment
the below
fake-backend setup
code in the App.tsx
file.
import fakeBackend from "./helpers/AuthType/fakeBackend" // Activating fake backend fakeBackend();
i18n Language translation settings
How to add new language? Lets add French language in the existing language.
- Create a new
file
src/locales/fr/translation.json - update the
below code in
the
src/i18n.tsfile
import translationFr from './locales/fr/translation.json'; const resources : any = { fr: { translation: translationFr } }; -
Now add the new
option of French
language in the
topbar language
dropdown menu
src/components/CommonForBoth/TopbarDropdown/LanguageDropdown.tsx -
You must have to
write all text
like {props.t('Search_keyword')}
to make it
working with all
languages. Also
make sure to add
new words in all
other language
files
src/locales/{language}/translation.json. -
To change
default language
to german?
update below
code in the
src/i18n.tsfile
i18n .use(detector) .use(reactI18nextModule) // passes i18n down to react-i18next .init({ resources, lng: "fr", fallbackLng: "fr", // use en if detected lng is not available keySeparator: false, // we do not use keys in form messages.welcome interpolation: { escapeValue: false // react already safes from xss } });
Prerequisites
Please follow below steps to install and setup all prerequisites:
-
Nodejs
Make sure to have the Node.js installed & running in your computer. If you already have installed Node on your computer, you can skip this step if your existing node version is 20 or greater.
-
Git
Make sure to have the Git installed globally & running on your computer. If you already have installed git on your computer, you can skip this step.
Installation
To setup the admin theme, follow below-mentioned steps:
-
Install
Prerequisites
Make sure to have all above prerequisites installed & running on your computer
After you finished with the above steps, you can run the following commands into the terminal / command prompt from the root directory of the project to run the project locally or build for production use:
| Command | Description |
|---|---|
yarn
install / npm install
|
This
would
install
all the
required
dependencies
in
the
node_modules
folder.
|
yarn
start / npm start
|
Runs the project locally, starts the development server and watches for any changes in your code. The development server is accessible at http://localhost:3000. |
yarn
build / npm run build
|
Generates
a /build
directory
with all
the
production
files.
|
Tips
SCSS: We suggest you
to do not change any
scss files from the
src/assets/scss/theme.scss
folders because to
get new updates will
might be break your
SCSS changes if any
you have made. We
strongly suggest you
to use theme.scss
file and use that
instead of overwrite
any theme's custom
scss files.
Social Authentication
Set the social credentials in the
.envfile and also check code insrc/pages/Authentication/Login.tsxfile.