|
| 1 | +# Quick Start Guide: GitHub Events Analytics |
| 2 | + |
| 3 | +This guide provides the essential steps to get the GitHub Events Analytics project up and running quickly. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Docker and Docker Compose installed |
| 8 | +- Git installed |
| 9 | +- A GitHub API token (get one from https://github.com/settings/tokens) |
| 10 | + |
| 11 | +## Step 1: Set Up Environment |
| 12 | + |
| 13 | +1. Create a `.env` file from the template: |
| 14 | + |
| 15 | +```bash |
| 16 | +cp .env.template .env |
| 17 | +``` |
| 18 | + |
| 19 | +2. Edit the `.env` file and add your GitHub API token: |
| 20 | + |
| 21 | +``` |
| 22 | +GITHUB_API_TOKEN=your_github_token_here |
| 23 | +``` |
| 24 | + |
| 25 | +## Step 2: Start the System |
| 26 | + |
| 27 | +Run the start script: |
| 28 | + |
| 29 | +```bash |
| 30 | +./start.sh |
| 31 | +``` |
| 32 | + |
| 33 | +This will start all components: |
| 34 | +- Zookeeper and Kafka |
| 35 | +- PostgreSQL database |
| 36 | +- GitHub Events collector |
| 37 | +- Spark streaming job |
| 38 | +- Grafana dashboards |
| 39 | + |
| 40 | +## Step 3: Verify the System |
| 41 | + |
| 42 | +1. Check that all services are running: |
| 43 | + |
| 44 | +```bash |
| 45 | +docker-compose -f docker/docker-compose.yml ps |
| 46 | +``` |
| 47 | + |
| 48 | +2. Access the Kafka UI to see events being collected: |
| 49 | + - Open http://localhost:8080 in your browser |
| 50 | + - Navigate to the "Topics" section |
| 51 | + - Check that the `github-events` topic exists and has messages |
| 52 | + |
| 53 | +3. Access Grafana to see the analytics dashboards: |
| 54 | + - Open http://localhost:3000 in your browser |
| 55 | + - Login with username `admin` and password `admin` |
| 56 | + - Navigate to the "GitHub Events Overview" dashboard |
| 57 | + |
| 58 | +## Step 4: Test Data Flow |
| 59 | + |
| 60 | +1. Check that events are being collected: |
| 61 | + |
| 62 | +```bash |
| 63 | +docker logs github-events-collector |
| 64 | +``` |
| 65 | + |
| 66 | +2. Check that events are being processed: |
| 67 | + |
| 68 | +```bash |
| 69 | +docker logs spark-streaming |
| 70 | +``` |
| 71 | + |
| 72 | +3. Check that data is being stored in PostgreSQL: |
| 73 | + |
| 74 | +```bash |
| 75 | +docker exec -it postgres psql -U postgres -d github_events -c "SELECT COUNT(*) FROM events;" |
| 76 | +``` |
| 77 | + |
| 78 | +## Step 5: Explore the Data |
| 79 | + |
| 80 | +In Grafana, explore the different visualizations: |
| 81 | +- Repository popularity trends |
| 82 | +- Event type distribution |
| 83 | +- User activity |
| 84 | +- Programming language trends |
| 85 | + |
| 86 | +## Step 6: Stop the System |
| 87 | + |
| 88 | +When you're done, stop all services: |
| 89 | + |
| 90 | +```bash |
| 91 | +docker-compose -f docker/docker-compose.yml down |
| 92 | +``` |
| 93 | + |
| 94 | +## Troubleshooting |
| 95 | + |
| 96 | +If you encounter issues: |
| 97 | + |
| 98 | +1. Check the logs of specific components: |
| 99 | +```bash |
| 100 | +docker logs <container-name> |
| 101 | +``` |
| 102 | + |
| 103 | +2. Verify that all services can communicate with each other |
| 104 | +3. Check that your GitHub API token is valid |
| 105 | +4. Ensure Docker has enough resources allocated |
| 106 | + |
| 107 | +## Next Steps |
| 108 | + |
| 109 | +- Read the `LEARNING_GUIDE.md` for a deeper understanding of the system |
| 110 | +- Explore the code in each component to understand how they work |
| 111 | +- Try modifying the dashboards in Grafana to create custom visualizations |
| 112 | +- Consider extending the system with additional metrics or data sources |
0 commit comments