Skip to content

tyange/tyange-dashboard

Repository files navigation

Usage

$ bun install

Available Scripts

In the project directory, you can run:

bun run dev

Runs the app in the development mode.
Open http://localhost:3001 to view it in the browser.

bun run build

Builds the app for production to the dist folder.
It correctly bundles Solid in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

Features

  • JWT login/signup flow against tyange-cms-api
  • Budget dashboard and active-period spend record views
  • Total-budget setup and active-budget total update actions for an active date range
  • Per-user API key management page at /api-keys for issuing and revoking keys used with X-API-Key

Deployment

This project deploys to AWS (Lightsail/EC2) as static files served by Nginx.

GitHub Actions workflow

  • Workflow: .github/workflows/deploy.yml
  • Trigger: push on main or manual workflow_dispatch
  • Flow:
  1. checkout
  2. bun install
  3. build (dist)
  4. upload dist by SCP
  5. switch current symlink to new release
  6. nginx -t and systemctl reload nginx

Required GitHub Secrets

  • HOST
  • USER_NAME
  • PRIVATE_SSH_KEY

Required GitHub Variables

  • DEPLOY_PATH (example: /var/www/tyange-dashboard)
  • VITE_CMS_API_BASE_URL (example: https://tyange.com/api/cms)
  • VITE_GOOGLE_CLIENT_ID (example: 1234567890-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com)

If VITE_CMS_API_BASE_URL is not set in CI, build is configured to fail fast.

Google 로그인 버튼을 사용하려면 VITE_GOOGLE_CLIENT_ID도 함께 설정해야 합니다.

Local env example

Use .env.example as the base template for local setup.
GitHub Actions creates .env.production during deploy so the build picks up both VITE_CMS_API_BASE_URL and VITE_GOOGLE_CLIENT_ID.

Server setup (one-time)

  1. Install and enable Nginx
  2. Create deploy path (/var/www/tyange-dashboard)
  3. Configure Nginx root to /var/www/tyange-dashboard/current
  4. Add SPA fallback: try_files $uri $uri/ /index.html;
  5. Run sudo nginx -t && sudo systemctl reload nginx

Rollback

Rollback is symlink-based. To rollback:

  1. Point current to previous release directory under releases/
  2. Run sudo nginx -t && sudo systemctl reload nginx

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors