Skip to content

Commit

Permalink
slim/propel example
Browse files Browse the repository at this point in the history
  • Loading branch information
briankelleher committed Nov 7, 2016
1 parent 8870cc8 commit 6522adb
Show file tree
Hide file tree
Showing 45 changed files with 17,943 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
api/vendor/
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@

Rules Engine and API for Feeding America / Foodbank Project. PHP and MySQL.

## API

Everything is located in the `/api` directory. You will need [composer](https://getcomposer.org/) installed.

The entire API runs from `index.php`. This way everything routes to http://foodbankurl.com/api/.

Propel was used to generate the ORM. The ORM lives under:

```
/api
/generated-classes # All of the main ORM classes used in our application.
/generated-conf # Configuration for the ORM
/generated-sql # Explicit creation queries for our DB structure.
```

The Routing is handled through the `routes` folder, and are [Slim](http://www.slimframework.com/) routes.

### Development

```
cd api
composer install
php -S localhost:8000
```

A `Foodbank.postman_collection.json` file has been added. You can import this to Postman to test routes.

## Contact

[Joel Salisbury](mailto:joel@uconn.edu) - Faculty Advisor
Expand Down
4 changes: 4 additions & 0 deletions api/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
25 changes: 25 additions & 0 deletions api/Foodbank.postman_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"variables": [],
"info": {
"name": "Foodbank",
"_postman_id": "a8e172cf-8f6b-3abf-a0ee-90832eecb2bf",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
"name": "GET All Categories",
"request": {
"url": "http://localhost:8000/category/all",
"method": "GET",
"header": [],
"body": {
"mode": "formdata",
"formdata": []
},
"description": ""
},
"response": []
}
]
}
14 changes: 14 additions & 0 deletions api/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "brian/foodbank",
"type": "project",
"authors": [
{
"name": "briankelleher",
"email": "bkelleher4@gmail.com"
}
],
"require": {
"propel/propel": "~2.0@dev",
"slim/slim": "~3.0"
}
}
Loading

0 comments on commit 6522adb

Please sign in to comment.