This project implements a modern web application architecture leveraging Cloudflare's edge computing capabilities. The architecture consists of two primary components:
- React Frontend: A Single Page Application (SPA) built with React and TypeScript
- Cloudflare Pages: Static site hosting with global CDN distribution
- Node.js (v16.0.0 or higher)
- npm (v7.0.0 or higher)
- Cloudflare account
- Last.fm account and API key
- Git
-
Last.fm API Key:
- Visit Last.fm API Account Creation
- Sign in with your Last.fm account
- Fill in the application details
- Save your API key
- Your username can be found in your profile URL: last.fm/user/YOUR_USERNAME
-
Cloudflare Setup:
- Create an account at Cloudflare
- Get your Account ID from the dashboard
- Create an API token with Pages deployment permissions
- Clone the repository:
git clone https://github.com/EndofTimee/personal-site
cd personal-site
- Create a
.env
file in the root directory:
VITE_LASTFM_API_KEY=your_lastfm_api_key
VITE_LASTFM_USERNAME=your_lastfm_username
CLOUDFLARE_API_TOKEN=your_cloudflare_api_token
CLOUDFLARE_ACCOUNT_ID=your_cloudflare_account_id
- Install dependencies:
npm install
Start the development server:
npm start
The application will be available at http://localhost:3000
The project follows a modular component structure:
src/
├── components/
│ ├── LastFMTrack/ # Music integration
│ ├── GithubRepos/ # GitHub repository display
│ ├── LoadingFox/ # Loading states
│ └── ParallaxEffect/ # Visual effects
├── App.tsx # Main application component
└── index.tsx # Application entry point
The project includes a PowerShell deployment script:
npm run deploy
This script:
- Loads environment variables
- Installs dependencies
- Builds the React application
- Deploys to Cloudflare Pages
- Sets up environment secrets
If you need to deploy manually:
npm run build
npx wrangler pages deploy ./dist
-
Build settings:
- Build command:
npm run build
- Build output directory:
dist
- Node.js version: 16 (or higher)
- Build command:
-
Environment variables:
- Production branch:
main
- Preview branches:
dev/*
- Production branch:
-
Build Issues:
# Clear dependency cache rm -rf node_modules npm clean-cache --force npm install
-
Environment Variables:
# Verify environment variables npx wrangler secret list
- Fork the repository
- Create a feature branch
- Commit changes
- Push to the branch
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details