Hey there! π I built this documentation platform because I was tired of juggling between different tools for writing technical docs. Devcuments is my take on a clean, simple, and powerful way to create and manage documentation.
Think of it as Notion for developers, but focused purely on technical writing. No distractions, just you and your docs.
Here's what makes Devcuments special:
- π Full Markdown Support - Write docs the way you want with all the standard Markdown features
- π¨ Syntax Highlighting - Your code blocks look beautiful with proper language colors
- ποΈ Preview Mode - Toggle between writing and seeing how it looks instantly
- πΎ Smart Save Detection - The save button only appears when you actually make changes
- π Secure & Private - Your docs are yours, with proper authentication
- π± Responsive Design - Works great on desktop, tablet, or phone
- π― Clean Interface - Inspired by Notion but built for developers
Here's the tech stack I used to build this:
- React 19 - For the frontend magic
- TailwindCSS - For styling (because writing CSS is boring)
- Supabase - For authentication and database (they make it so easy!)
- Vite - For fast development and building
- React Markdown - For rendering beautiful Markdown
Before you start, make sure you have:
- Node.js (v18 or higher) - The JavaScript runtime
- npm or yarn - Package manager (I prefer npm)
- A Supabase account - For the backend (it's free!)
First, clone this repo and install the dependencies:
git clone <your-repo-url>
cd devcuments
npm installYou'll need a Supabase project for authentication and data storage. Here's how:
- Head over to supabase.com and sign up/login
- Create a new project (the free tier is perfect for this)
- Wait a minute for it to be ready
- In your Supabase dashboard, go to Settings β API
- Copy your Project URL and anon/public key (you'll need these)
- Create a
.envfile in the root directory:
cp env.example .env- Add your Supabase credentials to the
.envfile:
VITE_SUPABASE_URL=https://your-project-id.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key-here- In your Supabase dashboard, go to Authentication β Providers
- Make sure Email provider is enabled (it should be by default)
- You can customize email templates if you want, but the defaults work fine
- Go to Authentication β URL Configuration
- Set Site URL to
http://localhost:5173(for development) - Add these redirect URLs:
http://localhost:5173/http://localhost:5173/create-documenthttp://localhost:5173/document/*
You'll need to create the database tables. Copy and paste this SQL into your Supabase SQL editor:
-- Create documents table for storing markdown content
CREATE TABLE documents (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE NOT NULL,
title TEXT NOT NULL,
content TEXT DEFAULT '',
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Enable Row Level Security (this is important for security!)
ALTER TABLE documents ENABLE ROW LEVEL SECURITY;
-- Create policies so users can only access their own documents
CREATE POLICY "Users can view own documents" ON documents
FOR SELECT USING (auth.uid() = user_id);
CREATE POLICY "Users can insert own documents" ON documents
FOR INSERT WITH CHECK (auth.uid() = user_id);
CREATE POLICY "Users can update own documents" ON documents
FOR UPDATE USING (auth.uid() = user_id);
CREATE POLICY "Users can delete own documents" ON documents
FOR DELETE USING (auth.uid() = user_id);
-- Add some indexes for better performance
CREATE INDEX idx_documents_user_id ON documents(user_id);
CREATE INDEX idx_documents_created_at ON documents(created_at);
-- Optional: Auto-update the updated_at timestamp
CREATE OR REPLACE FUNCTION update_updated_at_column()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ language 'plpgsql';
CREATE TRIGGER update_documents_updated_at
BEFORE UPDATE ON documents
FOR EACH ROW
EXECUTE FUNCTION update_updated_at_column();Now you're ready to run the app:
npm run devYour app should now be running at http://localhost:5173 π
Open your browser and start creating some docs!
The app uses Supabase for authentication, which is super simple:
- Sign Up - Users create accounts with email/password
- Sign In - Existing users log in with their credentials
- Protected Routes - Only logged-in users can access the docs
- Session Management - Supabase handles all the session stuff automatically
I've set up Row Level Security (RLS) to keep your data safe:
- Documents - Users can only see and edit their own documents
- Authentication - Supabase handles all the security stuff
- Data Isolation - Each user's docs are completely separate from others
Here's how the code is organized:
src/
βββ components/ # Reusable UI components
β βββ Auth.jsx # Login/signup form
β βββ Sidebar.jsx # Navigation sidebar
β βββ MarkdownRenderer.jsx # Renders markdown content
β βββ ProtectedRoute.jsx # Route protection
βββ contexts/ # React context for state management
β βββ AuthContext.jsx # User authentication state
β βββ DocumentsContext.jsx # Document data management
βββ pages/ # Main page components
β βββ Documentation.jsx # Homepage with instructions
β βββ CreateDocument.jsx # Create new documents
β βββ DocumentViewer.jsx # View and edit documents
βββ services/ # External service integrations
β βββ supabase-client.js # Supabase configuration
βββ App.jsx # Main app with routing
Here are some ideas for future improvements:
- Search functionality - Find documents quickly
- Document organization - Folders and tags for better organization
- Export options - PDF, HTML, or plain text export
- Collaborative editing - Work on docs with your team
- Templates - Pre-made document templates
- Version history - Track changes over time
Feel free to contribute or suggest new features!
Ran into problems? Here are some quick fixes:
- Make sure your
.envfile is in the root directory - Restart your dev server after adding environment variables
- Double-check your Supabase project URL and keys
- Make sure your redirect URLs are set correctly in Supabase
- Check the browser console for error messages
- Add your domain to Supabase allowed origins
- Verify your redirect URLs are configured properly
If you run into any issues:
- Check the Supabase documentation
- Create an issue in this repository
- Feel free to reach out if you have questions!
This project is open source and available under the MIT License.
Happy documenting! πβ¨