Quick Start¶
Get up and running with Petfolio development in minutes.
Development Server¶
Start the development server for the main application:
The app will be available at http://localhost:4200
!!! tip "Hot Reload" Changes to source files will automatically reload the browser.
Common Commands¶
Development¶
Project Structure¶
petfolio-fe/
├── apps/
│ ├── petfolio-business/ # Main Next.js app
│ ├── petfolio-ui-tests/ # Playwright e2e tests
│ └── petfolio-docs/ # MkDocs documentation
├── libs/
│ ├── ui-component-library/ # Shared React components
│ └── util-global-theme/ # MUI theme utilities
├── tools/ # Build scripts
├── .github/ # CI/CD workflows
└── nx.json # Nx configuration
Monorepo Workflow¶
1. Create a Feature Branch¶
2. Make Changes¶
Edit files in the appropriate project:
# For UI components
code libs/ui-component-library/src/lib/atoms/Button/Button.tsx
# For app pages
code apps/petfolio-business/src/app/page.tsx
3. Test Your Changes¶
4. Build and Verify¶
5. Commit and Push¶
6. Create Pull Request¶
The CI pipeline will automatically:
- ✅ Lint your code
- ✅ Run tests
- ✅ Build your changes
- ✅ Scan for security vulnerabilities
Working with the Component Library¶
View Components in Storybook¶
Open http://localhost:4400 to browse components.
Add a New Component¶
# Create component directory
mkdir -p libs/ui-component-library/src/lib/atoms/NewComponent
# Create component files
touch libs/ui-component-library/src/lib/atoms/NewComponent/NewComponent.tsx
touch libs/ui-component-library/src/lib/atoms/NewComponent/NewComponent.spec.tsx
touch libs/ui-component-library/src/lib/atoms/NewComponent/NewComponent.stories.tsx
Example component:
NewComponent.tsx
import { FC } from 'react';
export interface NewComponentProps {
label: string;
}
export const NewComponent: FC<NewComponentProps> = ({ label }) => {
return <div>{label}</div>;
};
Don't forget to export it from libs/ui-component-library/src/index.ts:
Running Documentation Locally¶
Start the MkDocs development server:
Or using Nx:
Visit http://localhost:8000 to view the docs.
Docker Development¶
Build and run the app in Docker:
# Build Docker image
docker build -f apps/petfolio-business/Dockerfile -t petfolio-business .
# Run container
docker run -p 4200:4200 petfolio-business
Next Steps¶
- Development Workflows - Deep dive into development practices
- Testing Guide - Learn testing strategies
- Architecture Overview - Understand the system design