Skip to content

Commit a65bef6

Browse files
authored
Merge pull request #48 from RafaelJohn9/feat/docs
Feat/docs
2 parents 80d8e9e + 6ce38b1 commit a65bef6

66 files changed

Lines changed: 27058 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy-docs.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy Docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
paths:
7+
- 'docs/**'
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
19+
jobs:
20+
deploy:
21+
environment:
22+
name: github-pages
23+
url: ${{ steps.deployment.outputs.page_url }}
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '18'
33+
cache: 'npm'
34+
cache-dependency-path: './docs/package-lock.json'
35+
36+
- name: Install dependencies
37+
run: |
38+
cd docs
39+
npm ci
40+
41+
- name: Build website
42+
run: |
43+
cd docs
44+
npm run build
45+
46+
- name: Setup Pages
47+
uses: actions/configure-pages@v4
48+
49+
- name: Upload artifact
50+
uses: actions/upload-pages-artifact@v3
51+
with:
52+
path: './docs/build'
53+
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

docs/.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

docs/README.md

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
# MpesaKit Landing Page Components
2+
3+
A collection of modular, reusable TSX components for building modern landing pages in Docusaurus, specifically designed for the MpesaKit Python M-Pesa SDK documentation site.
4+
5+
## Components Overview
6+
7+
### Core Components
8+
9+
1. **HeroSection** - Main landing section with title, description, badges, and CTAs
10+
2. **StatsSection** - Statistics display with animated counters
11+
3. **FeaturesSection** - Feature cards with icons and descriptions
12+
4. **SecuritySection** - Security features with visual layers
13+
5. **APIStatusSection** - Real-time API status monitoring
14+
6. **DocumentationSection** - Documentation links and resources
15+
7. **CTASection** - Call-to-action with installation instructions
16+
8. **Footer** - Footer with links and social media
17+
9. **MpesaKitLanding** - Complete landing page combining all components
18+
19+
## Installation
20+
21+
1. Copy the component files to your Docusaurus `src/components/` directory
22+
2. Copy the CSS module to the same directory
23+
3. Install any required dependencies (React is already included in Docusaurus)
24+
25+
```bash
26+
src/
27+
├── components/
28+
│ ├── MpesaKit.module.css
29+
│ ├── HeroSection.tsx
30+
│ ├── StatsSection.tsx
31+
│ ├── FeaturesSection.tsx
32+
│ ├── SecuritySection.tsx
33+
│ ├── APIStatusSection.tsx
34+
│ ├── DocumentationSection.tsx
35+
│ ├── CTASection.tsx
36+
│ ├── Footer.tsx
37+
│ ├── MpesaKitLanding.tsx
38+
│ └── index.ts
39+
```
40+
41+
## Usage
42+
43+
### Complete Landing Page
44+
45+
```tsx
46+
import React from 'react';
47+
import Layout from '@theme/Layout';
48+
import { MpesaKitLanding } from '../components/MpesaKitLanding';
49+
50+
export default function Home(): JSX.Element {
51+
return (
52+
<Layout title="MpesaKit" description="Python M-Pesa SDK">
53+
<MpesaKitLanding />
54+
</Layout>
55+
);
56+
}
57+
```
58+
59+
### Individual Components
60+
61+
```tsx
62+
import React from 'react';
63+
import { HeroSection, StatsSection } from '../components';
64+
65+
const CustomPage: React.FC = () => {
66+
const heroData = {
67+
title: "Your Project",
68+
description: "Project description",
69+
badges: ["Feature 1", "Feature 2"],
70+
primaryCTA: { text: "Get Started", href: "/docs" },
71+
secondaryCTA: { text: "GitHub", href: "/github" }
72+
};
73+
74+
const statsData = [
75+
{ number: "99%", label: "Uptime" },
76+
{ number: "1M+", label: "Downloads" }
77+
];
78+
79+
return (
80+
<>
81+
<HeroSection {...heroData} />
82+
<StatsSection stats={statsData} />
83+
</>
84+
);
85+
};
86+
```
87+
88+
## Component Props
89+
90+
### HeroSection
91+
92+
```typescript
93+
interface HeroSectionProps {
94+
title: string;
95+
description: string;
96+
badges: string[];
97+
primaryCTA: { text: string; href: string };
98+
secondaryCTA: { text: string; href: string };
99+
}
100+
```
101+
102+
### StatsSection
103+
104+
```typescript
105+
interface StatsSectionProps {
106+
stats: Array<{
107+
number: string;
108+
label: string;
109+
}>;
110+
}
111+
```
112+
113+
### FeaturesSection
114+
115+
```typescript
116+
interface FeaturesSectionProps {
117+
title: string;
118+
subtitle: string;
119+
features: Array<{
120+
icon: string;
121+
title: string;
122+
description: string;
123+
features: string[];
124+
}>;
125+
}
126+
```
127+
128+
## Customization
129+
130+
### Colors and Themes
131+
132+
The components use CSS custom properties (variables) defined in the CSS module:
133+
134+
```css
135+
:root {
136+
--mpesa-green: #00D13A;
137+
--mpesa-dark-green: #00B032;
138+
--mpesa-light-green: #4AE668;
139+
--dark-bg: #0a0a0a;
140+
--card-bg: rgba(255, 255, 255, 0.05);
141+
/* ... more variables */
142+
}
143+
```
144+
145+
To customize colors, modify these variables in your CSS or override them in your Docusaurus custom CSS.
146+
147+
### Responsive Design
148+
149+
All components are fully responsive with breakpoints at:
150+
151+
- 768px (tablet)
152+
- 480px (mobile)
153+
154+
### Animations
155+
156+
Components include:
157+
158+
- Fade-in animations using Intersection Observer
159+
- Slide-in animations for hero content
160+
- Hover effects on cards and buttons
161+
- Typewriter effect for code demo
162+
163+
## Features
164+
165+
- **Modular Design**: Use individual components or the complete landing page
166+
- **TypeScript Support**: Full type definitions included
167+
- **Responsive**: Works on all device sizes
168+
- **Accessible**: Semantic HTML and proper contrast ratios
169+
- **Performant**: Optimized animations and efficient rendering
170+
- **Customizable**: Easy to modify colors, content, and layout
171+
172+
## Browser Support
173+
174+
- Chrome/Edge 90+
175+
- Firefox 88+
176+
- Safari 14+
177+
- Mobile browsers with CSS Grid support
178+
179+
## Dependencies
180+
181+
- React 16.8+ (for hooks)
182+
- CSS Grid and Flexbox support
183+
- Intersection Observer API (polyfill available if needed)
184+
185+
## Best Practices
186+
187+
1. **Data Structure**: Keep component data in separate files or use a CMS
188+
2. **Performance**: Use React.memo for components that don't change often
189+
3. **Accessibility**: Test with screen readers and keyboard navigation
190+
4. **SEO**: Ensure proper heading hierarchy and meta descriptions
191+
192+
## Troubleshooting
193+
194+
### Common Issues
195+
196+
1. **CSS not loading**: Ensure the CSS module is imported in your component
197+
2. **Animations not working**: Check if Intersection Observer is supported
198+
3. **Layout breaks**: Verify CSS Grid browser support
199+
200+
### Debug Mode
201+
202+
Add this to your CSS for debugging layout issues:
203+
204+
```css
205+
.debug * {
206+
border: 1px solid red !important;
207+
}
208+
```
209+
210+
## Contributing
211+
212+
To modify these components:
213+
214+
1. Update the TypeScript interfaces in `types/index.ts`
215+
2. Modify component logic in individual component files
216+
3. Update styles in `MpesaKit.module.css`
217+
4. Test responsiveness across devices
218+
5. Update documentation
219+
220+
## License
221+
222+
These components are designed for the MpesaKit project and follow the same open-source license.

0 commit comments

Comments
 (0)