amira-02/AutoGenrerate_Backend

C#

0

23 commits

updated Jun 10, 2026

See the code

README

markdown# πŸ€– AutoGenerate β€” AI-Powered Social Media Post Generator

AutoGenerate is a full-stack web application that allows users to generate AI-powered social media posts using a prompt or a JSON file, and publish them across multiple platforms.


πŸš€ Tech Stack

Frontend

  • React + TypeScript (TSX)
  • Vite β€” build tool
  • Tailwind CSS β€” styling
  • React Router DOM β€” navigation
  • Framer Motion β€” animations
  • Axios β€” HTTP client
  • JWT Decode β€” token decoding
  • React Icons + Lucide React β€” icons

Backend

  • .NET 8 β€” ASP.NET Core Web API
  • Entity Framework Core β€” ORM
  • SQL Server β€” database
  • JWT Authentication β€” secure auth
  • Groq AI β€” text generation
  • HuggingFace API β€” image generation
  • SMTP β€” email OTP service

πŸ“ Project Structure

AutoGenerate/
    Backend/
    β”œβ”€β”€ appsettings.json
    β”œβ”€β”€ appsettings.Development.json
    β”œβ”€β”€ Program.cs
    β”œβ”€β”€ AutoGenerate.csproj
    β”œβ”€β”€ Dockerfile
    β”‚
    β”œβ”€β”€ AiService/
    β”‚   β”œβ”€β”€ AiController.cs
    β”‚   β”œβ”€β”€ AiRecommendation.cs
    β”‚   └── RecommendationsRequestDto.cs
    β”‚
    β”œβ”€β”€ AuthService/
    β”‚   β”œβ”€β”€ AuthController.cs
    β”‚   β”œβ”€β”€ EmailService.cs
    β”‚   β”œβ”€β”€ JwtService.cs
    β”‚   β”œβ”€β”€ LoginRequest.cs
    β”‚   β”œβ”€β”€ OtpCode.cs
    β”‚   β”œβ”€β”€ OtpService.cs
    β”‚   β”œβ”€β”€ RegisterRequest.cs
    β”‚   └── VerifyOtpRequest.cs
    β”‚
    β”œβ”€β”€ CaptionService/
    β”‚   β”œβ”€β”€ Caption.cs
    β”‚   β”œβ”€β”€ CaptionController.cs
    β”‚   β”œβ”€β”€ ChatDto.cs
    β”‚   β”œβ”€β”€ ChatHistoryItem.cs
    β”‚   β”œβ”€β”€ ConfirmCaptionDto.cs
    β”‚   β”œβ”€β”€ GenerateCaptionDto.cs
    β”‚   β”œβ”€β”€ SaveCaptionDto.cs
    β”‚   β”œβ”€β”€ UpdateCaptionDto.cs
    β”‚   β”œβ”€β”€ UpdateMediaDto.cs
    β”‚   └── UpdatePostParamsDto.cs
    β”‚
    β”œβ”€β”€ Enum/
    β”‚   └── PostStatus.cs
    β”‚
    β”œβ”€β”€ ExternalTasks/
    β”‚   β”œβ”€β”€ AssignTaskDto.cs
    β”‚   β”œβ”€β”€ ExternalTaskController.cs
    β”‚   └── ExternalTaskDto.cs
    β”‚
    β”œβ”€β”€ ImageService/
    β”‚   β”œβ”€β”€ GenerateImageDto.cs
    β”‚   β”œβ”€β”€ ImageController.cs
    β”‚   β”œβ”€β”€ SaveImageUrlDto.cs
    β”‚   └── SetImageUrlDto.cs
    β”‚
    β”œβ”€β”€ Notifications/
    β”‚   └── Notifications.cs
    β”‚
    β”œβ”€β”€ PostService/
    β”‚   β”œβ”€β”€ CreatePostDto.cs
    β”‚   β”œβ”€β”€ PostDto.cs
    β”‚   β”œβ”€β”€ PostResponseDto.cs
    β”‚   β”œβ”€β”€ PostResultDto.cs
    β”‚   β”œβ”€β”€ PostsController.cs
    β”‚   β”œβ”€β”€ RescheduleRequest.cs
    β”‚   β”œβ”€β”€ ScheduleDto.cs
    β”‚   └── UpdateStatusDto.cs
    β”‚
    β”œβ”€β”€ Shared/
    β”‚   β”œβ”€β”€ Clients/
    β”‚   β”‚   └── ClientsController.cs
    β”‚   β”œβ”€β”€ Converters/
    β”‚   β”‚   └── DateTimeUtcConverter.cs
    β”‚   β”œβ”€β”€ Data/
    β”‚   β”‚   β”œβ”€β”€ AppDbContext.cs
    β”‚   β”‚   └── Migrations/
    β”‚   β”‚       β”œβ”€β”€ 20260225161029_Initial.cs
    β”‚   β”‚       β”œβ”€β”€ 20260326131556_AddPostsAndSocialAccounts.cs
    β”‚   β”‚       β”œβ”€β”€ ...  (14 migrations)
    β”‚   β”‚       β”œβ”€β”€ 20260513090000_AddTrelloBoardId.cs   ← nouveau
    β”‚   β”‚       └── AppDbContextModelSnapshot.cs
    β”‚   └── Models/
    β”‚       β”œβ”€β”€ Client.cs
    β”‚       β”œβ”€β”€ ExternalTask.cs
    β”‚       β”œβ”€β”€ Image.cs
    β”‚       β”œβ”€β”€ Notification.cs
    β”‚       β”œβ”€β”€ Platform.cs
    β”‚       β”œβ”€β”€ Post.cs
    β”‚       β”œβ”€β”€ Topic.cs
    β”‚       └── User.cs
    β”‚
    β”œβ”€β”€ SocialAccounts/
    β”‚   β”œβ”€β”€ AccountsController.cs
    β”‚   β”œβ”€β”€ SaveAccountDto.cs
    β”‚   β”œβ”€β”€ SocialAccount.cs
    β”‚   β”œβ”€β”€ Socialcontroller.cs
    β”‚   └── UpdateTokenDto.cs
    β”‚
    β”œβ”€β”€ Swagger/
    β”‚   └── SwaggerFileOperationFilter.cs
    β”‚
    β”œβ”€β”€ TopicService/
    β”‚   β”œβ”€β”€ CreateTopicDto.cs
    β”‚   └── TopicController.cs
    β”‚
    └── Trello/                          ← nouveau
        └── TrelloWebhookController.cs



Frontend/
β”œβ”€β”€ index.html
β”œβ”€β”€ package.json
β”œβ”€β”€ vite.config.ts
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ tsconfig.app.json
β”œβ”€β”€ tsconfig.node.json
β”œβ”€β”€ tailwind.config.js
β”œβ”€β”€ postcss.config.js
β”œβ”€β”€ vercel.json
β”œβ”€β”€ .env.example
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.tsx
β”‚   β”œβ”€β”€ App.tsx
β”‚   β”œβ”€β”€ App.css
β”‚   β”œβ”€β”€ index.css
β”‚   β”œβ”€β”€ global.var.ts
β”‚   β”œβ”€β”€ i18n.tsx
β”‚   β”œβ”€β”€ vite-env.d.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ Home.tsx
β”‚   β”‚   β”œβ”€β”€ Auth.tsx
β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx
β”‚   β”‚   β”œβ”€β”€ Editor.tsx
β”‚   β”‚   └── VerifyOtp.tsx
β”‚   β”‚
β”‚   β”œβ”€β”€ router/
β”‚   β”‚   β”œβ”€β”€ AppRouter.tsx
β”‚   β”‚   └── ProtectedRoute.tsx
β”‚   β”‚
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ AuthContext.tsx
β”‚   β”‚   β”œβ”€β”€ ClientContext.tsx
β”‚   β”‚   β”œβ”€β”€ ThemeContext.tsx
β”‚   β”‚   β”œβ”€β”€ useAuth.ts
β”‚   β”‚   └── useScroll.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ api.config.ts
β”‚   β”‚   └── theme.config.tsx
β”‚   β”‚
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── api.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ helpers/
β”‚   β”‚   └── api.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ store/
β”‚   β”‚   └── store.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ Redux/
β”‚   β”‚   └── slices/
β”‚   β”‚       └── authSlice.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   └── utils.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ DashboardSection/
β”‚   β”‚   β”‚   β”œβ”€β”€ Analytics/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ index.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ OverviewTab.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ContentTab.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Analyse.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Airecommendations.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AnalyticsComponents.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ analyticsHelpers.ts
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ analyticsTypes.ts
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SocialIcons.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ FacebookTab.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ InstagramTab.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LinkedinTab.tsx
β”‚   β”‚   β”‚   β”‚   └── TiktokTab.tsx
β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Calendar/
β”‚   β”‚   β”‚   β”‚   └── CalendarView.tsx
β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Notifications/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ NotificationBell.tsx
β”‚   β”‚   β”‚   β”‚   └── ExternalTaskModal.tsx
β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Posts/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ PostsView.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ CreatePostModal.tsx
β”‚   β”‚   β”‚   β”‚   └── DetailPanel.tsx
β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Topics/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ TopicsView.tsx
β”‚   β”‚   β”‚   β”‚   └── TopicDetailView.tsx
β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”œβ”€β”€ SocialAccounts/
β”‚   β”‚   β”‚   β”‚   └── ConnectedAccountsView.tsx
β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   └── Settings/
β”‚   β”‚   β”‚       └── Settings.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ HomeSection/
β”‚   β”‚   β”‚   β”œβ”€β”€ AboutUs.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Contact.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ DashboardPreview.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ GeneratePost.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Phone.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ PricingSection.tsx
β”‚   β”‚   β”‚   └── ProductPreview.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ NavigationBar/
β”‚   β”‚   β”‚   └── NavBar.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ Footer/
β”‚   β”‚   β”‚   └── Footer.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   └── UI/
β”‚   β”‚       β”œβ”€β”€ AppInterface.tsx
β”‚   β”‚       β”œβ”€β”€ ContainerScroll.tsx
β”‚   β”‚       β”œβ”€β”€ FloatingIcon.tsx
β”‚   β”‚       β”œβ”€β”€ IgMock.tsx
β”‚   β”‚       β”œβ”€β”€ Smartphone.tsx
β”‚   β”‚       β”œβ”€β”€ cinematic-landing-hero.tsx
β”‚   β”‚       β”œβ”€β”€ map.tsx
β”‚   β”‚       β”œβ”€β”€ social-hub-circuit.tsx
β”‚   β”‚       β”œβ”€β”€ typewriter-effect.tsx
β”‚   β”‚       └── typewriter-effect-demo.tsx
β”‚   β”‚
β”‚   └── assets/
β”‚       β”œβ”€β”€ AboutUs.css
β”‚       β”œβ”€β”€ Auth.css
β”‚       β”œβ”€β”€ Editor.css
β”‚       β”œβ”€β”€ GeneratePost.css
β”‚       β”œβ”€β”€ Home.css
β”‚       β”œβ”€β”€ NavBar.css
β”‚       └── VerifyOtp.css


## βš™οΈ Getting Started

### Prerequisites
- Node.js >= 18
- .NET 8 SDK
- SQL Server
- HuggingFace API Key
- Groq API Key

---

### πŸ–₯️ Backend Setup

**1. Clone the repo**
```bash
git clone https://github.com/amira-02/Auto_Generate.git
cd Auto_Generate/Backend

2. Configure appsettings.json

{
  "Jwt": {
    "Key": "YOUR_SECRET_KEY",
    "Issuer": "AutoGenerateApi",
    "Audience": "AutoGenerateClient"
  },
  "ConnectionStrings": {
    "DefaultConnection": "Your SQL Server connection string"
  },
  "Groq": {
    "ApiKey": "your_groq_api_key"
  },
  "HuggingFace": {
    "ApiKey": "your_huggingface_api_key"
  }
}

3. Apply migrations and run

dotnet ef database update
dotnet run

API runs on: https://localhost:7079


🌐 Frontend Setup

1. Navigate to Frontend

cd Auto_Generate/Frontend

2. Install dependencies

npm install

3. Start the dev server

npm run dev

App runs on: http://localhost:5173


πŸ” Authentication Flow

Register β†’ OTP sent to email β†’ Verify OTP β†’ JWT token β†’ Access Dashboard
Login    β†’ JWT token         β†’ Access Dashboard
  • JWT stored in localStorage
  • Role-based access (Editor, Admin)
  • Protected routes redirect to /auth if not authenticated

✨ Features

  • πŸ” Auth β€” Register, Login, OTP Email Verification
  • πŸ€– AI Post Generation β€” Generate posts from a prompt or JSON file
  • πŸ–ΌοΈ AI Image Generation β€” Generate images via HuggingFace Stable Diffusion
  • πŸ“Š Dashboard β€” View stats, recent posts, platform breakdown, activity chart
  • πŸŒ™ Dark / Light Mode β€” Global theme toggle persisted across all pages
  • πŸ“± Responsive β€” Works on desktop and mobile
  • πŸš€ Protected Routes β€” Dashboard only accessible when authenticated

🌍 API Endpoints

MethodEndpointDescriptionAuth
POST/api/auth/registerRegister new user❌
POST/api/auth/loginLogin user❌
POST/api/auth/verify-otpVerify OTP code❌
POST/api/auth/resend-otpResend OTP❌
POST/api/ai/generateGenerate post textβœ…
POST/api/ai/generate-imageGenerate imageβœ…

🎨 Theme System

The app uses a global ThemeContext for dark/light mode:

import { useTheme } from "../hooks/ThemeContext";

const { t, isDark, toggleTheme } = useTheme();

// Use t.bg, t.text, t.card, t.border etc. for consistent theming

πŸ“¦ Environment Variables

Create a .env file in Frontend/ if needed:

VITE_API_URL=https://localhost:7079/api

And update services/api.ts:

const API = axios.create({
  baseURL: import.meta.env.VITE_API_URL,
});

🀝 Contributing

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ‘©β€πŸ’» Author

Amira β€” @amira-02


πŸ“„ License

This project is licensed under the MIT License.

amira-02/AutoGenrerate_Backend

C#

0

23 commits

updated Jun 10, 2026

See the code

README

markdown# πŸ€– AutoGenerate β€” AI-Powered Social Media Post Generator

AutoGenerate is a full-stack web application that allows users to generate AI-powered social media posts using a prompt or a JSON file, and publish them across multiple platforms.


πŸš€ Tech Stack

Frontend

  • React + TypeScript (TSX)
  • Vite β€” build tool
  • Tailwind CSS β€” styling
  • React Router DOM β€” navigation
  • Framer Motion β€” animations
  • Axios β€” HTTP client
  • JWT Decode β€” token decoding
  • React Icons + Lucide React β€” icons

Backend

  • .NET 8 β€” ASP.NET Core Web API
  • Entity Framework Core β€” ORM
  • SQL Server β€” database
  • JWT Authentication β€” secure auth
  • Groq AI β€” text generation
  • HuggingFace API β€” image generation
  • SMTP β€” email OTP service

πŸ“ Project Structure

AutoGenerate/
    Backend/
    β”œβ”€β”€ appsettings.json
    β”œβ”€β”€ appsettings.Development.json
    β”œβ”€β”€ Program.cs
    β”œβ”€β”€ AutoGenerate.csproj
    β”œβ”€β”€ Dockerfile
    β”‚
    β”œβ”€β”€ AiService/
    β”‚   β”œβ”€β”€ AiController.cs
    β”‚   β”œβ”€β”€ AiRecommendation.cs
    β”‚   └── RecommendationsRequestDto.cs
    β”‚
    β”œβ”€β”€ AuthService/
    β”‚   β”œβ”€β”€ AuthController.cs
    β”‚   β”œβ”€β”€ EmailService.cs
    β”‚   β”œβ”€β”€ JwtService.cs
    β”‚   β”œβ”€β”€ LoginRequest.cs
    β”‚   β”œβ”€β”€ OtpCode.cs
    β”‚   β”œβ”€β”€ OtpService.cs
    β”‚   β”œβ”€β”€ RegisterRequest.cs
    β”‚   └── VerifyOtpRequest.cs
    β”‚
    β”œβ”€β”€ CaptionService/
    β”‚   β”œβ”€β”€ Caption.cs
    β”‚   β”œβ”€β”€ CaptionController.cs
    β”‚   β”œβ”€β”€ ChatDto.cs
    β”‚   β”œβ”€β”€ ChatHistoryItem.cs
    β”‚   β”œβ”€β”€ ConfirmCaptionDto.cs
    β”‚   β”œβ”€β”€ GenerateCaptionDto.cs
    β”‚   β”œβ”€β”€ SaveCaptionDto.cs
    β”‚   β”œβ”€β”€ UpdateCaptionDto.cs
    β”‚   β”œβ”€β”€ UpdateMediaDto.cs
    β”‚   └── UpdatePostParamsDto.cs
    β”‚
    β”œβ”€β”€ Enum/
    β”‚   └── PostStatus.cs
    β”‚
    β”œβ”€β”€ ExternalTasks/
    β”‚   β”œβ”€β”€ AssignTaskDto.cs
    β”‚   β”œβ”€β”€ ExternalTaskController.cs
    β”‚   └── ExternalTaskDto.cs
    β”‚
    β”œβ”€β”€ ImageService/
    β”‚   β”œβ”€β”€ GenerateImageDto.cs
    β”‚   β”œβ”€β”€ ImageController.cs
    β”‚   β”œβ”€β”€ SaveImageUrlDto.cs
    β”‚   └── SetImageUrlDto.cs
    β”‚
    β”œβ”€β”€ Notifications/
    β”‚   └── Notifications.cs
    β”‚
    β”œβ”€β”€ PostService/
    β”‚   β”œβ”€β”€ CreatePostDto.cs
    β”‚   β”œβ”€β”€ PostDto.cs
    β”‚   β”œβ”€β”€ PostResponseDto.cs
    β”‚   β”œβ”€β”€ PostResultDto.cs
    β”‚   β”œβ”€β”€ PostsController.cs
    β”‚   β”œβ”€β”€ RescheduleRequest.cs
    β”‚   β”œβ”€β”€ ScheduleDto.cs
    β”‚   └── UpdateStatusDto.cs
    β”‚
    β”œβ”€β”€ Shared/
    β”‚   β”œβ”€β”€ Clients/
    β”‚   β”‚   └── ClientsController.cs
    β”‚   β”œβ”€β”€ Converters/
    β”‚   β”‚   └── DateTimeUtcConverter.cs
    β”‚   β”œβ”€β”€ Data/
    β”‚   β”‚   β”œβ”€β”€ AppDbContext.cs
    β”‚   β”‚   └── Migrations/
    β”‚   β”‚       β”œβ”€β”€ 20260225161029_Initial.cs
    β”‚   β”‚       β”œβ”€β”€ 20260326131556_AddPostsAndSocialAccounts.cs
    β”‚   β”‚       β”œβ”€β”€ ...  (14 migrations)
    β”‚   β”‚       β”œβ”€β”€ 20260513090000_AddTrelloBoardId.cs   ← nouveau
    β”‚   β”‚       └── AppDbContextModelSnapshot.cs
    β”‚   └── Models/
    β”‚       β”œβ”€β”€ Client.cs
    β”‚       β”œβ”€β”€ ExternalTask.cs
    β”‚       β”œβ”€β”€ Image.cs
    β”‚       β”œβ”€β”€ Notification.cs
    β”‚       β”œβ”€β”€ Platform.cs
    β”‚       β”œβ”€β”€ Post.cs
    β”‚       β”œβ”€β”€ Topic.cs
    β”‚       └── User.cs
    β”‚
    β”œβ”€β”€ SocialAccounts/
    β”‚   β”œβ”€β”€ AccountsController.cs
    β”‚   β”œβ”€β”€ SaveAccountDto.cs
    β”‚   β”œβ”€β”€ SocialAccount.cs
    β”‚   β”œβ”€β”€ Socialcontroller.cs
    β”‚   └── UpdateTokenDto.cs
    β”‚
    β”œβ”€β”€ Swagger/
    β”‚   └── SwaggerFileOperationFilter.cs
    β”‚
    β”œβ”€β”€ TopicService/
    β”‚   β”œβ”€β”€ CreateTopicDto.cs
    β”‚   └── TopicController.cs
    β”‚
    └── Trello/                          ← nouveau
        └── TrelloWebhookController.cs



Frontend/
β”œβ”€β”€ index.html
β”œβ”€β”€ package.json
β”œβ”€β”€ vite.config.ts
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ tsconfig.app.json
β”œβ”€β”€ tsconfig.node.json
β”œβ”€β”€ tailwind.config.js
β”œβ”€β”€ postcss.config.js
β”œβ”€β”€ vercel.json
β”œβ”€β”€ .env.example
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.tsx
β”‚   β”œβ”€β”€ App.tsx
β”‚   β”œβ”€β”€ App.css
β”‚   β”œβ”€β”€ index.css
β”‚   β”œβ”€β”€ global.var.ts
β”‚   β”œβ”€β”€ i18n.tsx
β”‚   β”œβ”€β”€ vite-env.d.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ Home.tsx
β”‚   β”‚   β”œβ”€β”€ Auth.tsx
β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx
β”‚   β”‚   β”œβ”€β”€ Editor.tsx
β”‚   β”‚   └── VerifyOtp.tsx
β”‚   β”‚
β”‚   β”œβ”€β”€ router/
β”‚   β”‚   β”œβ”€β”€ AppRouter.tsx
β”‚   β”‚   └── ProtectedRoute.tsx
β”‚   β”‚
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ AuthContext.tsx
β”‚   β”‚   β”œβ”€β”€ ClientContext.tsx
β”‚   β”‚   β”œβ”€β”€ ThemeContext.tsx
β”‚   β”‚   β”œβ”€β”€ useAuth.ts
β”‚   β”‚   └── useScroll.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ api.config.ts
β”‚   β”‚   └── theme.config.tsx
β”‚   β”‚
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── api.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ helpers/
β”‚   β”‚   └── api.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ store/
β”‚   β”‚   └── store.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ Redux/
β”‚   β”‚   └── slices/
β”‚   β”‚       └── authSlice.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   └── utils.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ DashboardSection/
β”‚   β”‚   β”‚   β”œβ”€β”€ Analytics/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ index.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ OverviewTab.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ContentTab.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Analyse.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Airecommendations.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AnalyticsComponents.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ analyticsHelpers.ts
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ analyticsTypes.ts
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SocialIcons.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ FacebookTab.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ InstagramTab.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LinkedinTab.tsx
β”‚   β”‚   β”‚   β”‚   └── TiktokTab.tsx
β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Calendar/
β”‚   β”‚   β”‚   β”‚   └── CalendarView.tsx
β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Notifications/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ NotificationBell.tsx
β”‚   β”‚   β”‚   β”‚   └── ExternalTaskModal.tsx
β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Posts/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ PostsView.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ CreatePostModal.tsx
β”‚   β”‚   β”‚   β”‚   └── DetailPanel.tsx
β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Topics/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ TopicsView.tsx
β”‚   β”‚   β”‚   β”‚   └── TopicDetailView.tsx
β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”œβ”€β”€ SocialAccounts/
β”‚   β”‚   β”‚   β”‚   └── ConnectedAccountsView.tsx
β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   └── Settings/
β”‚   β”‚   β”‚       └── Settings.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ HomeSection/
β”‚   β”‚   β”‚   β”œβ”€β”€ AboutUs.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Contact.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ DashboardPreview.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ GeneratePost.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Phone.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ PricingSection.tsx
β”‚   β”‚   β”‚   └── ProductPreview.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ NavigationBar/
β”‚   β”‚   β”‚   └── NavBar.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ Footer/
β”‚   β”‚   β”‚   └── Footer.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   └── UI/
β”‚   β”‚       β”œβ”€β”€ AppInterface.tsx
β”‚   β”‚       β”œβ”€β”€ ContainerScroll.tsx
β”‚   β”‚       β”œβ”€β”€ FloatingIcon.tsx
β”‚   β”‚       β”œβ”€β”€ IgMock.tsx
β”‚   β”‚       β”œβ”€β”€ Smartphone.tsx
β”‚   β”‚       β”œβ”€β”€ cinematic-landing-hero.tsx
β”‚   β”‚       β”œβ”€β”€ map.tsx
β”‚   β”‚       β”œβ”€β”€ social-hub-circuit.tsx
β”‚   β”‚       β”œβ”€β”€ typewriter-effect.tsx
β”‚   β”‚       └── typewriter-effect-demo.tsx
β”‚   β”‚
β”‚   └── assets/
β”‚       β”œβ”€β”€ AboutUs.css
β”‚       β”œβ”€β”€ Auth.css
β”‚       β”œβ”€β”€ Editor.css
β”‚       β”œβ”€β”€ GeneratePost.css
β”‚       β”œβ”€β”€ Home.css
β”‚       β”œβ”€β”€ NavBar.css
β”‚       └── VerifyOtp.css


## βš™οΈ Getting Started

### Prerequisites
- Node.js >= 18
- .NET 8 SDK
- SQL Server
- HuggingFace API Key
- Groq API Key

---

### πŸ–₯️ Backend Setup

**1. Clone the repo**
```bash
git clone https://github.com/amira-02/Auto_Generate.git
cd Auto_Generate/Backend

2. Configure appsettings.json

{
  "Jwt": {
    "Key": "YOUR_SECRET_KEY",
    "Issuer": "AutoGenerateApi",
    "Audience": "AutoGenerateClient"
  },
  "ConnectionStrings": {
    "DefaultConnection": "Your SQL Server connection string"
  },
  "Groq": {
    "ApiKey": "your_groq_api_key"
  },
  "HuggingFace": {
    "ApiKey": "your_huggingface_api_key"
  }
}

3. Apply migrations and run

dotnet ef database update
dotnet run

API runs on: https://localhost:7079


🌐 Frontend Setup

1. Navigate to Frontend

cd Auto_Generate/Frontend

2. Install dependencies

npm install

3. Start the dev server

npm run dev

App runs on: http://localhost:5173


πŸ” Authentication Flow

Register β†’ OTP sent to email β†’ Verify OTP β†’ JWT token β†’ Access Dashboard
Login    β†’ JWT token         β†’ Access Dashboard
  • JWT stored in localStorage
  • Role-based access (Editor, Admin)
  • Protected routes redirect to /auth if not authenticated

✨ Features

  • πŸ” Auth β€” Register, Login, OTP Email Verification
  • πŸ€– AI Post Generation β€” Generate posts from a prompt or JSON file
  • πŸ–ΌοΈ AI Image Generation β€” Generate images via HuggingFace Stable Diffusion
  • πŸ“Š Dashboard β€” View stats, recent posts, platform breakdown, activity chart
  • πŸŒ™ Dark / Light Mode β€” Global theme toggle persisted across all pages
  • πŸ“± Responsive β€” Works on desktop and mobile
  • πŸš€ Protected Routes β€” Dashboard only accessible when authenticated

🌍 API Endpoints

MethodEndpointDescriptionAuth
POST/api/auth/registerRegister new user❌
POST/api/auth/loginLogin user❌
POST/api/auth/verify-otpVerify OTP code❌
POST/api/auth/resend-otpResend OTP❌
POST/api/ai/generateGenerate post textβœ…
POST/api/ai/generate-imageGenerate imageβœ…

🎨 Theme System

The app uses a global ThemeContext for dark/light mode:

import { useTheme } from "../hooks/ThemeContext";

const { t, isDark, toggleTheme } = useTheme();

// Use t.bg, t.text, t.card, t.border etc. for consistent theming

πŸ“¦ Environment Variables

Create a .env file in Frontend/ if needed:

VITE_API_URL=https://localhost:7079/api

And update services/api.ts:

const API = axios.create({
  baseURL: import.meta.env.VITE_API_URL,
});

🀝 Contributing

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ‘©β€πŸ’» Author

Amira β€” @amira-02


πŸ“„ License

This project is licensed under the MIT License.

Languages

C#

99.9%