Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fcurella/clock-api
An over-engineered Alarm Clock
https://github.com/fcurella/clock-api
celery celerybeat channels django django-rest-framework svelte websocket
Last synced: 25 days ago
JSON representation
An over-engineered Alarm Clock
- Host: GitHub
- URL: https://github.com/fcurella/clock-api
- Owner: fcurella
- License: mit
- Created: 2020-05-26T14:54:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-21T09:45:57.000Z (over 2 years ago)
- Last Synced: 2024-04-16T18:10:35.472Z (7 months ago)
- Topics: celery, celerybeat, channels, django, django-rest-framework, svelte, websocket
- Language: Python
- Homepage:
- Size: 2.57 MB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 9
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Clock
=====An over-engineered Alarm Clock with API.
.. image:: https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg
:target: https://github.com/pydanny/cookiecutter-django/
:alt: Built with Cookiecutter Django
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/ambv/black
:alt: Black code style:License: MIT
.. image:: https://github.com/fcurella/clock-api/raw/master/docs/assets/screenshots/owl.png
Concept
-------The main idea is to provide a very flexible backend and a frontend that can be custom designed.
I've included two designs: an owl and an analog clock. But feel free to fork and make your own!I usually keep the clock open on a tiny browser window on my second monitor to keep me company.
Alarms
------Alarms can have arbitrary attributes attached (eg: a color, or the URL of a picture), and
frontends may interpret them.Right now alarms are specified using crontabs, but I plan to add support for other schedulers
in the future. For example, you could use a solar schedule to create an alarm that fires at dawn.Creating Alarms
^^^^^^^^^^^^^^^You can add alarms by using the admin (at ``/admin/``) or by using the API at ``/api/alarms/``
Basic Commands
--------------Setting Up Your Users
^^^^^^^^^^^^^^^^^^^^^* To create an **superuser account**, use this command::
$ python manage.py createsuperuser
Test coverage
^^^^^^^^^^^^^To run the tests, check your test coverage, and generate an HTML coverage report::
$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.htmlRunning tests with py.test
~~~~~~~~~~~~~~~~~~~~~~~~~~::
$ pytest
Celery
^^^^^^This app comes with Celery.
To run celery beat:
.. code-block:: bash
cd clock
celery -A config.celery_app beat -l infoPlease note: For Celery's import magic to work, it is important *where* the celery commands are run. If you are in the same folder with *manage.py*, you should be right.
Deployment
----------You can deploy locally by using `Garden.io `_:
.. code-block:: bash
garden run task migrate
garden run task build
garden deployYou can then visit http://clock.local.app.garden.
Or you can deploy straight to heroku:
.. image:: https://www.herokucdn.com/deploy/button.svg
:alt: Deploy
:target: https://heroku.com/deploy