WriteNest is a React and Appwrite blogging platform with authentication, post management, TinyMCE editing, and an AI-powered assistant for navigation and writing help.
- Appwrite authentication for signup, login, logout, and current-user sessions
- Post creation, editing, deletion, and detail pages
- Featured image uploads with Appwrite Storage
- Rich-text editing with TinyMCE and a textarea fallback
- Protected routes for content management
- WriteNest Assistant chatbot powered by an Appwrite Function and OpenRouter
- React 19
- Vite 7
- React Router DOM 7
- Redux Toolkit
- React Hook Form
- Tailwind CSS
- Appwrite
- TinyMCE
- OpenRouter via Appwrite Function
The repo has two runtime boundaries:
- Frontend app in
src/ - Server-side assistant function in
appwrite-functions/write-nest-assistant/
Important folders:
src/pagesroute-level screenssrc/componentsshared UI and form piecessrc/appwriteAppwrite client wrapperssrc/storeRedux auth statesrc/conf/conf.jsenvironment mapping
The chatbot no longer calls AI providers directly from the browser.
Instead:
src/components/ChatBot.jsxbuilds chat historysrc/appwrite/openai.jsexecutes the Appwrite Functionappwrite-functions/write-nest-assistant/src/main.jscalls OpenRouter securely on the server side
This keeps the OpenRouter API key out of the frontend bundle.
/home page showing active posts/loginlogin page/signupsignup page/all-postsprotected archive of all posts/add-postprotected create-post page/edit-post/:slugprotected edit-post page/post/:slugpublic post detail page
You need these Appwrite resources:
- one project
- one database
- one posts collection
- one storage bucket
- one function named
write-nest-assistant
Expected document fields:
titlecontentfeaturedimagestatususerid
Frontend .env:
VITE_APPWRITE_URL="https://your-appwrite-endpoint/v1"
VITE_APPWRITE_PROJECT_ID="your_project_id"
VITE_APPWRITE_DATABASE_ID="your_database_id"
VITE_APPWRITE_COLLECTION_ID="your_collection_id"
VITE_APPWRITE_BUCKET_ID="your_bucket_id"
VITE_APPWRITE_ASSISTANT_FUNCTION_ID="write-nest-assistant"
VITE_TINYMCE_API_KEY="your_tinymce_api_key"Assistant function variables in Appwrite:
OPENROUTER_API_KEYOPENROUTER_MODEL=openrouter/free
Install dependencies:
npm installStart the frontend:
npm run devBuild the frontend:
npm run buildLint the frontend:
npm run lintThis repo includes an Appwrite CLI manifest at appwrite.config.json.
From the repo root:
appwrite login
appwrite push functionsThen add the function variables in the Appwrite Console and redeploy if needed.
A fuller walkthrough is in APPWRITE_ASSISTANT_FUNCTION_SETUP.md.
WriteNest/
+-- appwrite.config.json
+-- APPWRITE_ASSISTANT_FUNCTION_SETUP.md
+-- appwrite-functions/
| +-- write-nest-assistant/
| +-- package.json
| +-- src/
| +-- main.js
+-- public/
| +-- logo.png
+-- src/
| +-- appwrite/
| | +-- auth.js
| | +-- config.js
| | +-- openai.js
| +-- components/
| +-- conf/
| +-- pages/
| +-- store/
| +-- App.jsx
| +-- index.css
| +-- main.jsx
+-- package.json
+-- README.md
- Home shows active posts only.
- All Posts is the protected archive for active and inactive content.
- The chatbot is available from the main app shell.
.envshould stay out of version control. If secrets were committed earlier, rotate them.
The project structure is generally solid for a small Appwrite-based app:
- routing and auth boundaries are easy to follow
- service wrappers are separated from UI code
- the new chatbot backend boundary is much safer than a browser-side API key
Main areas still worth improving:
- add automated tests for auth, post CRUD, and the assistant flow
- add clearer user-facing error states across page loads and form submissions
- rename
src/appwrite/openai.jsto something provider-neutral likeassistant.js - remove unused starter assets such as
src/assets/react.svgandpublic/vite.svgif they are no longer needed