chore: estructura inicial del MVP
Backend (Express + MariaDB) y frontend (React + Vite, identidad Fluent/Windows) con el nucleo funcional: seguridad, organizacion, proyectos, actividades, subtareas, dependencias, dashboard, calendario, gantt, comentarios, adjuntos, notificaciones in-app y catalogos. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
# Configuracion - project.linkedcorp.net
|
||||
|
||||
## Requisitos
|
||||
|
||||
- Node.js: 20.x LTS
|
||||
- npm: 10.x
|
||||
- MariaDB: servidor dev `192.168.222.20` (ya existe la BD `project_linkedcorp`)
|
||||
|
||||
## Variables principales
|
||||
|
||||
Usar `backend/.env.example` y `frontend/.env.example` como base.
|
||||
|
||||
- copiar `.env.example` -> `.env` en cada servicio
|
||||
- completar `.env` real antes de pruebas de conexión
|
||||
- leer la configuración desde `.env`
|
||||
- versionar `.env.example`; nunca versionar `.env`
|
||||
|
||||
`backend/.env`:
|
||||
|
||||
```env
|
||||
PORT=4019
|
||||
NODE_ENV=development
|
||||
|
||||
DB_HOST=192.168.222.20
|
||||
DB_PORT=3306
|
||||
DB_NAME=project_linkedcorp
|
||||
DB_USER=project_linkedcorp
|
||||
DB_PASSWORD=
|
||||
|
||||
JWT_SECRET=
|
||||
JWT_EXPIRES=8h
|
||||
|
||||
CORS_ORIGIN=http://localhost:5196
|
||||
|
||||
STORAGE_ROOT=./storage
|
||||
```
|
||||
|
||||
`frontend/.env`:
|
||||
|
||||
```env
|
||||
VITE_API_URL=/api
|
||||
```
|
||||
|
||||
## Setup local
|
||||
|
||||
### Backend
|
||||
|
||||
```bash
|
||||
cd backend
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Frontend
|
||||
|
||||
```bash
|
||||
cd frontend
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
**React + Vite — proxy de desarrollo y acceso desde el teléfono** (`frontend/vite.config.js`): en
|
||||
dev, el frontend reenvía `/api` al backend (evita CORS) y escucha en `0.0.0.0` para probar desde el
|
||||
celular. En producción, cada servicio corre por separado (arquetipo B): el frontend sirve su propio
|
||||
`dist` y el backend expone `/api`; NPM enruta `/api` al backend en el dominio público.
|
||||
|
||||
```js
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
port: 5196,
|
||||
strictPort: true,
|
||||
proxy: { '/api': 'http://localhost:4019' },
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
## Verificaciones
|
||||
|
||||
- Frontend responde en `5196` (`http://192.168.222.20x:5196` o `localhost:5196`).
|
||||
- Backend responde en `4019` (`curl http://localhost:4019/health`).
|
||||
- Conexión a base válida (`node -e "require('./src/config/db')" ` o el log de arranque del servidor).
|
||||
- `.env.example` alineado con el código (nuevas variables se agregan también ahí).
|
||||
Reference in New Issue
Block a user