Features β’ Quick Start β’ Architecture β’ Documentation
|
Next.js-powered responsive UI with seamless UX |
Flask API with efficient data processing |
Intelligent pet consultation chatbot |
# Clone the repository
git clone <repository-url>
cd 5pets
# Backend Setup
cd src/server
python -m venv .env.bin
source .env.bin/bin/activate # Windows: .env.bin\Scripts\activate
pip install -r requirements.txt
python app.py
# Frontend Setup (in new terminal)
cd src/client
npm install
echo "NEXT_PUBLIC_API_URL=http://localhost:10000/api" > .env
npm run devπ Done! Visit http://localhost:3000
graph LR
A[π₯οΈ Client<br/>Next.js:3000] -->|REST API| B[βοΈ Backend<br/>Flask:10000]
B --> C[π€ AI Module<br/>Pet Consultant]
B --> D[ποΈ Data Layer<br/>Storage]
style A fill:#0070f3,stroke:#fff,color:#fff
style B fill:#10b981,stroke:#fff,color:#fff
style C fill:#f59e0b,stroke:#fff,color:#fff
style D fill:#6366f1,stroke:#fff,color:#fff
5pets/
β£ββ π data/ Raw datasets and crawled data
β£ββ π¨ design/ UI/UX mockups and assets
β£ββ π pa/ Project proposals and architecture docs
β£ββ π docs/ API specifications and manuals
β
βββ π» src/ Core application source
β£ββ βοΈ client/ Next.js frontend application
β£ββ π server/ Flask backend API service
βββ π€ ai_pet_consultant/ AI chatbot logic module
Ensure your development environment has the following installed:
| Technology | Version | Download |
|---|---|---|
| Node.js | β₯ 18.x | nodejs.org |
| Python | β₯ 3.10 | python.org |
| Git | Latest | git-scm.com |
Quick Check:
node --version && python --version && git --versionπ Location: src/client
Create .env file:
# Backend API Endpoint
NEXT_PUBLIC_API_URL=http://localhost:10000/api
# Optional: Other configurations
# NEXT_PUBLIC_ANALYTICS_ID=your_analytics_idcd src/client
npm installnpm run devβ Frontend running at: http://localhost:3000
| Command | Description |
|---|---|
npm run dev |
Start development server with hot reload |
npm run build |
Create production build |
npm start |
Run production server |
npm run lint |
Check code quality |
π Location: src/server
cd src/server
# Create virtual environment
python -m venv .env.bin
# Activate it
source .env.bin/bin/activate # macOS/Linux
# OR
.env.bin\Scripts\activate # Windowspip install -r requirements.txtpython app.pyβ Backend API running at: http://localhost:10000
Create .env file in src/server:
FLASK_ENV=development
FLASK_DEBUG=True
SECRET_KEY=your_secret_key_here
DATABASE_URL=your_database_connectionπ Location: src/ai_pet_consultant
This module powers the intelligent pet consultation features.
cd src/ai_pet_consultant
# Create isolated environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install AI dependencies
pip install -r requirements.txtConfigure AI model settings in config.py or via environment variables.
Terminal 1 - Backend:
cd src/server
source .env.bin/bin/activate
python app.pyTerminal 2 - Frontend:
cd src/client
npm run devInstall concurrently:
npm install -g concurrentlyRun from project root:
concurrently "cd src/server && python app.py" "cd src/client && npm run dev"Port Already in Use
Frontend (Port 3000):
# Find process
lsof -ti:3000 # macOS/Linux
netstat -ano | findstr :3000 # Windows
# Kill process or change port in package.jsonBackend (Port 10000):
# Change port in app.py
app.run(port=10001) # Use different port
# Update frontend .env
NEXT_PUBLIC_API_URL=http://localhost:10001/apiCORS Errors
Ensure flask-cors is configured in app.py:
from flask_cors import CORS
app = Flask(__name__)
CORS(app, origins=["http://localhost:3000"])Module Not Found Errors
# Verify virtual environment is activated
which python # Should show venv path
# Reinstall dependencies
pip install -r requirements.txt --force-reinstallEnvironment Variables Not Loading
- Restart the development server after changing
.env - Check file name is exactly
.env(not.env.txt) - Ensure no spaces around
=in variable assignments
- π API Documentation
- π¨ Design System
- ποΈ Architecture Details
- π Bug Reports
We welcome contributions! Please see our Contributing Guidelines for details.
This project is licensed under the MIT License - see the LICENSE file for details.
Questions? Open an issue or contact us at team@5pets.dev