A Slack-based application designed to encourage physical activity, consistency, and healthy habits within the Jaya
community.
This project is part of an internal learning initiative where developers collaborate, practice English, and gain
hands-on experience with modern backend development tools.
The main goal of this repository is to serve as a collaborative learning environment.
Developers will learn by building a real system that integrates with Slack, uses a modern Python backend stack, follows
good engineering practices, and encourages teamwork.
git clone https://github.com/jaya-academy/sports-program.git
cd sports-program
Run the setup script to install dependencies and configure pre-commit hooks automatically:
Windows:
setup.batLinux/Mac:
chmod +x setup.sh
./setup.shcp .env.example .env
# Edit .env with your settingspoetry run alembic upgrade headpoetry run uvicorn app.main:app --reloadpoetry shell
uvicorn app.main:app --reloadThe application uses the Slack Bolt framework with OAuth support. This allows the app to be installed in multiple workspaces.
-
Create or Select an App:
- Go to Slack Apps.
-
Get OAuth Credentials:
- Client ID & Client Secret: Navigate to Basic Information > App Credentials.
- Signing Secret: Also in Basic Information.
-
Update Environment Variables:
- Open your
.envfile and fill in:SLACK_CLIENT_ID=your_client_id SLACK_CLIENT_SECRET=your_client_secret SLACK_SIGNING_SECRET=your_signing_secret SLACK_SCOPES=commands,chat:write
- Open your
-
OAuth & Permissions:
- Add the Redirect URL:
https://your-domain.com/slack/oauth_redirect. - Ensure required scopes are added.
- Add the Redirect URL:
-
Installation Entry Point:
- The application provides a default installation page at
/slack/install. - This page contains the Add to Slack button which initiates the OAuth flow for new workspaces.
- The application provides a default installation page at
To test the Slack integration locally, you need to expose your local server to the internet using a tool like ngrok.
- Instale e execute o ngrok:
ngrok http 8000
- Copie a URL gerada (ex:
https://abcd-123.ngrok-free.app).
- OAuth & Permissions: Adicione a Redirect URL usando o seu ngrok:
https://abcd-123.ngrok-free.app/slack/oauth_redirect. - Event Subscriptions: Ative e configure a Request URL:
https://abcd-123.ngrok-free.app/slack/events. - Slash Commands: Garanta que os comandos apontem para a URL de eventos acima.
- Inicie o servidor:
poetry run uvicorn app.main:app --reload - Acesse:
https://abcd-123.ngrok-free.app/slack/install - Clique em Add to Slack e autorize.
- Teste um comando no Slack (ex:
/list-programs).
This project encourages:
- Frequent pull requests
- Pair programming
- English communication
- Documentation improvements
- Code reviews and refactoring
Tests and Coverage:
poetry run pytestThe coverage report is automatically generated in the terminal and in HTML format in the htmlcov/ folder.
Ruff (linter)
poetry run ruff check . (add --fix to automatically fix rules)
poetry run ruff format .MIT License.
Made with ❤️ by Jaya Academy.