Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maximedegreve/TinyFaces
Free stock avatars for everyone π¦πΌπ¨πΎπ©π» (Built w/ Swift)
https://github.com/maximedegreve/TinyFaces
api swift ubuntu vapor xcode
Last synced: 3 months ago
JSON representation
Free stock avatars for everyone π¦πΌπ¨πΎπ©π» (Built w/ Swift)
- Host: GitHub
- URL: https://github.com/maximedegreve/TinyFaces
- Owner: maximedegreve
- Created: 2016-12-27T14:08:12.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-02-08T11:47:30.000Z (9 months ago)
- Last Synced: 2024-04-04T19:32:55.979Z (7 months ago)
- Topics: api, swift, ubuntu, vapor, xcode
- Language: Swift
- Homepage: https://tinyfac.es
- Size: 522 KB
- Stars: 540
- Watchers: 10
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TinyFaces π¦πΌπ¨πΎπ©π»
Tiny Faces is a free crowd-sourced avatar gallery to use in your personal or commercial projects
Also check out our [Figma Plugin](https://github.com/maximedegreve/TinyFaces-Figma-Plugin) and [Sketch Plugin](https://github.com/maximedegreve/TinyFaces-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](/Sources/App/Models/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](https://developer.apple.com/xcode/)
- Install [Vapor Toolbox](https://docs.vapor.codes/4.0/install/macos/)
- Install [Docker Desktop](https://www.docker.com)
- Run `docker-compose up db` or `./Launch.sh`
- 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:```
STRIPE_SECRET_KEY=
STRIPE_PUBLISH_KEY=
STRIPE_PRICE=
STRIPE_WEBHOOK_SECRET=
CLOUDFLARE_ACCOUNT_IDENTIFIER=
CLOUDFLARE_ACCOUNT_HASH=
CLOUDFLARE_IMAGES_KEY=
CLOUDFLARE_BEARER_TOKEN=
URL=https://tinyfaces.ngrok.io
```Sadly we can't share our Thumbor setup and therefore you need to run a instance yourself for this to work.
## π§ 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](http://localhost:8080)If you want to test Stripe webhooks you set the run a ngrok proxy and make sure you set the correct `STRIPE_SECRET_KEY`, `STRIPE_PUBLISH_KEY`, `STRIPE_WEBHOOK_SECRET` and `STRIPE_PRICINGTABLE_ID` in `.env`
`ngrok http -subdomain=tinyfaces 8080 > /dev/null &`
## π Heroku:
1. In the project directory: `heroku create --buildpack vapor/vapor`
2. Deploy using `git push heroku master` or setup continues deployment in Heroku.
3. For logs use command `heroku logs`
4. Make sure you fill in all Config Vars on Heroku, see the snippet below:```
URL = https://tinyfac.es
MYSQL_URL =
PORT =
THUMBOR_URL=URL
THUMBOR_KEY=ABCDEFG
STRIPE_SECRET_KEY=
STRIPE_PUBLISH_KEY=
STRIPE_PRICINGTABLE_ID=
SWIFT_BUILD_CONFIGURATION = release
```## π Documentation
Visit the Vapor web framework's [documentation](http://docs.vapor.codes) for instructions on how to use this package.