Codex is a Telex integration that posts a coding challenge from Codewars in a specified channel every morning. This helps developers enhance their problem-solving skills daily.
- Automatically fetches and posts a new Codewars challenge every day.
- Provides a direct link to the challenge for easy access.
- Encourages continuous skill improvement through daily problem-solving.
- Configurable interval for challenge posting.
-
Clone this repository:
git clone https://github.com/tonybnya/codex.git cd codex
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows use: venv\\Scripts\\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.env
file and add the necessary configuration:FLASK_PORT=5000 FLASK_DEBUG=True
-
Run the Flask server:
python3 main.py
The integration exposes a GET
endpoint /coding_challenge
where Telex can fetch metadata about the app.
- Tick URL: This is the webhook Telex will call periodically.
-
Endpoint:
POST /tick
-
Payload:
{ "channel_id": "<telex_channel_id>", "return_url": "<telex_webhook_url>", "settings": [ {"label": "interval", "type": "text", "required": true, "default": "0 9 * * *"} ] }
-
You can manually test the integration by triggering a tick request:
curl -X POST http://localhost:5000/tick -H "Content-Type: application/json" -d '{"channel_id": "your_channel_id", "return_url": "your_return_url", "settings": [{"label": "interval", "type": "text", "required": true, "default": "0 9 * * *"}]}'
OR
You can run Unit Tests:
pytest -v
-
Build the Docker image:
docker build -t codex .
-
Run the container:
docker run -d -p 5003:5003 codex
- Set up a reverse proxy with Nginx or Apache.
- Use a process manager like
gunicorn
orsupervisor
to keep the app running. - Use a Cloud service (like Render, Vercel, AWS).
Feel free to open issues or submit pull requests for improvements!