Skip to content

Commit 2b68eca

Browse files
committed
Optimize the navbar and extend the courses
1 parent c37bba4 commit 2b68eca

12 files changed

Lines changed: 629 additions & 7 deletions

File tree

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules
2+
.next
3+
.git
4+
.gitignore
5+
README.md
6+
.env*.local
7+
*.log
8+
.DS_Store
9+
npm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
test:
11+
name: Test and Build
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Run linter
28+
run: npm run lint
29+
30+
- name: Build project
31+
run: npm run build
32+
33+
- name: Check build output
34+
run: |
35+
if [ ! -d ".next" ]; then
36+
echo "Build failed - .next directory not found"
37+
exit 1
38+
fi
39+
40+
deploy-preview:
41+
name: Deploy Preview
42+
runs-on: ubuntu-latest
43+
needs: test
44+
if: github.event_name == 'pull_request'
45+
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v4
49+
50+
- name: Deploy to Vercel Preview
51+
uses: amondnet/vercel-action@v25
52+
with:
53+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
54+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
55+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
56+
vercel-args: '--prod'
57+
58+
deploy-production:
59+
name: Deploy Production
60+
runs-on: ubuntu-latest
61+
needs: test
62+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
63+
64+
steps:
65+
- name: Checkout code
66+
uses: actions/checkout@v4
67+
68+
- name: Deploy to Vercel Production
69+
uses: amondnet/vercel-action@v25
70+
with:
71+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
72+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
73+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
74+
vercel-args: '--prod'
75+

DEPLOYMENT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Deployment Guide
2+
3+
## Quick Deploy Options
4+
5+
### 1. Vercel (Recommended - 2 minutes)
6+
7+
```bash
8+
# Install Vercel CLI
9+
npm i -g vercel
10+
11+
# Deploy
12+
vercel
13+
14+
# Production
15+
vercel --prod
16+
```
17+
18+
Or use the Vercel dashboard:
19+
1. Go to [vercel.com](https://vercel.com)
20+
2. Import your GitHub repository
21+
3. Click Deploy
22+
4. Done! 🎉
23+
24+
### 2. Netlify
25+
26+
```bash
27+
# Install Netlify CLI
28+
npm i -g netlify-cli
29+
30+
# Build
31+
npm run build
32+
33+
# Deploy
34+
netlify deploy --prod
35+
```
36+
37+
### 3. Railway
38+
39+
1. Connect GitHub repository
40+
2. Railway auto-detects Next.js
41+
3. Deploys automatically
42+
4. Get URL instantly
43+
44+
### 4. Docker Deployment
45+
46+
```bash
47+
# Build image
48+
docker build -t rust-blockchain-course .
49+
50+
# Run container
51+
docker run -p 3000:3000 rust-blockchain-course
52+
```
53+
54+
## Environment Variables
55+
56+
No environment variables needed for basic deployment.
57+
58+
## Custom Domain
59+
60+
1. **Vercel**: Settings → Domains → Add domain
61+
2. **Netlify**: Domain settings → Add custom domain
62+
3. **Railway**: Settings → Domains
63+
64+
## Performance Optimization
65+
66+
- Enable Next.js Image Optimization
67+
- Use CDN for static assets
68+
- Enable compression
69+
- Optimize bundle size
70+
71+
## Monitoring
72+
73+
- Add Vercel Analytics
74+
- Set up error tracking (Sentry)
75+
- Monitor performance (Lighthouse)
76+

Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM node:20-alpine AS base
2+
3+
FROM base AS deps
4+
RUN apk add --no-cache libc6-compat
5+
WORKDIR /app
6+
COPY package.json package-lock.json* ./
7+
RUN npm ci
8+
9+
FROM base AS builder
10+
WORKDIR /app
11+
COPY --from=deps /app/node_modules ./node_modules
12+
COPY . .
13+
RUN npm run build
14+
15+
FROM base AS runner
16+
WORKDIR /app
17+
ENV NODE_ENV=production
18+
RUN addgroup --system --gid 1001 nodejs
19+
RUN adduser --system --uid 1001 nextjs
20+
21+
COPY --from=builder /app/public ./public
22+
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
23+
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
24+
25+
USER nextjs
26+
EXPOSE 3000
27+
ENV PORT=3000
28+
CMD ["node", "server.js"]
29+

app/layout.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import "./globals.css";
44
import ParticleBackground from "@/components/ParticleBackground";
55
import ScrollToTop from "@/components/ScrollToTop";
66
import ThemeScript from "@/components/ThemeScript";
7+
import Navbar from "@/components/Navbar";
8+
import Footer from "@/components/Footer";
79

810
const inter = Inter({
911
subsets: ["latin"],
@@ -28,9 +30,11 @@ export default function RootLayout({
2830
</head>
2931
<body className="antialiased font-sans relative">
3032
<ParticleBackground />
33+
<Navbar />
3134
<div className="relative z-10">
3235
{children}
3336
</div>
37+
<Footer />
3438
<ScrollToTop />
3539
</body>
3640
</html>

app/lessons/[lessonId]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default async function LessonPage({ params }: LessonPageProps) {
3434
};
3535

3636
return (
37-
<main className="min-h-screen bg-gradient-to-br from-orange-50 via-white to-orange-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900">
37+
<main className="min-h-screen bg-gradient-to-br from-orange-50 via-white to-orange-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900 pt-24">
3838
<div className="container mx-auto px-4 py-8 max-w-4xl">
3939
<div className="mb-6">
4040
<Link

app/page.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import Link from 'next/link';
22
import { loadCourse, loadLesson } from '@/utils/dataLoader';
33
import { Course } from '@/types';
4-
import Navbar from '@/components/Navbar';
54
import Hero from '@/components/Hero';
65
import Features from '@/components/Features';
7-
import Footer from '@/components/Footer';
6+
import CareerGuide from '@/components/CareerGuide';
87

98
export default async function Home() {
109
const course: Course = await loadCourse();
@@ -31,11 +30,12 @@ export default async function Home() {
3130

3231
return (
3332
<>
34-
<Navbar />
3533
<Hero course={course} totalLessons={totalExistingLessons} />
3634

3735
<Features />
3836

37+
<CareerGuide />
38+
3939
<section id="chapters" className="py-24 bg-gradient-to-br from-gray-50 to-white dark:from-gray-900 dark:to-gray-800 relative overflow-hidden">
4040
<div className="absolute inset-0 opacity-5">
4141
<div className="absolute top-20 right-10 w-96 h-96 bg-orange-500 rounded-full blur-3xl"></div>
@@ -119,8 +119,6 @@ export default async function Home() {
119119
</div>
120120
</div>
121121
</section>
122-
123-
<Footer />
124122
</>
125123
);
126124
}

0 commit comments

Comments
 (0)