feat: initialize frontend with React, Vite, and Tailwind CSS

- Added package.json for project dependencies and scripts.
- Configured PostCSS with Tailwind CSS.
- Created main application structure with App component and routing.
- Implemented API client for handling requests with Axios.
- Developed authentication API for login, logout, and user verification.
- Created entities API for managing virtual entities.
- Implemented logs API for fetching dispatch logs.
- Added navigation bar component for app navigation.
- Created protected route component for route guarding.
- Set up global CSS with Tailwind directives.
- Configured main entry point for React application.
- Developed basic Dashboard and Login pages.
- Set up router for application navigation.
- Added Jest testing setup for testing library.
- Configured Tailwind CSS with content paths.
- Set TypeScript configuration for frontend.
- Created Vite configuration for development and production builds.
- Added Nginx configuration for serving the application and proxying API requests.
This commit is contained in:
2026-03-26 15:04:12 -03:00
parent fa6731de98
commit ca2e645f02
47 changed files with 7215 additions and 5 deletions

23
docker/entrypoint.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
set -e
# ── Initialise PostgreSQL data directory on first run ─────────────────────────
if [ ! -f /var/lib/postgresql/data/PG_VERSION ]; then
echo "Initialising PostgreSQL data directory..."
su -c "/usr/lib/postgresql/16/bin/initdb -D /var/lib/postgresql/data --encoding=UTF8 --locale=C" postgres
# Start postgres temporarily to create the app database and user
su -c "/usr/lib/postgresql/16/bin/pg_ctl -D /var/lib/postgresql/data -w start" postgres
su -c "psql -c \"CREATE USER condado WITH PASSWORD 'condado';\"" postgres
su -c "psql -c \"CREATE DATABASE condado OWNER condado;\"" postgres
su -c "/usr/lib/postgresql/16/bin/pg_ctl -D /var/lib/postgresql/data -w stop" postgres
echo "PostgreSQL initialised."
fi
# ── Ensure supervisor log directory exists ────────────────────────────────────
mkdir -p /var/log/supervisor
# ── Start all services via supervisord ───────────────────────────────────────
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf

28
docker/supervisord.conf Normal file
View File

@@ -0,0 +1,28 @@
[supervisord]
nodaemon=true
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid
[program:postgres]
command=/usr/lib/postgresql/16/bin/postgres -D /var/lib/postgresql/data
user=postgres
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/postgres.log
stderr_logfile=/var/log/supervisor/postgres.err.log
[program:backend]
command=java -jar /app/app.jar
environment=SPRING_DATASOURCE_URL="jdbc:postgresql://localhost:5432/condado",SPRING_DATASOURCE_USERNAME="condado",SPRING_DATASOURCE_PASSWORD="condado"
autostart=true
autorestart=true
startsecs=15
stdout_logfile=/var/log/supervisor/backend.log
stderr_logfile=/var/log/supervisor/backend.err.log
[program:nginx]
command=/usr/sbin/nginx -g "daemon off;"
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/nginx.log
stderr_logfile=/var/log/supervisor/nginx.err.log