MindR Web App is a companion application to the MindR Telegram bot. It provides a user-friendly interface for managing your stored memories. With this web app, users can easily onboard, view their stored memories, and delete them as needed.
- User authentication (including Telegram login)
- Onboarding process for new users
- View and manage stored memories
- Delete unwanted memories
- Seamless integration with the MindR Telegram bot
- Framework: Next.js
- Deployment: Cloudflare Pages
- Authentication: Auth.js v5
- Database: Supabase PostgreSQL (shared with Telegram bot)
- Node.js and npm installed on your system
- A Cloudflare account
- A Supabase account (same as used for the Telegram bot)
- OAuth credentials (e.g., Google, GitHub) for Auth.js
- Your Telegram Bot Token
-
Clone the repository:
git clone https://github.com/yourusername/mindr-webapp.git cd mindr-webapp
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.env.local
file in the root directory and add the following:NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=your_nextauth_secret SUPABASE_URL=your_supabase_project_url SUPABASE_ANON_KEY=your_supabase_anon_key TELEGRAM_BOT_TOKEN=your_telegram_bot_token
-
Set up Auth.js:
- Configure Auth.js in
pages/api/auth/[...nextauth].js
- Set up the necessary OAuth providers
- Configure Auth.js in
-
Configure Telegram Login:
- Go to @BotFather on Telegram
- Send the command
/setdomain
- Select your bot
- Enter your web app's domain (e.g.,
yourapp.pages.dev
if using Cloudflare Pages) - BotFather will confirm that the domain has been set for your bot
-
Setup Telegram Login to your Auth.js for custom configuration (optional): Update your
pages/api/auth/[...nextauth].js
file. -
Run the development server:
npm run dev
-
Build the project:
npm run build
-
Deploy to Cloudflare Pages:
- Connect your GitHub repository to Cloudflare Pages
- Set up the build configuration:
- Build command:
npm run build
- Build output directory:
.next
- Build command:
- Add your environment variables in the Cloudflare Pages dashboard
- Visit the deployed web app URL
- Sign in using your preferred method (including Telegram)
- Complete the onboarding process if you're a new user
- View your stored memories from the dashboard
- Delete any unwanted memories
The web app shares the same Supabase database as the Telegram bot. This allows for seamless integration between the two platforms. Memories stored via the Telegram bot will be visible in the web app, and vice versa. Users can log in with their Telegram account, ensuring a consistent experience across both platforms.
Contributions are welcome! Please feel free to submit a Pull Request.