Municipalities Reports API
Municipalities Reports API is a RESTful API that allows citizens to report problems or issues in their communities, such as damaged public buildings, poor road conditions, and malfunctioning sanitation systems. The API enables citizens to submit reports, add media files to support their claims, vote on reports, and leave comments.
Installation
- Clone the repository:
git clone https://github.com/your-username/municipalities_reports_api.git
- Install dependencies:
composer install
- Create a copy of the
.env.example
file and rename it to.env
- Generate an application key:
php artisan key:generate
- Set up your database in the
.env
file - Migrate the database:
php artisan migrate
Usage
To use the API, you will need to register for an API key. Once you have your key, you can make requests to the API. The following endpoints are available:
Users
GET /api/users
: Get a list of all usersGET /api/users/{id}
: Get a specific userPOST /api/users
: Create a new userPUT /api/users/{id}
: Update a userDELETE /api/users/{id}
: Delete a user
Reports
GET /api/reports
: Get a list of all reportsGET /api/reports/{id}
: Get a specific reportPOST /api/reports
: Create a new reportPUT /api/reports/{id}
: Update a reportDELETE /api/reports/{id}
: Delete a report
Media
GET /api/media
: Get a list of all mediaGET /api/media/{id}
: Get a specific mediaPOST /api/media
: Create a new mediaPUT /api/media/{id}
: Update a mediaDELETE /api/media/{id}
: Delete a media
Votes
GET /api/votes
: Get a list of all votesGET /api/votes/{id}
: Get a specific votePOST /api/votes
: Create a new votePUT /api/votes/{id}
: Update a voteDELETE /api/votes/{id}
: Delete a vote
Comments
GET /api/comments
: Get a list of all commentsGET /api/comments/{id}
: Get a specific commentPOST /api/comments
: Create a new commentPUT /api/comments/{id}
: Update a commentDELETE /api/comments/{id}
: Delete a comment
Contributing
If you would like to contribute to this project, please follow these steps:
- Fork the repository
- Create a new branch for your changes
- Make your changes and commit them
- Push your changes to your fork
- Submit a pull request