InfraHub
Web-enabled Smart Infrastructure Control Center
Setup Instructions
Prerequisites
-
Install Docker and Docker Compose on your machine:
- Docker installation guide: https://docs.docker.com/get-docker/
- Docker Compose installation guide: https://docs.docker.com/compose/install/
-
Prepare Yandex Cloud (or any other CI/CD platform) for deployment and ensure you have access credentials set up.
-
Install Git if not already installed:
sudo apt-get install git
Step-by-step Installation
1. Clone the Repository
First, clone the project repository to your local machine:
git clone https://github.com/yourusername/smart-infra-control-center.gitcd smart-infra-control-center
2. Configure the Environment
Navigate to the backend directory and create the environment file:
cd backendcp .env.example .env
Edit the
file to set the appropriate configurations, such as database details, API keys, etc. Then generate an application key for Laravel:
php artisan key:generate
3. Build and Run Docker Containers
Ensure that Docker is running on your machine, then build and start all services using Docker Compose:
docker-compose up -d --build
4. Accessing the Application
- Frontend (Next.js): Open http://localhost:3000 in your browser.
- Backend API (Laravel): Available at http://localhost:8000/api.
- Prometheus: Access monitoring at http://localhost:9090.
- Grafana: View monitoring dashboards at http://localhost:3001.
CI/CD Setup
- Update the
file with your Docker registry details and adjust it according to your CI/CD platform.ci-cd/pipeline.yml - Ensure that the CI/CD pipeline can securely access your Yandex Cloud credentials for deployment.
- Set up automatic deployments by configuring your CI/CD service to trigger builds and deployments upon changes to the repository.
Security Considerations
- Always use secure passwords and manage sensitive data via environment variables.
- Ensure that only authorized users have access to the production environment.
- In production, configure HTTPS for secure communication.