Skip to content

Have you ever wished for instant feedback on your programming submissions without having to check your screen constantly?

License

Notifications You must be signed in to change notification settings

hanisntsolo/codeforces-lamp

Repository files navigation

Codeforces Lamp

Overview

The Codeforces Lamp project provides a Dockerized solution for integrating with the Codeforces API to track profile ratings and submissions in real-time. This repository contains all the necessary files to build and publish Docker images, making it easy for users to deploy and use the Codeforces Lamp on any platform. Our goal is to streamline the process of accessing and utilizing Codeforces data, offering a ready-to-use, containerized environment for developers and competitive programming enthusiasts.

What is this project?

  • Set up a real-time smart lamp color based on Codeforces profile rating: Once set up, the system fetches your Codeforces rating and adjusts the lamp color accordingly.
  • Track submissions with real-time smart lamp feedback: The system automatically fetches new submissions and provides the following feedback:
    1. Submissions in process will cause the lamp to flicker, alternating with a breathing orange color.
    2. Accepted submissions will switch the lamp to parrot green before reverting to the rating/profile color after a set delay.
    3. Wrong submissions will turn the lamp red for a certain time before reverting to the rating/profile color after a set delay.

Prerequisites

  • SMARTLIFE Android/iOS App: To add the smart lamp to the Tuya account and get the device's Unique Identifier.
  • Wipro Smart Lamp/Light Devices: Smart light devices connected to the SMARTLIFE App.
  • Tuya Developer Access: Obtain Tuya developer access to interact with their IoT APIs.
  • Codeforces API Key: Obtain an API key from Codeforces to interact with the Codeforces system.
  • Set Up Environment Variables in docker-compose.yml:
      - CODEFORCES_API_KEY=${CODEFORCES_API_KEY}
      - CODEFORCES_API_SECRET=${CODEFORCES_API_SECRET}
      - TUYA_ACCESS_ID=${TUYA_ACCESS_ID}
      - TUYA_ACCESS_KEY=${TUYA_ACCESS_KEY}
      - TUYA_BULB_ID=${TUYA_BULB_ID}

Features

  • Pre-configured Environment: Includes all dependencies and configurations required to interact with the Codeforces API.
  • Modular Architecture: Designed with modularity in mind, making it easy to extend and customize.
  • Easy Deployment: Docker images can be created and run with minimal setup.
  • Open Source: Freely available for anyone to use, modify, and contribute.

Getting Started

  1. Clone the Repository:

    git clone https://github.com/hanisntsolo/codeforces-lamp.git
    cd codeforces-lamp
  2. Obtain and setup environment variables for the container

    Open docker-compose.yml and update these env variables.
      - CODEFORCES_API_KEY=${CODEFORCES_API_KEY}
      - CODEFORCES_API_SECRET=${CODEFORCES_API_SECRET}
      - TUYA_ACCESS_ID=${TUYA_ACCESS_ID}
      - TUYA_ACCESS_KEY=${TUYA_ACCESS_KEY}
      - TUYA_BULB_ID=${TUYA_BULB_ID}
  3. Build the Docker Image:

    docker build -t codeforces-lamp .
  4. Run the Docker Container:

    sh rebuild_and_run.sh

Usage

Detailed usage instructions and examples can be found in the documentation.

Contributing

Contributions are highly welcome! Please create a pull request for feature enhancements.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions or suggestions, feel free to open an issue or reach out via email at ds.pratap1997@gmail.com.

About

Have you ever wished for instant feedback on your programming submissions without having to check your screen constantly?

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published