Welcome to PetSocial, the ultimate social network for pets! This application allows users to create profiles for their pets, share posts, make friends, and more. Built with Laravel 11, this project is designed to provide a seamless and fun experience for pet owners and their furry friends.
- User authentication and profile management
- Create and manage pet profiles
- Post updates and share media
- Comment and react to posts
- Friend requests and messaging
- Paginated lists of posts and pets
To get started with PetSocial, follow these steps:
- Clone the repository:
git clone https://github.com/pc-xpress/petyshop-api.git
cd petyshop-api
- Install dependencies:
composer install
npm install
- Copy the example environment file and configure your environment variables:
cp .env.example .env
- Generate an application key:
php artisan key:generate
- Run the database migrations and seed the database:
php artisan migrate --seed
- Start the local development server:
php artisan serve
Once the server is running, you can access the application at http://localhost:8000.
Here are some of the key API endpoints:
POST /api/v1/register
- Register a new userPOST /api/v1/login
- Login a user
GET /api/v1/pets
- List all pets (paginated)POST /api/v1/pets
- Create a new petGET /api/v1/pets/{id}
- Get a specific petPUT /api/v1/pets/{id}
- Update a petDELETE /api/v1/pets/{id}
- Delete a pet
GET /api/v1/posts
- List all posts (paginated)POST /api/v1/posts
- Create a new postGET /api/v1/posts/{id}
- Get a specific postPUT /api/v1/posts/{id}
- Update a postDELETE /api/v1/posts/{id}
- Delete a post
POST /api/v1/posts/{id}/comments
- Add a comment to a postGET /api/v1/comments/{id}
- Get a specific commentPUT /api/v1/comments/{id}
- Update a commentDELETE /api/v1/comments/{id}
- Delete a comment
POST /api/v1/friendships
- Send a friend requestGET /api/v1/friendships
- List friend requestsPUT /api/v1/friendships/{id}
- Accept/Reject a friend requestDELETE /api/v1/friendships/{id}
- Remove a friend
Here is a brief overview of the database structure:
-
Users: Stores user information.
-
Pets: Stores pet profiles linked to users.
-
Posts: Stores posts made by pets.
-
Comments: Stores comments on posts.
-
Friendships: Manages friendship relations between pets.
-
Messages: Stores private messages between pets.
-
Notifications: Manages notifications for users.
php artisan test
Make sure you have the test environment configured correctly in your .env
file.
Contributions are welcome! However, all contributors must be authorized by the administrator before submitting changes. Please fork this repository, make your changes, and submit a pull request. Ensure your code adheres to the project's coding standards and includes appropriate tests.
This project is open-sourced software licensed under the MIT license.