A sleek and modern todo application built with React, TypeScript, and Vite, featuring a beautiful UI powered by Radix UI components.
!! you can deploy this version with your own tokens on vercel or use the version with browser caching without Notion integration https://sunny-biscotti-235f4c.netlify.app
- Features
- Tech Stack
- Getting Started
- Setup Notion Integration
- Vercel Deployment
- Available Scripts
- Project Structure
- API Endpoints
- UI Showcase
- License
- Contribution
- Contact
- ๐ Modern Stack: React (v18) with TypeScript
- ๐ Beautiful UI: Radix UI primitives for polished and accessible components
- ๐ฑ Responsive Design: Tailwind CSS for adaptive styling
- ๐ Notion API Integration: Seamless data synchronization with Notion
- ๐จ Theming: Switch between light and dark themes with ease
Frontend | Backend | Styling | Other |
---|---|---|---|
React 18 | Express.js | Tailwind CSS | Notion API |
TypeScript | Vercel deploy | Radix UI | react-hook-form |
Vite | next-themes |
Follow these steps to get the project running on your local machine:
-
Clone the repository:
git clone https://github.com/ruslanlap/NotionTODO.git cd NotionTODO
-
Setup Environment Variables: Rename
.env.example
to.env
or create.env
and fill in the required credentials:YOUR_PAGE_ID=your_notion_page_id NOTION_API_KEY=your_notion_api_key
-
Install Dependencies:
npm install
-
Run the Development Server:
npm run dev
-
Access the app: Open http://localhost:5173 in your browser.
-
Create a Notion Integration
- Go to Notion Developers
- Click "New integration"
- Give your integration a name (e.g., "Todo App")
- Select the workspace where you want to use the integration
- Click "Submit" to create your integration
- Save the "Internal Integration Token" (it starts with
ntn_
)
-
Create a Notion Page
- Create a new page in Notion where you want to store your todos
- Click the โฎโฎโฎ menu at the top right of your page
- Go to "Add connections" and find your integration
- Click "Confirm" to give your integration access to the page
- Copy the page ID from the URL:
The PAGE_ID is a 32-character string after your page title
https://www.notion.so/Your-Page-Title-{PAGE_ID}?v=...
Follow these steps to deploy your application to Vercel:
-
Prepare for Deployment
- Make sure your project is pushed to a GitHub repository
- Ensure all environment variables are properly set up in your
.env
file
-
Deploy to Vercel
- Go to Vercel and sign in with your GitHub account
- Click "New Project"
- Import your GitHub repository
- Configure your build settings:
Build Command: npm run build Output Directory: dist Install Command: npm install
-
Environment Variables
- In your Vercel project settings, go to the "Environment Variables" tab
- Add your environment variables:
YOUR_PAGE_ID=your_notion_page_id NOTION_API_KEY=your_notion_api_key
-
Deploy
- Click "Deploy"
- Vercel will automatically build and deploy your application
- Once complete, you'll receive a deployment URL
-
Custom Domain (Optional)
- In your project settings, go to "Domains"
- Add your custom domain
- Follow Vercel's instructions to configure your DNS settings
-
Automatic Deployments
- Vercel will automatically deploy updates when you push to your main branch
- You can configure branch deployments in your project settings
npm run dev
: Start the development servernpm run build
: Build the app for productionnpm run preview
: Preview the production buildnpm run lint
: Run the linter to check for code quality issues
โโโ api/
โ โโโ notion/
โ โโโ createTodo.ts
โ โโโ deleteTodo.ts
โ โโโ fetchTodos.ts
โ โโโ updateTodo.ts
โโโ src/
โ โโโ components/
โ โ โโโ Todo/
โ โ โโโ TodoList.tsx
โ โ โโโ TodoItem.tsx
โ โโโ hooks/
โ โ โโโ // Custom React hooks
โ โโโ lib/
โ โ โโโ config.ts
โ โ โโโ middleware.ts
โ โ โโโ notion.ts
โ โ โโโ utils.ts
โ โโโ App.css
โ โโโ App.tsx
โ โโโ index.css
โ โโโ main.tsx
โ โโโ vite-env.d.ts
โโโ dist/
โ โโโ // Build output directory
โโโ .env # Development environment variables
โโโ package.json
โโโ tsconfig.json
โโโ vite.config.ts
โโโ README.md
The application provides the following API endpoints:
GET /api/notion/blocks // Fetch all todos
PATCH /api/notion/blocks // Create new todo
PATCH /api/notion/blocks/:id // Update existing todo
DELETE /api/notion/blocks/:id // Delete todo
Take a look at some of the beautiful UI components included in the project:
This project is licensed under the MIT License.
Contributions are welcome! Follow these steps to contribute:
- Fork the repository
- Create a new branch (
feature/new-feature
) - Commit your changes (
git commit -m "Add new feature"
) - Push to the branch (
git push origin feature/new-feature
) - Open a Pull Request
Have questions or suggestions? Reach out!
- GitHub: @ruslanlap
- Telegram: ruslan