A lightweight React + Vite blog frontend built to demonstrate authentication, post CRUD, rich-text editing, and file uploads using Appwrite.
- Authentication (Appwrite)
- Signup, login and session handling. Redux stores the authenticated user for guarding routes and showing user-specific UI.
- Protected routes & AuthLayout
- Route wrappers that redirect unauthenticated users to login/signup.
- Post CRUD (Appwrite Database)
- Create, edit, delete and view posts. Posts support status flags (e.g.
active) used for filtered fetching.
- Create, edit, delete and view posts. Posts support status flags (e.g.
- Rich text editor
- TinyMCE integration with a graceful fallback to a textarea when the editor cannot load.
- Media handling (Appwrite Storage)
- Upload featured images, store file IDs with posts, preview and delete files via the service layer.
- Forms & validation
- Built with
react-hook-formfor performant forms, custom inputs wired viaforwardRef, and client-side validation rules.
- Built with
- State management
- Auth state managed with Redux Toolkit (
src/store/authSlice.js) and a single store insrc/store/store.js.
- Auth state managed with Redux Toolkit (
- Component-driven UI
- Reusable components in
src/components(Header, Footer, Container, PostCard, Button, Input, Select, Logo, RTE).
- Reusable components in
- Dev tooling
- Vite for fast dev server and HMR; simple build & preview scripts available.
src/appwrite/config.js— central Appwrite service wrapper (CRUD + file upload/delete). Use this for all Appwrite interactions.src/appwrite/auth.js— authentication helpers (login, logout, session, current user).src/components/— UI components and form controls.src/pages/— route pages (Home, AllPosts, Post, AddPost, EditPost, Login, Signup).src/store/— Redux slice and store configuration.src/conf/conf.js— project-specific Appwrite configuration (endpoint, projectId, database/collection/bucket ids).
- Create the database, collection and indexes (an index on
statusis required for queries likeQuery.equal('status','active')). - Configure
src/conf/conf.jswith:appwriteUrl(endpoint)appwriteProjectIdappwriteDatabaseIdappwriteCollectionIdappwriteBucketId
createPostusesslugas document id — ensure slug uniqueness or adapt behavior if you prefer auto-generated ids.
-
Install dependencies
npm install
-
Update Appwrite config
- Edit
src/conf/conf.jswith your Appwrite values.
- Edit
-
Start dev server
npm run dev
-
Build for production
npm run build npm run preview
- Use
react-hook-form'sControllerfor controlled components (RTE) andregisterfor native inputs. - Pass objects to children (e.g.
post={post}) when the child component owns destructuring. - Centralize API logic in
src/appwrite/config.jsto simplify unit testing and mocking.
If you'd like, I can add environment examples, Appwrite setup steps (console screenshots), or a checklist for production readiness (CORS, secure buckets, indexes).