Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a5b55cc21 | ||
|
|
b03ef1ee43 |
No files matched your search
@@ -1,63 +0,0 @@
|
||||
# Astro Migration Plan
|
||||
|
||||
## Overview
|
||||
This document outlines the steps to upgrade Astro in this project while maintaining all existing functionality, including the Appwrite integration and security practices.
|
||||
|
||||
## Current State
|
||||
- Astro version: 4.5.18
|
||||
- Project structure is working with secure environment variable handling
|
||||
- Appwrite integration properly configured with credentials in .env file
|
||||
- All configuration fixes have been committed to the dev branch
|
||||
|
||||
## Migration Steps
|
||||
|
||||
### 1. Preparation
|
||||
- Ensure all local changes are committed to the dev branch
|
||||
- Create a backup of current working state (already done)
|
||||
- Verify all tests pass before starting migration
|
||||
|
||||
### 2. Update Dependencies
|
||||
```bash
|
||||
# Update Astro core package
|
||||
npm install astro@latest
|
||||
|
||||
# Update related packages
|
||||
npm install @astrojs/mdx@latest
|
||||
npm install @astrojs/tailwind@latest
|
||||
npm install @astrojs/solid-js@latest
|
||||
npm install @astrojs/sitemap@latest
|
||||
```
|
||||
|
||||
### 3. Configuration Updates
|
||||
- Review `astro.config.mjs` for any deprecated configurations
|
||||
- Update integrations syntax if needed
|
||||
- Ensure Tailwind CSS configuration remains compatible
|
||||
|
||||
### 4. Environment Variable Handling
|
||||
- Verify `import.meta.env` usage is still valid
|
||||
- Confirm Appwrite integration in `src/lib/appwrite.ts` works with new version
|
||||
- Test that `.env` variables are properly loaded
|
||||
|
||||
### 5. Component Testing
|
||||
- Test Header component with Appwrite images
|
||||
- Test Footer component with Appwrite images
|
||||
- Verify all other components still function correctly
|
||||
|
||||
### 6. Build and Deployment Verification
|
||||
- Run `npm run build` to ensure successful compilation
|
||||
- Test locally with `npm run preview`
|
||||
- Verify all images load properly from Appwrite storage
|
||||
|
||||
## Security Considerations
|
||||
- All environment variables remain in `.env` file
|
||||
- No changes to how sensitive credentials are handled
|
||||
- Migration maintains the same security practices
|
||||
|
||||
## Rollback Plan
|
||||
If issues arise during migration:
|
||||
1. Revert to previous commit: `git reset --hard HEAD~1`
|
||||
2. Check that all functionality works as before
|
||||
3. Investigate specific breaking changes in Astro release notes
|
||||
|
||||
## Timeline
|
||||
Estimated time: 2-4 hours for full migration and testing
|
||||
@@ -1,107 +0,0 @@
|
||||
# Implementation Plan for Spaghet.io Website
|
||||
|
||||
|
||||
## 1. Layout Files Fix (astro:content to Appwrite Data Types)
|
||||
**Issue:** Astro layout files are using `astro:content` types instead of Appwrite data types causing "entry" attribute errors.
|
||||
|
||||
## 2. Dark Mode Styling Improvements
|
||||
**Issues:**
|
||||
- Spaghetti theme is too hard to read in dark mode
|
||||
- Inconsistent text colors across components and layouts
|
||||
- Border on hero image is too light
|
||||
|
||||
## 3. Search Function Enhancement (Appwrite SDK Integration)
|
||||
**Status: Partially Complete**
|
||||
The search component has already been updated to use Appwrite data instead of Fuse.js client-side search, but needs refinement to properly utilize Appwrite's querying capabilities.
|
||||
|
||||
## 4. Pagination Implementation for Blogs and Projects Pages
|
||||
**Requirements:**
|
||||
- Implement pagination on both blog and projects pages
|
||||
- Allow variable item counts (10, 20, 50 items per page)
|
||||
- Use Appwrite SDK with offset/limit parameters
|
||||
- Maintain existing filtering functionality
|
||||
|
||||
## 5. Technical Implementation Details
|
||||
|
||||
### A. Layout Files Fix Strategy
|
||||
1. **Update `src/layouts/ArticleBottomLayout.astro`**:
|
||||
- Change from `CollectionEntry<"blog"> | CollectionEntry<"projects">` to Appwrite data types
|
||||
- Ensure compatibility with Appwrite document structure
|
||||
- Fix the entry attribute errors
|
||||
|
||||
### B. Dark Mode Improvements
|
||||
1. **Enhance `src/styles/global.css`**:
|
||||
- Improve text color contrast for dark mode readability
|
||||
- Adjust border colors for better visibility
|
||||
- Create consistent styling across all components
|
||||
|
||||
### C. Search Function Enhancement
|
||||
1. **Refine `src/components/Search.tsx`**:
|
||||
- Implement proper Appwrite SDK search queries
|
||||
- Add server-side filtering instead of client-side
|
||||
- Maintain existing UI functionality
|
||||
|
||||
### D. Pagination Implementation Strategy
|
||||
1. **Modify `src/pages/blog/index.astro`**:
|
||||
- Add pagination parameters (page, limit)
|
||||
- Implement Appwrite SDK with offset/limit queries
|
||||
- Create pagination controls with 10/20/50 item options
|
||||
- Maintain existing tag filtering
|
||||
|
||||
2. **Modify `src/pages/projects/index.astro`**:
|
||||
- Apply same pagination approach as blog page
|
||||
- Ensure consistent UI/UX between both pages
|
||||
|
||||
3. **Update Appwrite Service Functions**:
|
||||
- Add pagination support to getBlogPosts and getProjects functions
|
||||
- Implement proper offset/limit parameter handling
|
||||
|
||||
|
||||
## 6. Implementation Steps Timeline
|
||||
|
||||
|
||||
### Phase 1: Layout Files Fix
|
||||
- [ ] Update ArticleBottomLayout.astro to use Appwrite data types
|
||||
- [ ] Update ArticleTopLayout.astro to use Appwrite data types
|
||||
- [ ] Ensure all layout components are compatible with Appwrite data structure
|
||||
- [ ] Remove all uses and references to astro:content. No longer using astro content.
|
||||
|
||||
### Phase 2: Dark Mode Improvements
|
||||
- [ ] Improve text color contrast in global.css
|
||||
- [ ] Adjust border colors for better visibility
|
||||
- [ ] Test dark mode readability across all components
|
||||
|
||||
### Phase 3: Search Function Enhancement
|
||||
- [ ] Implement proper Appwrite SDK search functionality
|
||||
- [ ] Remove client-side filtering where possible
|
||||
- [ ] Ensure search works with Appwrite data types
|
||||
|
||||
### Phase 4: Pagination Implementation (Blog & Projects Pages)
|
||||
- [ ] Modify blog/index.astro to add pagination support
|
||||
- [ ] Modify projects/index.astro to add pagination support
|
||||
- [ ] Update appwrite-service.ts with pagination functions
|
||||
- [ ] Implement page navigation controls
|
||||
|
||||
## 7. Technical Considerations
|
||||
|
||||
1. **Appwrite Query Parameters**: Use `offset` and `limit` for pagination
|
||||
2. **Type Safety**: Maintain proper TypeScript types throughout
|
||||
3. **Performance**: Optimize queries to minimize API calls
|
||||
4. **User Experience**: Ensure smooth pagination transitions
|
||||
5. **Backward Compatibility**: Maintain existing functionality while adding new features
|
||||
|
||||
## 8. Files to Modify
|
||||
1. `src/layouts/ArticleBottomLayout.astro` - Fix data type issues
|
||||
2. `src/layouts/ArticleTopLayout.astro` - Fix data type issues
|
||||
3. `src/styles/global.css` - Improve dark mode styling
|
||||
4. `src/components/Search.tsx` - Enhance search functionality
|
||||
5. `src/pages/blog/index.astro` - Add pagination support
|
||||
6. `src/pages/projects/index.astro` - Add pagination support
|
||||
7. `src/lib/appwrite-service.ts` - Add pagination functions
|
||||
|
||||
## 9. Testing Requirements
|
||||
- Verify pagination works correctly with 10/20/50 items
|
||||
- Test all filtering and sorting functionality
|
||||
- Ensure dark mode readability is improved
|
||||
- Validate that search returns correct Appwrite data
|
||||
- Confirm layout files work with Appwrite data types
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Starting Astro migration process..."
|
||||
|
||||
# Step 1: Update dependencies
|
||||
echo "Updating Astro and related packages..."
|
||||
npm install astro@latest
|
||||
npm install @astrojs/mdx@latest
|
||||
npm install @astrojs/tailwind@latest
|
||||
npm install @astrojs/solid-js@latest
|
||||
npm install @astrojs/sitemap@latest
|
||||
|
||||
# Step 2: Check for any build issues
|
||||
echo "Checking if project builds correctly..."
|
||||
npm run build
|
||||
|
||||
# Step 3: Run tests to ensure everything works
|
||||
echo "Running tests..."
|
||||
npm test
|
||||
|
||||
echo "Migration process completed. Please review any warnings or errors above."
|
||||
Generated
+1
-1
@@ -31,10 +31,10 @@
|
||||
"tailwindcss": "^3.4.1",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.3.3",
|
||||
"appwrite": "^18.2.0",
|
||||
"vitest": "^3.2.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"appwrite": "^18.2.0",
|
||||
"dotenv-cli": "^10.0.0"
|
||||
}
|
||||
},
|
||||
|
||||
+2
-2
@@ -37,10 +37,10 @@
|
||||
"tailwindcss": "^3.4.1",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.3.3",
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^3.2.4",
|
||||
"appwrite": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"appwrite": "^18.2.0",
|
||||
"dotenv-cli": "^10.0.0"
|
||||
}
|
||||
}
|
||||
Generated
-5031
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,42 @@
|
||||
---
|
||||
/**
|
||||
* Meatballs.astro
|
||||
* This component creates meatballs that are appended to the galaxy on interval.
|
||||
* Meatballs are removed from the document after the animation is completed.
|
||||
* There are four (4) meatball shower containers, one for each diagonal direction.
|
||||
*/
|
||||
---
|
||||
|
||||
<div id="meatballs">
|
||||
<!-- rotations defined in base.css & tailwind.config.mjs -->
|
||||
<div class="shower ur" />
|
||||
<div class="shower dr" />
|
||||
<div class="shower dl" />
|
||||
<div class="shower ul" />
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function createMeatball () {
|
||||
// create a meatball
|
||||
let meatball = document.createElement("div");
|
||||
meatball.setAttribute("class", "meatball");
|
||||
meatball.style.left = Math.round(Math.random() * window.innerWidth) + "px";
|
||||
meatball.style.top = Math.round(Math.random() * window.innerHeight) + "px";
|
||||
|
||||
// append the meatball to a random meatball shower (direction)
|
||||
const showers = document.querySelectorAll(".shower");
|
||||
if (showers.length > 0) {
|
||||
const random = Math.floor(Math.random() * showers.length);
|
||||
const shower = showers[random];
|
||||
shower.append(meatball);
|
||||
}
|
||||
|
||||
// remove the meatball after the animation duration
|
||||
setTimeout(() => {
|
||||
meatball.remove();
|
||||
}, 3500);
|
||||
}
|
||||
|
||||
// Create meatballs on interval on two (2) seconds
|
||||
setInterval(createMeatball, 1500);
|
||||
</script>
|
||||
@@ -0,0 +1,61 @@
|
||||
---
|
||||
/**
|
||||
* NoodleTwinklingStars.astro
|
||||
* This component creates twinkling noodles that are appended to the galaxy on interval.
|
||||
* Twinkling noodles are removed from the document after the animation is completed.
|
||||
* The svg below is just a template for the script to clone and append to the galaxy.
|
||||
*/
|
||||
---
|
||||
|
||||
<svg
|
||||
id="noodle"
|
||||
class="template"
|
||||
width="149"
|
||||
height="149"
|
||||
viewBox="0 0 149 149"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="absolute left-full animate-twinkle"
|
||||
>
|
||||
<circle cx="74" cy="74" r="11" fill="#FF6B6B"/>
|
||||
<rect y="141.421" width="200" height="10" transform="rotate(-45 0 141.421)" fill="url(#paint0_linear_4_2)"/>
|
||||
<rect x="7.07107" width="200" height="10" transform="rotate(45 7.07107 0)" fill="url(#paint1_linear_4_2)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_4_2" x1="0" y1="146.421" x2="200" y2="146.421" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FF6B6B"/>
|
||||
<stop offset="0.445" stop-color="white"/>
|
||||
<stop offset="0.58721" stop-color="white"/>
|
||||
<stop offset="1" stop-color="#FF6B6B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_4_2" x1="7.07107" y1="5" x2="207.071" y2="5" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FF6B6B"/>
|
||||
<stop offset="0.42" stop-color="white"/>
|
||||
<stop offset="0.555" stop-color="white"/>
|
||||
<stop offset="1" stop-color="#FF6B6B"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
||||
<script is:inline>
|
||||
// Generate a twinkling noodle and append it to the galaxy, remove it after animation.
|
||||
function generateNoodle() {
|
||||
const noodleTemplate = document.getElementById("noodle")
|
||||
if (!noodleTemplate) { return; }
|
||||
// Clone the noodle template and set its attributes.
|
||||
const noodle = noodleTemplate.cloneNode(true);
|
||||
noodle.style.position = "absolute";
|
||||
noodle.style.left = Math.floor(Math.random() * window.innerWidth) + "px";
|
||||
noodle.style.top = Math.floor(Math.random() * (window.innerHeight/3)) + "px";
|
||||
noodle.style.width = window.innerWidth < 768 ? Math.floor(Math.random() * (15 - 7.5 + 1) + 7.5) : Math.floor(Math.random() * (30 - 15 + 1) + 15) + "px";
|
||||
noodle.style.height = noodle.style.width;
|
||||
noodle.classList.add("twinkle");
|
||||
document.getElementById("galaxy").appendChild(noodle);
|
||||
|
||||
// Remove the twinkling noodle after the animation is completed.
|
||||
setTimeout(() => {
|
||||
noodle.remove();
|
||||
}, 2500);
|
||||
}
|
||||
|
||||
setInterval(generateNoodle, 5000);
|
||||
</script>
|
||||
@@ -4,8 +4,8 @@ import PageLayout from "@layouts/PageLayout.astro"
|
||||
import ArrowCard from "@components/ArrowCard"
|
||||
import StackCard from "@components/StackCard.astro"
|
||||
import { SITE, SOCIALS } from "@consts"
|
||||
import TwinklingStars from "@components/TwinklingStars.astro"
|
||||
import MeteorShower from "@components/MeteorShower.astro"
|
||||
import NoodleTwinklingStars from "@components/NoodleTwinklingStars.astro"
|
||||
import MeatballShower from "@components/MeatballShower.astro"
|
||||
|
||||
// Fetch blog posts and projects from Appwrite
|
||||
const posts = (await getBlogPosts())
|
||||
@@ -66,8 +66,8 @@ const stack = [
|
||||
<!-- Dark Theme: Twinkling Stars / Meteor Shower -->
|
||||
<div id="galaxy" class="fixed inset-0">
|
||||
<div class="hidden dark:block">
|
||||
<TwinklingStars/>
|
||||
<MeteorShower/>
|
||||
<NoodleTwinklingStars/>
|
||||
<MeatballShower/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -280,6 +280,50 @@ article img {
|
||||
@apply rotate-315;
|
||||
}
|
||||
|
||||
/**
|
||||
* TWINKLE NOODLES
|
||||
*/
|
||||
|
||||
#noodle.template {
|
||||
@apply absolute -left-full; /* hide offscreen */
|
||||
}
|
||||
|
||||
#noodle.twinkle {
|
||||
@apply animate-twinkle; /* defined in tailwind.config */
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Meatballs
|
||||
*/
|
||||
|
||||
#meatballs .shower {
|
||||
@apply absolute inset-0 top-0;;
|
||||
@apply left-1/2 -translate-x-1/2;
|
||||
@apply w-screen aspect-square;
|
||||
}
|
||||
|
||||
#meatballs .meatball {
|
||||
@apply animate-meatball; /* defined in tailwind.config */
|
||||
@apply absolute top-1/2 left-1/2 w-px h-[75vh];
|
||||
@apply bg-gradient-to-b from-white to-transparent;
|
||||
}
|
||||
|
||||
#meatballs .shower.ur {
|
||||
@apply rotate-45;
|
||||
}
|
||||
|
||||
#meatballs .shower.dr {
|
||||
@apply rotate-135;
|
||||
}
|
||||
|
||||
#meatballs .shower.dl {
|
||||
@apply rotate-225;
|
||||
}
|
||||
|
||||
#meatballs .shower.ul {
|
||||
@apply rotate-315;
|
||||
}
|
||||
.copy-cnt{
|
||||
@apply absolute w-full;
|
||||
top:var(--copy-btn-margin);
|
||||
|
||||
@@ -61,6 +61,7 @@ export default {
|
||||
animation: {
|
||||
twinkle: "twinkle 2s ease-in-out forwards",
|
||||
meteor: "meteor 3s ease-in-out forwards",
|
||||
meatball: "meatball 3s ease-in-out forwards",
|
||||
},
|
||||
keyframes: {
|
||||
twinkle: {
|
||||
@@ -90,6 +91,19 @@ export default {
|
||||
transform: "translateY(0)"
|
||||
},
|
||||
},
|
||||
meatball: {
|
||||
"0%": {
|
||||
opacity: 0,
|
||||
transform: "translateY(200%)"
|
||||
},
|
||||
"50%": {
|
||||
opacity: 1
|
||||
},
|
||||
"100%": {
|
||||
opacity: 0,
|
||||
transform: "translateY(0)"
|
||||
},
|
||||
},
|
||||
},
|
||||
colors: {
|
||||
spaghetti: {
|
||||
|
||||
Reference in new issue
Block a user