This project is a modernization of the previous weather_app
repository, utilizing a more modern tech stack. The frontend has been upgraded to use Vue 3 with Vuetify for the UI components and Pinia for state management. The backend has been refactored to use Nest.js with MongoDB.
-
Frontend:
-
Backend:
The project is divided into two main directories:
- frontend/: Contains the Vue 3 application, including components, stores, and services for interacting with the backend.
- backend/: Contains the Nest.js server, including routes, controllers, services, Web Socket and database models.
To set up the project using Docker, follow these steps:
-
Clone the Repository:
git clone <repository_url> cd <project_directory>
-
cd backend
-
cp .env_sample .env
-
Fill in the Environment Variables: Edit the .env file and fill in the necessary values for MongoDB connection, ports, and any other required settings.
-
Build and Run the Containers: Execute the following command to build and start the containers:
docker-compose up -d --build
-
Retrieve a Weather API key from https://api.weatherapi.com and fill the WEATHER_API_KEY in the .env
-
Install Dependencies and Start the Node Server: After the containers are running, execute the following command to install npm packages inside the Node container and start the server:
docker exec -it weather_nest npm install docker exec -it weather_nest npm run start
-
Access the Application:
- Nest.js API: http://localhost:8085
- Mongo Express: http://localhost:8081
To set up the project without using Docker, follow these steps:
-
Clone the Repository:
git clone <repository_url> cd <project_directory>
-
cd backend
-
cp .env_sample .env
-
Fill in the Environment Variables: Edit the .env file and fill in the necessary values for MongoDB connection, ports, and any other required settings.
-
Install Dependencies: Ensure you have Node.js and MongoDB installed. Run the following command to install the necessary packages:
npm install
-
Run MongoDB: Start the MongoDB service. Ensure it's running and accessible.
-
Retrieve a Weather API key from https://api.weatherapi.com and fill the WEATHER_API_KEY in the .env
-
Start the Node.js Application: Run the following command to start the server:
npm run start
-
Access the Application:
- Node.js API: http://localhost:8085