-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit abcbf6f
Showing
67 changed files
with
11,790 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml,yaml}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
APP_NAME=Lumen | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_DEBUG=true | ||
APP_URL=http://localhost | ||
APP_TIMEZONE=UTC | ||
|
||
LOG_CHANNEL=stack | ||
LOG_SLACK_WEBHOOK_URL= | ||
|
||
DB_CONNECTION=pgsql | ||
DB_HOST=bid_local_db | ||
DB_PORT=5432 | ||
DB_DATABASE=bid_local_db | ||
DB_USERNAME=bid_user | ||
DB_PASSWORD=123456 | ||
|
||
CACHE_DRIVER=file | ||
QUEUE_CONNECTION=sync | ||
|
||
JWT_SECRET=supermegaultrasecretjwtkey1234567890 | ||
JWT_TTL=60 | ||
JWT_REFRESH_TTL=20160 | ||
JWT_BLACKLIST_ENABLED=true | ||
JWT_BLACKLIST_GRACE_PERIOD=60 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
APP_NAME=Lumen | ||
APP_ENV=testing | ||
APP_KEY= | ||
APP_DEBUG=true | ||
APP_URL=http://localhost | ||
APP_TIMEZONE=UTC | ||
|
||
LOG_CHANNEL=stack | ||
LOG_SLACK_WEBHOOK_URL= | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=homestead | ||
DB_USERNAME=homestead | ||
DB_PASSWORD=secret | ||
|
||
CACHE_DRIVER=file | ||
QUEUE_CONNECTION=sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/vendor | ||
/.idea | ||
Homestead.json | ||
Homestead.yaml | ||
.env | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
php: | ||
preset: laravel | ||
disabled: | ||
- unused_use | ||
js: true | ||
css: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Etapa base para configuraciones comunes de PHP y Nginx | ||
FROM php:8.1-fpm-alpine AS base | ||
|
||
ENV MY_PROJECT_ROOT /var/www/html | ||
|
||
# Instalar Nginx y configurar PHP | ||
RUN apk update && \ | ||
apk add --no-cache nginx && \ | ||
docker-php-ext-install pdo_mysql && \ | ||
rm -rf /var/cache/apk/* # Limpia el caché | ||
|
||
# Configurar Nginx | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY default.conf /etc/nginx/conf.d/default.conf | ||
|
||
# Crear y preparar directorios necesarios con los permisos adecuados | ||
RUN mkdir -p /var/www/html/storage/logs \ | ||
/var/lib/nginx/tmp/client_body \ | ||
/var/lib/nginx/logs && \ | ||
chown -R nginx:nginx /var/lib/nginx/logs /var/lib/nginx/tmp | ||
|
||
WORKDIR $MY_PROJECT_ROOT | ||
|
||
# Copiar el script de entrada y configurarlo | ||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
|
||
# Exponer los puertos necesarios | ||
EXPOSE 80 | ||
|
||
# Etapa de desarrollo con herramientas adicionales como Git y Composer | ||
FROM base AS dev | ||
|
||
RUN apk update && \ | ||
apk add --no-cache git curl && \ | ||
rm -rf /var/cache/apk/* # Limpia el caché | ||
COPY --from=composer:2.6.6 /usr/bin/composer /usr/local/bin/composer | ||
|
||
# Etapa de compilación para instalar dependencias de Composer | ||
FROM dev AS compile | ||
|
||
# Copiar el código fuente de la aplicación y archivos de configuración | ||
COPY . . | ||
|
||
# Instalar dependencias de Composer (Ajustar según sea necesario para entornos de producción) | ||
RUN composer install --no-interaction --no-progress --optimize-autoloader | ||
|
||
# Etapa final para despliegue | ||
FROM base AS deploy | ||
|
||
# Copiar el código compilado de la etapa anterior | ||
COPY --from=compile $MY_PROJECT_ROOT . | ||
|
||
# Establecer el script de entrada como comando por defecto | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# 🐾 PetFinder - Plataforma para Mascotas Perdidas y Adopción | ||
|
||
PetFinder es una plataforma en línea que permite a los usuarios publicar y buscar información sobre mascotas perdidas o disponibles para adopción. El objetivo principal es facilitar la reunificación de mascotas perdidas con sus dueños y promover la adopción de animales sin hogar. | ||
|
||
## 🌟 Características Principales | ||
|
||
1. **🙍♂️ Registro de usuarios y perfiles** | ||
- Los usuarios pueden crear cuentas y perfiles personalizados | ||
- Los perfiles incluyen información de contacto y ubicación | ||
|
||
2. **📢 Publicación de mascotas perdidas** | ||
- Los usuarios pueden crear publicaciones con detalles de la mascota perdida (descripción, fotos, ubicación, etc.) | ||
- Las publicaciones se pueden compartir en redes sociales para aumentar su visibilidad | ||
|
||
3. **🐶 Publicación de mascotas en adopción** | ||
- Las organizaciones y usuarios pueden crear perfiles de mascotas disponibles para adopción | ||
- Los perfiles incluyen información detallada sobre la mascota (raza, edad, personalidad, requisitos de adopción, etc.) | ||
|
||
4. **🔍 Búsqueda y filtrado** | ||
- Los usuarios pueden buscar mascotas perdidas o en adopción por ubicación, raza, tamaño, color, etc. | ||
- Los resultados de búsqueda se pueden ordenar por relevancia o fecha | ||
|
||
5. **💬 Sistema de mensajería** | ||
- Los usuarios pueden comunicarse entre sí a través de un sistema de mensajería integrado | ||
- Las organizaciones pueden recibir consultas sobre mascotas en adopción | ||
|
||
6. **🔔 Notificaciones y alertas** | ||
- Los usuarios pueden recibir notificaciones sobre mascotas perdidas en su área | ||
- Las alertas se envían por correo electrónico o notificaciones push | ||
|
||
7. **🗺️ Integración de mapas** | ||
- Las publicaciones de mascotas perdidas y en adopción se muestran en un mapa interactivo | ||
- Los usuarios pueden ver mascotas cercanas a su ubicación | ||
|
||
8. **✅ Sistema de verificación** | ||
- Las organizaciones de adopción pueden verificar su legitimidad | ||
- Los usuarios pueden reportar publicaciones sospechosas o fraudulentas | ||
|
||
9. **📚 Recursos y educación** | ||
- La plataforma incluye artículos y recursos sobre el cuidado de mascotas, la prevención de pérdidas y el proceso de adopción | ||
- Se proporcionan consejos para ayudar a las mascotas perdidas a regresar a casa | ||
|
||
10. **💕 Historias de éxito** | ||
- Los usuarios pueden compartir historias de mascotas perdidas reunidas o adoptadas exitosamente | ||
- Estas historias inspiran y motivan a otros usuarios | ||
|
||
## 🛠️ Tecnologías Utilizadas | ||
|
||
- **[React.js](https://reactjs.org/)**: Biblioteca de JavaScript para construir interfaces de usuario interactivas. | ||
- **[Lumen](https://lumen.laravel.com/)**: Un micro-framework PHP ligero y rápido basado en Laravel. | ||
- **[MySQL](https://www.mysql.com/)**: Sistema de gestión de bases de datos relacional. | ||
- **[Nginx](https://www.nginx.com/)**: Servidor web y proxy inverso. | ||
- **Docker**: Para la contenerización y fácil despliegue. | ||
- **Swagger**: Para la documentación interactiva de la API. | ||
|
||
## 📂 Repositorio | ||
|
||
El código fuente está disponible en [GitHub](https://github.com/tu-usuario/pet-finder). | ||
|
||
## 📋 Requisitos | ||
|
||
- Node.js y npm para el front-end | ||
- PHP ^8.1 para el back-end | ||
- Docker y Docker Compose para el despliegue | ||
|
||
## 🚀 Instalación y Configuración | ||
|
||
1. Clonar el repositorio: `git clone https://github.com/tu-usuario/pet-finder.git`. | ||
2. Navegar al directorio del proyecto: `cd pet-finder`. | ||
3. Configurar las variables de entorno en los archivos `.env` para el front-end y el back-end. | ||
4. Ejecutar `docker-compose up -d` para iniciar los contenedores. Esto iniciará los servicios de React, Lumen, MySQL y Nginx. | ||
|
||
## 📘 Documentación API | ||
|
||
La documentación interactiva de la API generada por Swagger estará disponible en `http://localhost:9002/api/documentation` una vez que hayas iniciado los contenedores. Esta documentación proporciona detalles completos sobre los endpoints disponibles y su uso. | ||
|
||
## 🔄 Regeneración de la Documentación de la API | ||
|
||
Si realizas cambios en la API que requieran una actualización de la documentación, puedes regenerar la documentación de Swagger de forma automática. Para hacerlo, ejecuta los siguientes comandos: | ||
|
||
```bash | ||
# Para regenerar la documentación de Swagger | ||
sh doc.sh | ||
|
||
# Para ejecutar comandos de Artisan (por ejemplo, make:migration) | ||
sh artisan.sh make:migration test |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace App\Console; | ||
|
||
use Illuminate\Console\Scheduling\Schedule; | ||
use Laravel\Lumen\Console\Kernel as ConsoleKernel; | ||
|
||
class Kernel extends ConsoleKernel | ||
{ | ||
/** | ||
* The Artisan commands provided by your application. | ||
* | ||
* @var array | ||
*/ | ||
protected $commands = [ | ||
// | ||
]; | ||
|
||
/** | ||
* Define the application's command schedule. | ||
* | ||
* @param \Illuminate\Console\Scheduling\Schedule $schedule | ||
* @return void | ||
*/ | ||
protected function schedule(Schedule $schedule) | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace App\Events; | ||
|
||
use Illuminate\Queue\SerializesModels; | ||
|
||
abstract class Event | ||
{ | ||
use SerializesModels; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace App\Events; | ||
|
||
class ExampleEvent extends Event | ||
{ | ||
/** | ||
* Create a new event instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace App\Exceptions; | ||
|
||
use Illuminate\Auth\Access\AuthorizationException; | ||
use Illuminate\Database\Eloquent\ModelNotFoundException; | ||
use Illuminate\Validation\ValidationException; | ||
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler; | ||
use Symfony\Component\HttpKernel\Exception\HttpException; | ||
use Throwable; | ||
|
||
class Handler extends ExceptionHandler | ||
{ | ||
/** | ||
* A list of the exception types that should not be reported. | ||
* | ||
* @var array | ||
*/ | ||
protected $dontReport = [ | ||
AuthorizationException::class, | ||
HttpException::class, | ||
ModelNotFoundException::class, | ||
ValidationException::class, | ||
]; | ||
|
||
/** | ||
* Report or log an exception. | ||
* | ||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc. | ||
* | ||
* @param \Throwable $exception | ||
* @return void | ||
* | ||
* @throws \Exception | ||
*/ | ||
public function report(Throwable $exception) | ||
{ | ||
parent::report($exception); | ||
} | ||
|
||
/** | ||
* Render an exception into an HTTP response. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \Throwable $exception | ||
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse | ||
* | ||
* @throws \Throwable | ||
*/ | ||
public function render($request, Throwable $exception) | ||
{ | ||
if ($exception instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException) { | ||
return response()->json(['error' => 'Ruta no encontrada o parámetro faltante'], 404); | ||
} | ||
|
||
return parent::render($request, $exception); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Laravel\Lumen\Routing\Controller as BaseController; | ||
|
||
class Controller extends BaseController | ||
{ | ||
// | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
class ExampleController extends Controller | ||
{ | ||
/** | ||
* Create a new controller instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
// | ||
} | ||
|
||
// | ||
} |
Oops, something went wrong.