The provided text seems to be a set of instructions for setting up and running a Node.js and Angular project. It includes steps for setting up the backend service using grpc and Sequelize, as well as the frontend service using Angular.
The project is an ibasis interview project that allows users to log in and view weather reports using the OpenWeatherMap API.
Here's a summary of the steps to run the project:
-
Set Environment Variables: Create a
.envfile inside ofgrpc-projectdirectory and add the required environment variables, including the database connection details and the OpenWeatherMap API key.- NODE_ENV = "development"
- DB_HOST = ""
- DB_USER = ""
- DB_PASSWORD = ""
- DB_NAME = ""
- DB_PORT = ""
- API_KEY = ""// Go to "https://home.openweathermap.org/api_keys" this website and create your own apikey, It's free.
Note: Without API key it wont work.
-
Backend Service:
- Navigate to the
grpc-projectdirectory. - Install dependencies by running
npm install. - Install the Sequelize CLI globally using
npm install -g sequelize-cli. - Run database migrations using
sequelize-cli db:migrate. - Seed the database using
sequelize-cli db:seed:all. - Start the backend server and service using
npm run start:serverandnpm run start:service, respectively. - To run unit tests, use
npm test.
- Navigate to the
-
Frontend Service:
- Navigate to the
weather-report-uidirectory. - Install dependencies by running
npm install. - Start the frontend server using
ng serve.
- Navigate to the
-
Login:
-
Use the provided usernames and passwords to log in as User 1 or User 2.
-
User - 1
-
username - ragh
-
password - testuser
-
User - 2
-
username - raghav
-
password - testpassword
-
-
Rollback (Optional):
- If needed, you can perform a rollback of the database migrations using
sequelize-cli db:migrate:undoto revert the most recent migration, orsequelize-cli db:migrate:undo:allto revert all migrations.
- If needed, you can perform a rollback of the database migrations using
Please ensure you have all the required dependencies and environment variables set up correctly before running the project. Follow the steps mentioned in the instructions carefully to run the backend and frontend services.