Installation and Configuration - chrisdacel/Backend_EcoRisaralda GitHub Wiki

Prerequisites

  • PHP >= 8.x
  • Composer
  • Node.js
  • MySQL
  • XAMPP or similar environment

Installation and Configuration

Follow the steps below to run the project in your local environment.

Initial Structure

Create a main folder containing:

project/
├── backend/
└── frontend/

Backend Installation

  1. Navigate to the backend folder:

cd backend

  1. Clone the repository:

git clone https://github.com/CrisMonsalve348/Conexion-EcoRisaralda.git

  1. Enter the project folder:

cd Conexion-EcoRisaralda

  1. Install PHP dependencies:

composer install

  1. Install Node dependencies (interactive map):

npm install

Environment Configuration (.env)

  1. Create the .env file:
  • Copy the content from .env.example
  • Paste it into a new file named .env

Backend Environment Variables

Application

APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

ASSET_URL=http://localhost

FRONTEND_URL=http://localhost:5173

FRONTEND_URL_ALT=http://127.0.0.1:5173


Variable Description
APP_NAME Project name
APP_ENV Environment (local, production)
APP_KEY Security key (generated with artisan)
APP_DEBUG Displays errors in development
APP_URL Backend URL
ASSET_URL Assets URL
FRONTEND_URL Main frontend URL
FRONTEND_URL_ALT Alternative URL

Localization

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US

Variable Description
APP_LOCALE Main language
APP_FALLBACK_LOCALE Fallback language
APP_FAKER_LOCALE Fake data language

Maintenance

APP_MAINTENANCE_DRIVER=file


Variable Description
APP_MAINTENANCE_DRIVER Maintenance mode control

Security

BCRYPT_ROUNDS=12


Variable Description
BCRYPT_ROUNDS Encryption level

Logs

LOG_CHANNEL=stack
LOG_STACK=single
LOG_LEVEL=debug

Variable Description
LOG_CHANNEL Log channel
LOG_STACK Storage type
LOG_LEVEL Detail level

Database

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=conexion_ecorisaralda
DB_USERNAME=root
DB_PASSWORD=

Variable Description
DB_CONNECTION Database type (mysql, sqlite)
DB_HOST Server
DB_PORT Port
DB_DATABASE Database name
DB_USERNAME Username
DB_PASSWORD Password

Sessions

SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null
SESSION_SECURE_COOKIE=true

Variable Description
SESSION_DRIVER Session type
SESSION_LIFETIME Duration
SESSION_ENCRYPT Encryption
SESSION_PATH Path
SESSION_DOMAIN Domain
SESSION_SECURE_COOKIE Cookie security

System

BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database
CACHE_STORE=database

Variable Description
BROADCAST_CONNECTION Events
FILESYSTEM_DISK Files
QUEUE_CONNECTION Queue
CACHE_STORE Cache

Redis / Memcached

MEMCACHED_HOST=127.0.0.1

REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

Variable Description
REDIS_HOST Redis server
REDIS_PORT Port
MEMCACHED_HOST Memcached server

Mail

MAIL_MAILER=log
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_FROM_ADDRESS="[email protected]
"
MAIL_FROM_NAME="${APP_NAME}"

Variable Description
MAIL_MAILER Mail driver
MAIL_HOST Server
MAIL_PORT Port
MAIL_USERNAME Username
MAIL_PASSWORD Password
MAIL_FROM_ADDRESS Sender email
MAIL_FROM_NAME Sender name

AWS (Optional)

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

Variable Description
AWS_ACCESS_KEY_ID AWS key
AWS_SECRET_ACCESS_KEY Secret key
AWS_BUCKET Storage

Vite

VITE_APP_NAME="${APP_NAME}"


Variable Description
VITE_APP_NAME Frontend app name

Generate application key

php artisan key:generate

Database configuration

Create a MySQL database, for example:

conexion_ecorisaralda

Run migrations:

php artisan migrate:fresh --seed

Run Backend

php artisan serve

Frontend Installation

Navigate to the folder:

cd frontend

Clone the repository:

git clone https://github.com/chrisdacel/FrontEndEcoturismo.git

Enter the project:

cd FrontEndEcoturismo

Install dependencies:

npm install

Frontend Configuration (.env)

Create a .env file in the frontend:

VITE_API_URL=http://localhost:8000/api


Variable Description
VITE_API_URL Backend URL

Run Frontend

npm run dev

System Access

http://localhost:5173/