- Node.js: v20.19.0 (use nvm:
nvm use) - npm: v10+ (comes with Node.js)
- Git: Latest version
-
Clone the repository
git clone https://github.com/DogStark/petChain-Frontend.git cd petChain-Frontend -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env.local # Edit .env.local with your configuration -
Run development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
-
Navigate to backend folder
cd backend -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env # Edit .env with your configuration -
Run development server
npm run start:dev
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run lint:fix- Fix ESLint errorsnpm run format- Format code with Prettiernpm run format:check- Check code formattingnpm run type-check- Run TypeScript type checkingnpm run validate- Run all checks (type-check, lint, format)npm run test- Run the standalone password-policy unit testsnpm run test:unit- Run all Jest unit tests (single discovery convention)npm run test:coverage- Run Jest unit tests with coverage reportnpm run clean- Remove build artifacts (.next,coverage,dist,build,.turbo,out) using a cross-platform node utilitynpm run clean:all- Also removenode_modules, caches, and performance resultsnpm run bundle:check- Validate route-level JS bundle budgets for wallet, analytics, and clinic routes; fails CI on threshold violationsnpm run analyze- Build with bundle analyzer artifactnpm run audit:fix- Fix security vulnerabilities
npm run start:dev- Start development server with watch modenpm run build- Build for productionnpm run start:prod- Start production servernpm run lint- Run ESLintnpm run format- Format code with Prettiernpm run test- Run unit testsnpm run test:e2e- Run end-to-end testsnpm run test:cov- Run tests with coverage
This project uses Husky and lint-staged to run checks before commits:
- Prettier formatting
- ESLint linting
- TypeScript type checking
Before pushing, run:
npm run validatepetChain-Frontend/
├── src/
│ ├── components/ # React components
│ ├── pages/ # Next.js pages
│ └── styles/ # Global styles
├── public/ # Static assets
├── backend/ # NestJS backend (separate)
├── .github/ # GitHub workflows and templates
└── ...config files
NEXT_PUBLIC_APP_NAME=PetChain
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:3001
NEXT_PUBLIC_STELLAR_NETWORK=testnet
NEXT_PUBLIC_STELLAR_HORIZON_URL=https://horizon-testnet.stellar.orgSee backend/README.md for backend-specific environment variables.
If port 3000 is already in use:
# Kill the process using port 3000
lsof -ti:3000 | xargs kill -9
# Or use a different port
PORT=3001 npm run devMake sure you're using the correct Node.js version:
nvm useIf you encounter dependency issues:
npm run clean:all
npm install-
Clean the build cache:
npm run clean
-
Run type checking:
npm run type-check
-
Check for linting errors:
npm run lint
- Create a feature branch
- Make your changes
- Run
npm run validateto ensure code quality - Commit your changes (pre-commit hooks will run automatically)
- Push and create a pull request
See contributing.md for detailed guidelines.
- Frontend: Next.js 15, React 19, TypeScript, Tailwind CSS
- Backend: NestJS, TypeScript
- Blockchain: Stellar
- Deployment: Vercel (Frontend), Heroku (Backend)
- Telegram: @PetChain Group
- Issues: GitHub Issues
- Contact: @llins_x