An open API service indexing awesome lists of open source software.

https://github.com/garret1u/sharepoint-exporter

Modern Next.js web application for exporting SharePoint Online site structures to multiple formats (CSV, JSON, HTML). Built to replace legacy PowerShell-based solutions with a user-friendly web interface.
https://github.com/garret1u/sharepoint-exporter

business-tools export-tool microsoft-graph msal nextjs office365 react sharepoint tailwindcss typescript vercel

Last synced: 5 days ago
JSON representation

Modern Next.js web application for exporting SharePoint Online site structures to multiple formats (CSV, JSON, HTML). Built to replace legacy PowerShell-based solutions with a user-friendly web interface.

Awesome Lists containing this project

README

          

# SharePoint Structure Exporter

A modern Next.js web application for exporting SharePoint Online site structures to multiple formats (CSV, JSON, HTML). Built to replace the legacy PowerShell-based solution with a user-friendly web interface.

## Features

- 🔐 **Secure Authentication**: Microsoft Graph OAuth 2.0 with read-only permissions
- 📊 **Multiple Export Formats**: CSV for analysis, JSON for automation, HTML for presentation
- ⚡ **Fast Performance**: Client-side processing with Web Workers for large datasets
- 🎨 **Modern UI**: Clean, responsive interface built with Tailwind CSS
- 🔒 **Privacy-First**: All processing happens in your browser, no data stored on servers
- 📱 **Mobile Friendly**: Works on desktop, tablet, and mobile devices

## Getting Started

### Prerequisites

1. **Azure App Registration**:
- Go to [Azure Portal](https://portal.azure.com) > App registrations
- Create a new registration
- Add redirect URI: `http://localhost:3000` (for development)
- Grant API permissions:
- `Sites.Read.All`
- `Files.Read.All`
- `Directory.Read.All`

2. **Environment Variables**:
Copy `.env.local` and fill in your Azure app details:
```bash
NEXT_PUBLIC_AZURE_CLIENT_ID=your_client_id_here
NEXT_PUBLIC_AZURE_TENANT_ID=your_tenant_id_here
NEXT_PUBLIC_SHAREPOINT_TENANT=yourcompany.sharepoint.com
```

### Installation

1. **Clone and Install**:
```bash
git clone
cd sharepoint-exporter
npm install
```

2. **Development**:
```bash
npm run dev
```
Open [http://localhost:3000](http://localhost:3000)

3. **Build for Production**:
```bash
npm run build
npm start
```

## Architecture

### Tech Stack
- **Framework**: Next.js 14 with App Router
- **Authentication**: MSAL.js with Microsoft Graph
- **Styling**: Tailwind CSS with custom design system
- **Processing**: Client-side with streaming for large datasets
- **Deployment**: Vercel-optimized

### Key Components

- **AuthProvider**: Manages Microsoft authentication state
- **ExportForm**: Main export configuration and execution
- **API Routes**: Server-side Graph API integration
- **Progress Tracking**: Real-time export status updates

### API Endpoints

- `GET /api/sites` - List all SharePoint sites (paginated)
- `GET /api/sites/[siteId]/lists` - Get lists for a specific site
- `POST /api/export` - Execute full structure export

## Usage

1. **Sign In**: Click "Sign in with Microsoft" and authenticate
2. **Configure Export**:
- Choose output format (CSV, JSON, HTML)
- Set maximum depth for traversal
- Toggle metadata options
3. **Export**: Click "Start Export" and wait for completion
4. **Download**: File automatically downloads when ready

## Export Options

- **Include Metadata**: Add file sizes, creation dates, and modification dates
- **Calculate Storage**: Compute storage usage for folders and libraries
- **Exclude System Libraries**: Skip hidden and system libraries
- **Max Depth**: Control how deep to traverse folder structures

## Deployment

### Vercel (Recommended)
1. Connect your repository to Vercel
2. Set environment variables in Vercel dashboard
3. Update Azure App Registration redirect URI to your Vercel domain
4. Deploy

### Other Platforms
The app works on any Node.js hosting platform:
- Netlify
- AWS Amplify
- Azure Static Web Apps
- Self-hosted with Docker

## Security

- **Read-Only Access**: Only reads SharePoint data, never modifies
- **Client-Side Processing**: Data processed in browser, not on servers
- **No Data Persistence**: Nothing stored after export completes
- **Modern Authentication**: Uses Microsoft's secure OAuth 2.0 flow

## Troubleshooting

### Authentication Issues
- Verify Azure app registration permissions
- Check redirect URI configuration
- Ensure tenant ID is correct

### Export Failures
- Check browser console for errors
- Verify SharePoint site permissions
- Try reducing max depth for large sites

### Performance Issues
- Large exports may take several minutes
- Browser may become unresponsive during processing
- Consider using smaller depth limits for initial tests

## Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Test thoroughly
5. Submit a pull request

## License

MIT License - see LICENSE file for details

## Support

For issues and questions:
1. Check the troubleshooting guide above
2. Review browser console for errors
3. Create an issue with detailed information about your setup

---

Built with ❤️ using Next.js, TypeScript, and Microsoft Graph API