Development Server
The André Ruperto Portfolio uses a monorepo structure with a React frontend and Express backend that run concurrently during development.Quick Start
Start both frontend and backend
Run the full development environment with a single command:This uses
concurrently to start both servers:- Frontend (Vite):
http://localhost:8080 - Backend (Express):
http://localhost:3001
The frontend automatically proxies API requests to the backend.
Individual Server Commands
You can also run the frontend and backend separately:Frontend Development
- Hot Module Replacement (HMR)
- Fast refresh with React SWC
- TypeScript type checking
- ESLint integration
- Port:
8080
Backend Development
- Auto-restart with
--watchflag - Express.js API endpoints
- Prisma database integration
- CORS enabled for frontend
- Port:
3001
Available Scripts
Frontend Scripts
| Command | Description |
|---|---|
npm run dev | Start Vite development server on port 8080 |
npm run build | Build for production |
npm run build:dev | Build for development with source maps |
npm run build:prod | Build for production (optimized) |
npm run preview | Preview production build locally |
npm run lint | Run ESLint on all files |
npm test | Run tests with Vitest |
npm run test:watch | Run tests in watch mode |
npm run clean | Clean build artifacts and cache |
npm run copy:images | Copy images to build directory |
Backend Scripts
| Command | Description |
|---|---|
npm run backend:dev | Start backend in development mode |
npm run backend:start | Start backend in production mode |
npm run backend:install | Install backend dependencies |
npm run backend:seed | Seed database with sample data |
npm run backend:migrate | Run Prisma migrations |
npm run backend:generate | Generate Prisma client |
Combined Scripts
| Command | Description |
|---|---|
npm run deploy:local | Run frontend + backend concurrently |
npm run deploy:prod | Build frontend for production |
Development Workflow
Making Changes
Frontend changes
Edit files in
src/ directory:src/components/- React componentssrc/pages/- Page componentssrc/hooks/- Custom React hookssrc/lib/- Utilities and helpers
Backend changes
Edit files in
backend/src/ directory:backend/src/server.js- Express serverbackend/src/routes/- API routesbackend/prisma/schema.prisma- Database schema
Testing
Run Tests
- Vitest - Test runner
- React Testing Library - Component testing
- jsdom - Browser environment simulation
Linting
Run ESLint to check code quality:- TypeScript syntax
- React hooks rules
- Code formatting
- Unused imports
Development Tools
Vite Features
- Fast HMR: Changes reflect instantly
- Path Aliases: Use
@/to import fromsrc/ - TypeScript: Full TypeScript support
- SWC: Ultra-fast React refresh
Debugging
Git Hooks
The project uses Husky for git hooks:- Pre-commit: Runs ESLint and tests on staged files
- Lint-staged: Only lints changed files
Troubleshooting
Port already in use
If port 8080 or 3001 is already in use:Database connection issues
Verify PostgreSQL is running and credentials are correct:Module not found errors
Reinstall dependencies:Prisma issues
Reset Prisma client:Next Steps
- Deployment - Deploy your portfolio to production
- API Reference - Explore API endpoints
