Setup Chatvia Angular 18
Introduction
Chatvia is a featured premium chat app in Angular 18 with Firebase/Fack-backend authentication and developer-friendly codes.
Note:
You need to fill firebase credentials in
src/environments/environment.ts
and
src/environments/environment.prod.ts
file.
You have to create an authentication app from https://firebase.google.com
Firebase
Set defaultauth=firebase
in the
src/environments/environment.ts
file.
Also fill all the firebase credentials in the
src/environments/environment.ts
file.
export const environment = { production: false, defaultauth: 'firebase', // set this and below credentials firebaseConfig: { apiKey: '', authDomain: '', databaseURL: '', projectId: '', storageBucket: '', messagingSenderId: '', appId: '', measurementId: '' } };
Fack-Backend
Default we have set fack-backend authentication in this
template. You can simply change to firebase or fack-backend by
changing in src/environments/environments.ts
file
and for production
src/environments/environments.prod.ts
file.
Multilingual translation settings
How to add new language?
Let's add French language in the existing language.
-
Create fr.json file with reference to default language file
and add it to
src/assets/i18n
folder. - Go to app.component.ts file and add i18n language short
form "fr" to languages array.
export class AppComponent {
constructor(public translate: TranslateService) {
translate.addLangs(['en', 'es', 'it', 'ru', 'de', "fr"]);
}
} - In topbar.component.ts add new language properties in
listLang array and make sure to add flag image in the assets
folder.
listLang = [
{ text: 'English', flag: 'assets/images/flags/us.jpg', lang: 'en' },
{ text: 'Spanish', flag: 'assets/images/flags/spain.jpg', lang: 'es' },
{ text: 'German', flag: 'assets/images/flags/germany.jpg', lang: 'de' },
{ text: 'Italian', flag: 'assets/images/flags/italy.jpg', lang: 'it' },
{ text: 'Russian', flag: 'assets/images/flags/russia.jpg', lang: 'ru' },
{ text: 'French', flag: 'assets/images/flags/french.jpg', lang: 'fr' },
];
Prerequisites
Please follow below steps to install and setup all prerequisites:
-
NPM
Make sure to have the NPM installed & running in your computer. If you already have installed NPM on your computer, you can skip this step.
-
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 greater than 18.
-
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 |
---|---|
ng serve
|
Runs the project locally, starts the development server and watches for any changes in your code. The development server is accessible at http://localhost:4200. |
ng build
|
Generates a /dist directory with all
the development files.
|
ng build --prod
|
Generates a /dist directory with all
the production files.
|
Tips
SCSS: We suggest you to do not change any scss files from the src/assets/scss/custom folders because to get new updates will might be break your SCSS changes if any you have made. We strongly suggest you to use custom.scss file and use that instead of overwrite any theme's custom scss files.