Pet-Page-Backend is the backend of a pet adoption platform built with Python and Django. It provides a RESTful API for managing pets, users, and adoption processes, ensuring secure and efficient handling of pet-related data.
This project is currently in progress. It will be refactored to follow SOLID architecture principles and will have unit tests added to improve code quality and maintainability.
- 🔐 User Authentication: Secure user registration and login with JWT-based authentication.
- 🐶 Pet Management: CRUD operations for pets, including adoption status tracking.
- 📝 Adoption Process: Endpoints to manage the adoption process, from application to approval.
- 📚 Documentation: API documentation generated with DRF-YASG for easy reference.
- 🐳 Docker Support: Dockerfile and docker-compose.yml for containerized deployment.
- 🐍 Python
- 🌐 Django
- 🔧 Django REST Framework (DRF)
- 🔑 JWT (JSON Web Tokens)
- 📄 DRF-YASG
- 🐳 Docker
- Python 3.8 or higher
- Docker (optional)
-
Clone the repository:
git clone https://github.com/Steph7478/Pet-Page-Backend.git cd Pet-Page-Backend -
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
- Create a
.envfile in the root directory. - Add necessary environment variables (e.g.,
SECRET_KEY,DEBUG,DATABASE_URL).
- Create a
-
Apply migrations:
python manage.py migrate
-
Run the development server:
python manage.py runserver
The API will be accessible at http://localhost:8000.
To run the application using Docker:
-
Build the Docker image:
docker-compose build
-
Start the containers:
docker-compose up
The application will be available at http://localhost:8000.
POST /api/auth/register/— Register a new user.POST /api/auth/login/— Log in and obtain a JWT token.POST /api/auth/logout/— Log out the authenticated user.
GET /api/pets/— List all pets.POST /api/pets/— Create a new pet.GET /api/pets/{id}/— Retrieve details of a specific pet.PUT /api/pets/{id}/— Update a pet’s information.DELETE /api/pets/{id}/— Delete a pet.
POST /api/adoptions/— Apply for pet adoption.GET /api/adoptions/— List all adoption applications.GET /api/adoptions/{id}/— Retrieve details of a specific adoption application.PUT /api/adoptions/{id}/— Update an adoption application’s status.