This is a recovered legacy challenge repository. The frontend was originally built with Create React App and has been migrated to Vite as part of the recovery work, mainly to remove the deprecated react-scripts dependency and clean up security warnings from its transitive dependency tree.
The project is still being modernized incrementally. It now includes a Vite frontend and a TypeScript backend API.
The frontend lives in front/ and is a React application powered by Vite.
- React 18
- Vite
- Chakra UI
- React Router
- Axios
From the repository root:
cd front
pnpm install
pnpm run devThe app runs at:
http://localhost:3000cd front
pnpm run buildcd front
pnpm run previewThis frontend used to depend on Create React App through react-scripts. It was migrated to Vite to make the project easier to maintain and to remove deprecated tooling.
Relevant changes made during the migration:
- Removed
react-scripts. - Added
viteand@vitejs/plugin-react. - Moved the app entry HTML to
front/index.html. - Added
front/vite.config.js. - Kept the development server on port
3000. - Added a Vite proxy for backend API calls to
http://localhost:8080. - Replaced the old CRA runtime assumptions with Vite-compatible setup.
The frontend currently exposes:
/
/test/:idInvalid routes render a not found state.
The frontend expects a backend running locally at:
http://localhost:8080During development, Vite proxies frontend requests from /api to that backend.
The main endpoint currently used by the frontend is:
GET /api/clientes
GET /api/clientes/:idThe backend lives in back/ and exposes the API consumed by the frontend.
- Node.js
- Express
- TypeScript
- Prisma
- SQLite
- dotenvx
Create a local .env file inside back/ using .env.example as a guide:
cd back
cp .env.example .envFor local development, a typical .env looks like:
DATABASE_URL=file:./prisma.sqlite
PORT=8080
NODE_ENV=developmentThe SQLite database file is local-only and ignored by Git.
cd back
pnpm installWhen running the project for the first time, create and populate the local SQLite database before starting the API:
cd back
pnpm run db:push
pnpm run seed
pnpm run devWhat each command does:
pnpm run db:push -> Creates/synchronizes the SQLite schema from Prisma.
pnpm run seed -> Inserts the mock test data into the database.
pnpm run dev -> Starts the API server.If db:push or seed are skipped, requests such as:
GET /api/clientes
GET /api/clientes/:idmay fail because the required tables or mock data do not exist yet.
The backend uses mock test data from back/mocks/test.ts.
Before seeding a fresh SQLite database, sync the Prisma schema:
cd back
pnpm run db:pushcd back
pnpm run seedThis inserts the mock tests into the local SQLite database.
cd back
pnpm run devThe API runs at:
http://localhost:8080The dev command uses dotenvx to load .env and Node watch mode with ts-node/register.
Start the backend first:
cd back
pnpm run devThen start the frontend in a separate terminal:
cd front
pnpm run devFrontend:
http://localhost:3000Backend:
http://localhost:8080The Prisma schema lives in:
back/prisma/schema.prismaThe current model is Cliente. Its id is an auto-incrementing number, so seeded records can be fetched with numeric IDs like /api/clientes/1.
cd back
pnpm run buildcd back
pnpm startpnpm run dev
pnpm run build
pnpm start
pnpm run seed
pnpm run db:push
pnpm run generate
pnpm run lint
pnpm run format:checkGET /api/clientes
GET /api/clientes/:idExample:
curl http://localhost:8080/api/clientes/1This repository is being restored in small steps. Some legacy pieces may still exist and are being reviewed before removal or refactor.
Known frontend cleanup already started:
- Vite migration.
- Folder reorganization.
- 404 state.
- Empty states for missing test data.
- Removal of unused route imports and components.
Known backend cleanup already started:
- Migrated API to TypeScript.
- Switched persistence from PostgreSQL to SQLite.
- Replaced Sequelize with Prisma.
- Added mock-based seed data.
- Added dotenvx-based environment loading.