A full-featured blog application built with React, Vite, and Appwrite as the backend service. This application includes user authentication, post management, and a rich text editor for content creation.
- User Authentication: Sign up, login, and logout functionality
- Post Management: Create, read, update, and delete blog posts
- Rich Text Editor: TinyMCE integration for content creation
- Image Upload: Featured image support for posts
- Responsive Design: Built with Tailwind CSS
- State Management: Redux Toolkit for application state
- Protected Routes: Authentication-based route protection
- File Storage: Image upload and management via Appwrite Storage
- Frontend: React 19, Vite
- Styling: Tailwind CSS
- State Management: Redux Toolkit
- Routing: React Router DOM
- Forms: React Hook Form
- Rich Text Editor: TinyMCE
- Backend: Appwrite (Database, Authentication, Storage)
- Build Tool: Vite
src/
├── appwrite/ # Appwrite service configurations
│ ├── auth.js # Authentication services
│ └── Services.js # Database and storage services
├── Components/ # Reusable components
│ ├── Component/ # UI components
│ ├── Footer/ # Footer component
│ ├── Header/ # Header and navigation
│ └── Post-Form/ # Post creation/editing form
├── config/ # Configuration files
│ ├── config.js # Environment variables
│ └── editorConfig.js # TinyMCE configuration
├── Pages/ # Page components
├── Store/ # Redux store and slices
└── assets/ # Static assets
- Node.js (v16 or higher)
- npm or yarn
- Appwrite instance (cloud or self-hosted)
git clone <repository-url>
cd handle-formnpm installCreate a .env file in the root directory:
VITE_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
VITE_APPWRITE_PROJECT_ID=your-project-id
VITE_APPWRITE_PROJECT_NAME=your-project-name
VITE_DATABASE_ID=your-database-id
VITE_COLLECTION_ID=your-collection-id
VITE_BUCKET_ID=your-bucket-idCreate a collection with the following attributes:
title(String, required)content(String, required)featuredImage(String, required)status(String, required) - Values: "active", "draft"userId(String, required)
- Create a storage bucket for file uploads
- Configure appropriate permissions for authenticated users
- Enable Email/Password authentication in your Appwrite project
Choose one of the following options:
- Get a free API key from TinyMCE
- Update
src/config/editorConfig.js:
const config = {
useSelfHostedTinyMCE: false,
tinyMCEApiKey: 'your-api-key-here'
};- Copy TinyMCE assets to public folder:
mkdir -p public/tinymce/skins/ui/oxide
mkdir -p public/tinymce/skins/content/default
cp -R node_modules/tinymce/skins/ui/oxide/* public/tinymce/skins/ui/oxide/
cp -R node_modules/tinymce/skins/content/default/* public/tinymce/skins/content/default/- Update
src/config/editorConfig.js:
const config = {
useSelfHostedTinyMCE: true,
tinyMCEApiKey: 'your-api-key-here' // Not used when self-hosted
};npm run devThe application will be available at http://localhost:5173
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
- Powered by
authserviceclass - Handles user registration, login, and session management
- Integrated with Redux store for state management
- Full CRUD operations via
Servicesclass - File upload and management for featured images
- Rich text editing with TinyMCE
AuthLayoutcomponent manages route protection- Redirects unauthenticated users to login page
- Prevents authenticated users from accessing login/signup pages
App.jsx- Main application componentHeader- Navigation with authentication-aware menuPostForm- Create/edit post formPostcard- Individual post preview
Home- Landing page with post listingsAllPosts- Complete post listingAddPost- Create new postEditPost- Edit existing postPost- Individual post view
The application uses Appwrite SDK through custom service classes:
- Authentication:
authservice - Database & Storage:
services
- Tailwind CSS for utility-first styling
- Responsive design principles
- Dark/light theme considerations in components
ErrorBoundaryfor catching React errors- Service-level error handling in Appwrite interactions
- Form validation with React Hook Form
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
- TinyMCE API Key Error: Ensure you have a valid API key or use self-hosted mode
- Appwrite Connection: Verify your environment variables and Appwrite project setup
- Image Upload Issues: Check storage bucket permissions and file size limits
- Authentication Problems: Ensure proper collection permissions and user roles
- Check the Appwrite Documentation
- Review the TinyMCE Setup Guide
- Examine browser console for detailed error messages
npm run buildEnsure all environment variables are properly set in your production environment:
- Appwrite endpoint and credentials
- TinyMCE API key (if using cloud version)
- Any other service-specific configurations