https://github.com/rafat-alam/mdx-editor
MDX Editor is a modern platform for creating and organizing .mdx documents with AI-assisted writing, live preview, and folder management for dynamic, interactive content.
https://github.com/rafat-alam/mdx-editor
nextjs postgresql redux-tookit tailwindcss typescript
Last synced: 6 months ago
JSON representation
MDX Editor is a modern platform for creating and organizing .mdx documents with AI-assisted writing, live preview, and folder management for dynamic, interactive content.
- Host: GitHub
- URL: https://github.com/rafat-alam/mdx-editor
- Owner: rafat-alam
- License: mit
- Created: 2025-09-07T10:44:53.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2026-01-10T15:10:31.000Z (6 months ago)
- Last Synced: 2026-01-11T02:06:23.571Z (6 months ago)
- Topics: nextjs, postgresql, redux-tookit, tailwindcss, typescript
- Language: TypeScript
- Homepage: https://mdx-e.vercel.app
- Size: 3.36 MB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# MDX Editor ๐๐
**MDX Editor** is a powerful and intuitive platform built to help you **create, organize, and share knowledge** effortlessly โจ. Whether youโre writing technical documentation, learning notes, or community guides, MDX Editor gives you everything you need in one place ๐.
## Why MDX Editor? โจ๐ก
* ๐ **Structured Repositories**
Organize your content using folders and MDX files ๐. Treat folders as main topics and files as subtopics to maintain a clean, logical hierarchy ๐ง .
* โ๏ธ **Rich MDX Editing with Live Preview**
Write Markdown, JSX, and code blocks with real-time previews ๐, so you always see exactly what youโre building โก.
* ๐ค **AI-Powered Content Generation (RAG)**
Generate accurate and up-to-date documentation using ๐ง โจ:
* ๐ Repository-wide context
* ๐ Web crawling for fresh information
* ๐ URL-based trusted sources
* โก LLM-only generation for quick drafts
* ๐ ๏ธ **Smart Content Refinement**
Improve clarity, structure, and accuracy with AI-assisted refinements โจ. Enhance specific sections without rewriting the entire document ๐งน.
* ๐ **Share with the Community**
Publish repositories publicly to help others learn ๐ค, or keep them private for personal or internal use ๐.
* ๐ **Learn by Exploring**
Browse public repositories ๐, view combined topics ๐งฉ, and get inspired by community-driven knowledge ๐.
## Built for Everyone ๐ก๐ฅ
* ๐จโ๐ป Developers & engineers
* ๐ Students & learners
* โ๏ธ Writers & educators
* ๐งโ๐คโ๐ง Teams building internal documentation
**Free to use ๐, easy to get started ๐, and powerful as you grow ๐**, MDX Editor transforms ideas into **well-structured, shareable documentation**โfaster โก and smarter ๐ง .
## Future Updates ๐ฎ๐ ๏ธ
### v2 ๐ฑ
1. Profile settings ๐ค
2. Change name โ๏ธ
3. Change username ๐
4. Change email ๐ง
5. Change password ๐
6. Middleware to Proxy ๐งฉ
7. OAuth SignIn / SignUp ๐
8. Connect RAG ๐ค
### v3
1. Connect GPT
## Project Structure ๐๏ธ
```
db/
โโโ index.ts (function to get _db instance)
โโโ schema.ts
public/
โโโ team/ (team profile pictures)
src/
โโโ app/
โ โโโ about (page)
โ โ
โ โโโ api
โ โ โโโ ai
โ โ โ โโโ gemini (route)
โ โ โ โโโ gpt (route) (Comming Soon...)
โ โ โ
โ โ โโโ auth
โ โ โ โโโ [...nextauth] (route)
โ โ โ โโโ forgot-pass (route)
โ โ โ โโโ signup (route)
โ โ โ
โ โ โโโ edit
โ โ โ โโโ add-file (route)
โ โ โ โโโ add-folder (route)
โ โ โ โโโ add-repo (route)
โ โ โ โโโ remove (route)
โ โ โ โโโ rename (route)
โ โ โ โโโ save (route)
โ โ โ โโโ set-repo-vis (route)
โ โ โ
โ โ โโโ get
โ โ โ โโโ all-public-repos (route)
โ โ โ โโโ path (route)
โ โ โ
โ โ โโโ rag
โ โ โ โโโ repo (route) (Comming Soon...)
โ โ โ โโโ url (route) (Comming Soon...)
โ โ โ โโโ web (route) (Comming Soon...)
โ โ โ
โ โ โโโ u/[username] (route)
โ โ
โ โโโ editor (page)
โ โโโ forgot-pass (page)
โ โโโ public-repos (page)
โ โโโ settings (page)
โ โโโ signin (page)
โ โโโ u/[...path] (page)
โ
โโโ components
โ โโโ about
โ โโโ dashboard
โ โโโ editor
โ โโโ forgot-pass
โ โโโ home
โ โโโ nav-menu
โ โโโ public-repos
โ โโโ signin
โ โโโ signup
โ โโโ ui
โ โโโ ui2
โ โโโ themeprovider
โ
โโโ data/
โ โโโ team_members_data.json
โ
โโโ lib/
โ โโโ utils.ts
โ
โโโ module/
โ โโโ entities/
โ โ โโโ node.ts
โ โ โโโ user.ts
โ โ
โ โโโ repo/
โ โ โโโ node_repo.ts
โ โ โโโ user_repo.ts
โ โ
โ โโโ services/
โ โโโ auth_service.ts
โ โโโ helper_service.ts
โ โโโ node_service.ts
โ โโโ user_service.ts
โ
โโโ store/ (Redux Toolkit)
โ โโโ authSlice.ts
โ โโโ store.ts
โ
โโโ middleware.ts (Edge Runtime)
types/
โโโ next-auth.d.ts
```
## API Flow ๐๐ง
```
Client (UI / Fetch / Axios)
โ
Middleware (Edge)
- coarse authentication gate (logged in or not)
- protected route allow/deny
- lightweight session existence check
โ
API Route (Controller)
- full authentication check (authoritative)
- input validation
- data normalization
โ
Service (Business Logic)
- permissions (ownership, roles)
- workflows
- transactions
- orchestration
โ
Repository (Data Access)
- database queries only
โ
Database
```
## Local Development Setup ๐งโ๐ปโ๏ธ
### Clone Repository ๐ฆ
```bash
git clone https://github.com/rafat-alam/mdx-editor.git
cd mdx-editor
```
### Create `.env` File ๐
```env
# Database connection string
DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DB_NAME?sslmode=require"
# NextAuth secret key
NEXTAUTH_SECRET="your_nextauth_secret_here"
# SMTP (Brevo) credentials
BRAVO_USER="your_brevo_username_here"
BRAVO_PASS="your_brevo_password_here"
# Gemini API key
GEMINI_API_KEY="your_gemini_api_key_here"
# Upstash (Redis API)
UPSTASH_REDIS_REST_URL="https://user-redis-0000.upstash.io"
UPSTASH_REDIS_REST_TOKEN="upstash_redis_rest_token_here"
```
### Install Dependencies ๐ฅ
```bash
npm install
```
### Run Drizzle ORM (First Time Only) ๐๏ธ
```bash
npx drizzle-kit generate
npx drizzle-kit migrate
```
### Run Project (Development) โก
```bash
npm run dev
```
### Run Project (Production) ๐
```bash
npm run build
npm run start
```
## License (MIT) ๐โ
```
MIT License
Copyright (c) 2025 Rafat Alam
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
---