Live API can be found here:
git clone https://github.com/Say-Their-Name/api.git
cd api
This is the recommended setup,as it prevents many PHP or dependency issues (compatibility, missing PHP extension...).
- Docker
- Docker Compose
- Taskfile (optional,but much recommended)
git clone https://github.com/Say-Their-Name/api.git
cd api
# Build the development Docker image
task build
# Start the stack
task
# Install vendor dependencies
task vendor
# Prepare the database
task dbreset
# Run shell in the running container
task sh
## from shell you can run composer, artisan, etc
Go to http://localhost:8000
You can still avoid installing and using Taskfile,but it would make your life easier ;)
Anyway:
# Build the development Docker image
docker-compose build
# Start the stack
docker-compose up
# Install vendor dependencies
docker-compose exec app composer install
# Prepare the database
docker-compose exec app php artisan migrate:fresh --seed
# Run shell in the running container
docker-compose exec app bash
## from shell you can run composer, artisan, etc
Go to http://localhost:8000
This is the last resort setup. Normally using Docker is easier.
Also you're exposing yourself to inconsistencies.
That being said:
git clone https://github.com/Say-Their-Name/api.git
cd api
// Copy Your Environment files
cp .env.example .env
// Create an SQLITE Database
touch database/database.sqlite
// Install Composer Dependancies
composer install
// Generate an encryption key
php artisan key:generate
// Create database and insert 10 People for testing
// Each Person has
// 1 Donation Link
// 1 Petition Link
// 1 Media Articles
// 1 Image
php artisan migrate:fresh --seed
// Run tests
php artisan test
// Run the application
php artisan serve
GET People
http://localhost:8000/api/people
http://localhost:8000/api/people/{id}
GET Donations
http://localhost:8000/api/donations
http://localhost:8000/api/donations/{id}
GET Petitions
http://localhost:8000/api/petitions
http://localhost:8000/api/petitions/{id}
- Admin Panel to manage the people