SkillBase is a Django-based application that integrates with Slack to manage user skills, location, and section. Users can log in via Slack, add their skills, city, and section, and the application automatically updates this information in their Slack profile. A Slack command is also available to search for users with specific skills.
- Slack OAuth Integration: Users sign in with their Slack account.
- Skill Management: Users can add and update their skills.
- Location and Section Tracking: Tracks user's city and organizational section.
- Slack Profile Synchronization: Automatically updates custom fields in Slack profiles.
- Slack Commands: Use
/findskill [skill]to find users with specific skills. - REST API: Access user data programmatically.
- Python 3.8+
- Django 5.2+
- Slack Workspace with admin privileges
- Docker (optional)
-
Clone the repository:
git clone https://github.com/michu999/SkillBase.git cd SkillBase -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables in
.envfile:DJANGO_SECRET_KEY=your_secret_key DEBUG=True DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1 SLACK_BOT_TOKEN=your_slack_bot_token -
Create SSL certificates for development:
mkdir -p certs openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout certs/key.pem -out certs/cert.pem
-
Run migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver_plus --cert-file certs/cert.pem --key-file certs/key.pem 0.0.0.0:8443
docker-compose up- Create a new Slack App at api.slack.com/apps
- Enable OAuth and set the following scopes:
openidemailprofile
- Add OAuth Redirect URLs pointing to your app's
/accounts/slack/login/callback/endpoint - Install the app to your workspace
slack_integration/services.py to match your Slack workspace's custom profile fields.
In the update_user_profile method of SlackProfileService, you need to change the field IDs to match your Slack workspace's custom profile fields.
Example:
"Xf08NAUR6K1N": { # Skills field ID
"value": ", ".join(skills) if skills else "",
"alt": ""
},
"Xf03VBLQB0TA": { # City field ID
"value": city if city else "",
"alt": ""
},
"Xf08PMME6KJS": { # Section field ID
"value": section if section else "",
"alt": ""
}-
Create custom profile fields in your Slack workspace:
Admin → Settings & Permissions → Profiles -
Use the Slack API explorer or your browser's developer tools to inspect your profile and locate the field IDs for your custom fields.
The REST API provides the following endpoints:
GET /api/users/- List all usersGET /api/users/{id}/- Get specific user detailsGET /api/skills/- List all skills in the system
For more details, see the API documentation in the /docs endpoint when running the application.
Run the test suite with:
python manage.py test