Create patterns. Make quilts. Be inspired.
- Live app: Quiltr
- Live API: Quiltr API
- API repo on GitHub: rhjones/quiltr-api
Quiltr lets users generate random geometric quilt patterns in a range of sizes and color schemes. Users can save patterns to their "favorites" and browse a gallery of all patterns on the site. Users can also create projects based on these patterns and share their notes about and photos of each project.
Quiltr is built in Ember and relies on a Rails API/Postgres to persist data. Code for that API can be found at rhjones/quiltr-api.
An entity relationship diagram is available at here.
Resources include:
- Users
- Patterns
- Favorites (join between patterns and users)
- Projects
- Pattern uploads
- Project uploads
Install with bundle install
.
Additional dependencies
ImageMagick
(install withbrew install imagemagick
)
touch .env
echo SECRET_TOKEN=$(bundle exec rake secret) >> .env
echo SECRET_KEY_BASE_DEVELOPMENT=$(bundle exec rake secret) >> .env
curl
command scripts for all actions are stored in scripts
with names that
correspond to API actions.
Note that in order to run the upload script, you must run it from within the scripts directory.
Scripts are included in scripts
to test actions.
Verb | URI Pattern | Controller#Action |
---|---|---|
POST | /sign-up |
users#signup |
POST | /sign-in |
users#signin |
PATCH | /change-password/:id |
users#changepw |
DELETE | /sign-out/:id |
users#signout |
Request:
curl --include --request POST http://localhost:3000/sign-up \
--header "Content-Type: application/json" \
--data '{
"credentials": {
"email": "an@example.email",
"password": "an example password",
"password_confirmation": "an example password"
}
}'
scripts/sign-up.sh
Response:
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
{
"user": {
"id": 1,
"email": "an@example.email"
}
}
Request:
curl --include --request POST http://localhost:3000/sign-in \
--header "Content-Type: application/json" \
--data '{
"credentials": {
"email": "an@example.email",
"password": "an example password"
}
}'
scripts/sign-in.sh
Response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"user": {
"id": 1,
"email": "an@example.email",
"token": "33ad6372f795694b333ec5f329ebeaaa"
}
}
Request:
curl --include --request PATCH http://localhost:3000/change-password/$ID \
--header "Authorization: Token token=$TOKEN" \
--header "Content-Type: application/json" \
--data '{
"passwords": {
"old": "an example password",
"new": "super sekrit"
}
}'
ID=1 TOKEN=33ad6372f795694b333ec5f329ebeaaa scripts/change-password.sh
Response:
HTTP/1.1 204 No Content
Request:
curl --include --request DELETE http://localhost:3000/sign-out/$ID \
--header "Authorization: Token token=$TOKEN"
ID=1 TOKEN=33ad6372f795694b333ec5f329ebeaaa scripts/sign-out.sh
Response:
HTTP/1.1 204 No Content
Verb | URI Pattern | Controller#Action |
---|---|---|
GET | /users |
users#index |
GET | /users/1 |
users#show |
Request:
curl --include --request GET http://localhost:3000/users \
--header "Authorization: Token token=$TOKEN"
TOKEN=33ad6372f795694b333ec5f329ebeaaa scripts/users.sh
Response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"users": [
{
"id": 2,
"email": "another@example.email"
},
{
"id": 1,
"email": "an@example.email"
}
]
}
Request:
curl --include --request GET http://localhost:3000/users/$ID \
--header "Authorization: Token token=$TOKEN"
ID=2 TOKEN=33ad6372f795694b333ec5f329ebeaaa scripts/user.sh
Response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"user": {
"id": 2,
"email": "another@example.email"
}
}
- All content is licensed under a CCBYNCSA 4.0 license.
- All software code is licensed under GNU GPLv3.