BalestraPatrick / HomeKitty

A Vapor 3 website to easily browse HomeKit accessories.
https://homekitty.world
MIT License
75 stars 9 forks source link
homekit server-side-swift swift vapor

Language MIT License

HomeKitty

HomeKitty is a website built in Vapor 3 that keeps track of all HomeKit accessories available in the market. Accessories are divided in 18 official categories to make it easier to find the perfect accessory for your needs. You can search any accessory by its name or manufacturer and directly open its official website to find more information.

Getting Started

To get started with HomeKitty, make sure you have installed Vapor on your machine. Please follow the official guide. Make sure to also install PostreSQL since HomeKitty uses it as database. Postgres app should work fine.

Enough with the dependencies, clone the repo.

$ git clone https://github.com/BalestraPatrick/HomeKitty

You can now choose to build via command line, or use Xcode. Who doesn't love Xcode? 🛠

You will need to add some API keys as environment variables for the project to run successfully. If you're using Xcode, you can do it from the scheme menu. If you're not using Xcode, define them as environment variables. Here are the required variables:

Architecture

HomeKitty has a very simple architecture. The Sources folder contains two folders:

There are some basic tests in the Tests folder. HomeKitty uses Sourcery to automatically generate LinuxMain.swift which lists all test cases. If you add or remove a test case run sourcery from the command line to update LinuxMain.swift.

Contributing

We would love to have you onboard and help us shape the future of HomeKitty. We have a ton of new features and bug fixes ready for you in the issues.

In case you need help or simply have a technical question, join us in the #development channel in our Slack.

Database

All accessories are stored in a PostgreSQL database. If you are interested in contributing with new accessories which are release everyday, let me know and we can try to find a solution and open them up to the community to improve the database.

During development, it's possible to seed the database with some example data for debugging purposes. In order for the script to connect to the database, you have to specify DB_USER and DB_DATABASE, so they point to the PostgreSQL database. The database at this point should have no table.

Run the HomeKitty project so that the database is prepared all the tables and their schemas are set up. After that's completed, you can run the seed script to populate it with some accessories.

$ cd Scripts && ./seed.sh

Author

I'm Patrick Balestra. Email: me@patrickbalestra.com Twitter: @BalestraPatrick.

License

HomeKitty is available under the MIT license. See the LICENSE file for more info. Please don't re-publish the project as it is under your name. Feel free to use it a starting point for any of your other side projects though.