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.
- 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:
- Submissions in process will cause the lamp to flicker, alternating with a breathing orange color.
- Accepted submissions will switch the lamp to parrot green before reverting to the rating/profile color after a set delay.
- Wrong submissions will turn the lamp red for a certain time before reverting to the rating/profile color after a set delay.
- 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}
- 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.
-
Clone the Repository:
git clone https://github.com/hanisntsolo/codeforces-lamp.git cd codeforces-lamp
-
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}
-
Build the Docker Image:
docker build -t codeforces-lamp .
-
Run the Docker Container:
sh rebuild_and_run.sh
Detailed usage instructions and examples can be found in the documentation.
Contributions are highly welcome! Please create a pull request for feature enhancements.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or suggestions, feel free to open an issue or reach out via email at [email protected].