Skip to content

Early Preview #4

Merged
merged 17 commits into from Nov 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions .editorconfig
@@ -0,0 +1,9 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.php]
indent_style = tab
indent_size = 2
20 changes: 20 additions & 0 deletions .gitignore
@@ -0,0 +1,20 @@
api/vendor/

# OS generated files
.DS_Store
.DS_Store?
._*
Thumbs.db

# Logs
*.log

# Dependency directories
node_modules
bower_components

# Build Systems
.sass-cache
*.css.map
build/
dist/
37 changes: 36 additions & 1 deletion README.md
@@ -1,6 +1,41 @@
# Foodbank

Rules Engine and API for Feeding America / Foodbank Project.
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.

### Helpful URLs

[Propel ORM Calls](http://propelorm.org/documentation/03-basic-crud.html)

[PHPMyAdmin](http://www.develop.digitalmediauconn.org/phpmyadmin/)

[Routing with Slim](http://www.slimframework.com/docs/objects/router.html#how-to-create-routes)

## Contact

Expand Down
4 changes: 4 additions & 0 deletions api/.htaccess
@@ -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
@@ -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
@@ -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"
}
}