This is the web frontend for the Glowing Telegram project, designed to manage and schedule live streams, manage stream recordings, and edit episodes from the stream recordings into YouTube videos.
- Clone the repository.
- Install dependencies:
npm install
- Copy the example environment configuration:
cp .env.defaults .env
- Update the environment configuration with your settings.
- Start development server:
npm run start
- Visit http://localhost:5173 in your browser.
- Run tests:
npm test
- Launch Storybook for UI components:
npm run storybook
- Build project for production:
npm run build
- React Admin for data-driven pages
- React Router for routing
- Material UI for components
- MSW for mocking API requests
- Vitest for testing
- Storybook for UI component documentation
- Biome for formatting and linting
- /src: application code
- /resources: React Admin resources
- /components: shared components
- /hooks: custom hooks
- /mocks: MSW service worker mocking setup
- /public: static assets
- package.json: scripts and dependencies
- .env.defaults: example environment configuration
This project uses GitHub Actions to automate the deployment process to AWS S3 with advanced version management capabilities. While the deployment steps are fully automated, deployments must be manually triggered via the GitHub Actions interface and support multiple environments.
- Navigate to GitHub Actions: Go to the repository's Actions tab on GitHub
- Select Workflow: Choose "Publish to s3" workflow
- Trigger Deployment: Click "Run workflow" and provide:
- Release version: Semantic version number (e.g.,
1.2.3
) - Environment: Target environment name (configured in GitHub repository settings)
- Rollback version: Version to revert to on failure (e.g., the previous stable release or a version known to be working in your environment)
- Release version: Semantic version number (e.g.,
Before deploying, ensure the following are configured in GitHub:
- Environments must be configured in GitHub repository settings
- Each environment should have the required variables and secrets
Each deployment environment needs these variables configured:
API_URL
: Backend API endpoint URLAWS_REGION
: AWS region for deployment (e.g.,us-west-2
)AWS_ROLE_ARN
: IAM role ARN for AWS authenticationBUCKET_NAME
: S3 bucket name for deploymentCOGNITO_CLIENT_ID
: AWS Cognito client IDCOGNITO_USER_POOL_ID
: AWS Cognito user pool IDCOGNITO_DOMAIN
: AWS Cognito domainLOGOUT_URI
: Logout redirect URIREDIRECT_URI
: Authentication redirect URITWITCH_CLIENT_ID
: Twitch API client IDWEBSOCKET_URL
: WebSocket endpoint URLCONTENT_URL
: Content delivery URL
The deployment workflow performs these steps:
- Setup: Checks out code and sets up Node.js 22
- Dependencies: Installs dependencies with
npm ci
- Build: Builds the application with environment-specific configuration
- AWS Setup: Configures AWS credentials using the provided IAM role
- Deploy: Syncs the built files to the specified S3 bucket under the release version path
- Version Info: Creates and uploads a comprehensive version configuration file
The deployment workflow supports dynamic version switching through a version info system:
- The
publish.yml
GitHub Actions workflow deploys each release to a versioned folder in S3:s3://bucket/v1.2.3/
- After successful deployment, a
config/version.json
file is created and uploaded tos3://bucket/config/version.json
- The version file contains the current version configuration:
{
"version": "0.4.0",
"description": "Current frontend version configuration",
"lastUpdated": "2024-01-01T00:00:00Z",
"rollbackVersion": "0.3.0",
"metadata": {
"deployedBy": "github-actions",
"environment": "production"
}
}
To rollback without redeploying:
- Manually update the
config/version.json
file in S3 to point to the desired version - Example: Change
"version": "0.4.0"
to"version": "0.3.0"
and update the"rollbackVersion"
field - CloudFront will serve the previous version immediately
- Instant version switching without infrastructure changes
- Simple rollback mechanism
- Prepares for advanced deployment strategies (A/B testing, canary deployments)
- Use semantic versioning (e.g.,
1.0.0
,1.2.3-beta.1
) - Each release is deployed to a separate path in S3:
s3://bucket-name/release-version/
- This allows for easy rollbacks and multiple version hosting
Before deploying, test the production build locally:
npm run build
npm run serve
Visit http://localhost:4173 to verify the production build works correctly.
- Fork the repository and create a new branch.
- Commit changes with clear messages.
- Open a pull request for review.
This project is licensed under the AGPL-3.0-only. Please see the LICENSE file for more details.