- Overview
- Features
- Technologies Used
- Prerequisites
- Installation
- Configuration
- Running the Application Locally
- Deployment with Railway
- Endpoints
- Logging
- Contributing
- License
ChangeReq is a Flask web application integrated with Slack and Google Sheets. It allows users to submit change requests via Slack, which are then recorded in a Google Sheet and notified in a designated Slack channel. The application is configured for production using Gunicorn and is deployed on Railway.
- Slack Integration: Receive slash commands and interact with users through Slack modals.
- Google Sheets Integration: Store and manage change requests in a Google Sheet.
- Health Check Endpoint: Monitor the application's health status.
- Logging: Comprehensive logging for monitoring and debugging.
- Production-Ready Deployment: Configured with Gunicorn for handling production workloads.
- Python 3.8+
- Flask
- Gunicorn
- Slack SDK
- Google Sheets API (gspread)
- Railway
Before setting up the project, ensure you have the following installed:
- Python 3.8+
- pip (Python package manager)
- Git
- Railway Account (Sign up at Railway)
Follow these steps to set up the project locally:
-
Clone the Repository:
git clone https://github.com/webdevtodayjason/changereq.git cd changereq
-
Create a Virtual Environment:
conda create -n changereq python=3.12 conda activate changereq
-
Install Dependencies:
pip install -r requirements.txt
Environment Variables The application relies on several environment variables for configuration. Ensure these are set before running the application.
SLACK_BOT_TOKEN: Your Slack Bot Token. GOOGLE_CREDENTIALS_JSON: JSON string of your Google service account credentials. PORT: (Optional) Port number for the application to listen on. Defaults to 8080.
Create a .env file in the root directory of your project and add the following:
-
Set Up Environment Variables:
- Create a
.env
file in the root directory. - Add the following environment variables:
SLACK_BOT_TOKEN=<your_slack_bot_token> GOOGLE_CREDENTIALS_JSON=<your_google_credentials_json>
- Create a
To run the application locally, use the following command:
python app.py
-
Create a Railway Account:
- Sign up at Railway.
-
Create a New Project:
- Click on the "New Project" button.
- Select "GitHub" as the provider and connect your GitHub account.
- Find the repository you want to deploy and click on "Connect".
-
Configure Environment Variables:
- Go to the "Variables" tab.
- Add the following variables:
SLACK_BOT_TOKEN=<your_slack_bot_token> GOOGLE_CREDENTIALS_JSON=<your_google_credentials_json> PORT=<your_port_number>
-
Deploy the Application:
- Click on the "Deploy" button.
- Railway will build and deploy your application.
-
Access the Application:
- Once deployed, you can access your application at the URL provided by Railway.
To check the health status of the application, send a GET request to:
http://<your_railway_url>/health
To submit a change request, send a POST request to:
http://<your_railway_url>/changereq
To submit a change request via Slack modal, send a POST request to:
http://<your_railway_url>/changereq
To submit a change request via Slack modal, send a POST request to:
http://<your_railway_url>/changereq
To submit a change request via Slack modal, send a POST request to:
http://<your_railway_url>/changereq