TinyFaces
TinyFaces copied to clipboard
Free stock avatars for everyone π¦πΌπ¨πΎπ©π» (Built w/ Swift)
TinyFaces π¦πΌπ¨πΎπ©π»
![](https://github.com/maximedegreve/TinyFaces/raw/master/Public/images/github-header.png?raw=true)
Tiny Faces is a free crowd-sourced avatar gallery to use in your personal or commercial projects
Also check out our Figma Plugin and Sketch Plugin
π¦Ύ API
Endpoints
-
GET
: https://tinyfac.es/api/data?limit=50&gender=female&quality=0 -
GET
: https://tinyfac.es/api/avatar.jpg?gender=female&quality=0
Query
-
quality
: Filters the result(s) to lower or higher quality images by using a value from 0 to 10. -
gender
: Possible values for gender can be found in Gender.swift -
limit
: To limit how many results you get back by using a value of 50 or lower. Only works with the data endpoint. When mixed with gender this could return less than n results.
Limitations
- Max requests per hour per IP address:
60
- When you've reached your limit you'll receive an error response with status code
493
π Before building (dependencies)
- Install Xcode
- Install Vapor Toolbox
- Install Docker Desktop
- Run
docker-compose up db
- Run
Package.swift
using Xcode - Change your Xcode working directory to your root folder:
Schemes > TinyFaces > Edit Scheme > Run > Options > Working Directory > [x]
- Add a
.env
file to the local root directory this should have the values below:
CLOUDINARY_URL=cloudinary://KEY:SECRET@CLOUD-NAME
FACEBOOK_APP_ID=1234
SEND_IN_BLUE_KEY=1234
π§ Building
- Run the
Run
target in Xcode - The first time this can take a long time because it will seed the database with random first names and last names.
- The application should now be running on http://localhost:8080
- To test Facebook Login you need run the app on https, use for ngrok this.
ngrok http 8080 -subdomain tinyfaces
π Heroku:
- In the project directory:
heroku create --buildpack vapor/vapor
- Deploy using
git push heroku master
or setup continues deployment in Heroku. - For logs use command
heroku logs
- Make sure you fill in all Config Vars on Heroku, see the snippet below:
URL = https://tinyfac.es
MYSQL_URL =
PORT =
CLOUDINARY_URL = cloudinary://KEY:SECRET@CLOUD-NAME
FACEBOOK_APP_ID = 1234
SEND_IN_BLUE_KEY = 1234
SWIFT_BUILD_CONFIGURATION = release
π Documentation
Visit the Vapor web framework's documentation for instructions on how to use this package.