Skip to content

Latest commit

 

History

33 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📝 TextToPng

.NET Framework React TypeScript Redis SQL Server License

Convert text to clean, downloadable PNG images. Built with ASP.NET Web API 2 and React.


TextToPng Home

📸 Preview

Register Page History Page

✨ Features

📝 Text to PNG

Enter any text and generate a clean PNG image. Handles up to 10,000 characters with auto-sized canvas.

📊 History & Regenerate

Every prompt is saved. Regenerate any past text with one click — no need to retype.

🔐 JWT Authentication

Register and login with email + password. OTP verification for secure access.

⚡ Rate Limiting

Redis-powered rate limiting protects the API from abuse.

🎨 Modern UI

Warm Lime + Olive Ink dark theme. Responsive design with smooth animations.

🔄 Dual Database

SQL Server for local development. PostgreSQL (Supabase) for production.


🏗️ Architecture


├── Backend/                    ASP.NET Web API 2 (.NET Framework 4.8)
│   ├── Controllers/            Auth, Generate, Download, Prompts
│   ├── Services/               PNG Generator, Redis
│   ├── Attributes/             JWT Auth, Rate Limiting
│   └── Models/                 EF 6 Database-First
│
└── Frontend/                   React 18 + TypeScript
    └── src/
        ├── pages/              Home, Login, Register, History
        ├── components/         Navbar, Footer
        ├── api.ts              Axios with auto-refresh
        └── cookies.ts          Token storage

🛠️ Tech Stack

LayerTechnology
BackendASP.NET Web API 2 (.NET Framework 4.8)
Image GenerationSystem.Drawing
DatabaseSQL Server + PostgreSQL (dual support)
ORMEntity Framework 6 (Database-First)
CacheRedis (Upstash)
AuthJWT + OTP Verification
FrontendReact 18 + TypeScript + Vite
StylingCustom CSS (Warm Lime + Olive Ink theme)

🔐 Authentication Flow

Register → Email + Password → OTP → Verify → JWT Tokens
Login    → Email + Password → OTP → Verify → JWT Tokens
Request  → Axios Interceptor adds Bearer token
Expired  → Auto-refresh via /api/auth/refresh
  • Access Token: 15 minutes (JWT)
  • Refresh Token: 7 days with rotation
  • OTP: 6 digits, expires in 10 minutes (Redis)

🎯 API Endpoints

MethodEndpointAuthDescription
POST/api/generateOptionalGenerate PNG from text
GET/api/download/{id}NoDownload PNG file
POST/api/auth/registerNoCreate account
POST/api/auth/loginNoSign in
POST/api/auth/verify-otpNoVerify OTP
POST/api/auth/refreshNoRefresh tokens
GET/api/promptsJWTUser history
DELETE/api/prompts/{id}JWTDelete prompt

🚀 Quick Start

# Clone the repo
git clone https://github.com/XPSTARTS/TextToPng.git

# Backend
cd Backend/TextToPng
# Open in Visual Studio, restore NuGet packages, press F5

# Frontend
cd Frontend/frontend
npm install
npm run dev

Backend runs on https://localhost:44365 | Frontend on http://localhost:3000


📝 License

MIT — free to use, modify, and learn from.


Built with ☕ and attention to detail

About

This progam in .NET Framework will help you to convert Text to PNG

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages