Follow these steps to get your news publishing platform up and running.
- Visit https://supabase.com
- Sign up or log in
- Create a new project
- Choose a strong password and note it down
- Wait for the project to initialize
- In Supabase, click SQL Editor (left sidebar)
- Click New Query
- Copy the entire contents of
/scripts/01-init-database.sql - Paste into the query editor
- Click Run (Play button)
- Wait for success message
- In SQL Editor, click New Query
- Copy the entire contents of
/scripts/02-rls-policies.sql - Paste into the query editor
- Click Run
- Verify "Success" message
- Go to Project Settings (gear icon, top right)
- Click API in the left menu
- Copy these values:
- NEXT_PUBLIC_SUPABASE_URL from "Project URL"
- NEXT_PUBLIC_SUPABASE_ANON_KEY from "anon public" key
Keep these safe! You'll need them in the next step.
- In the project root, create a file called
.env.local - Copy the contents from
.env.example - Replace with your actual Supabase keys:
NEXT_PUBLIC_SUPABASE_URL=https://xxxxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...pnpm installpnpm devOpen http://localhost:3000 in your browser. You should see the homepage!
- Click the "Admin" link or go to http://localhost:3000/admin
- You'll be redirected to login page
- Use these default credentials:
- Email: admin@example.com
- Password: admin123
- In database (Supabase):
- Go to SQL Editor
- Create a new query:
UPDATE users SET password_hash = '$2b$10$...' WHERE email = 'admin@example.com';
- To generate a bcrypt hash, use an online tool or:
# In Node.js terminal const bcrypt = require('bcryptjs'); bcrypt.hash('your-new-password', 10).then(console.log);
- Go to Admin → Settings
- Fill in:
- Site Name: Your news site name
- Site Description: What your site is about
- Site URL: https://yourdomain.com
- Logo URL: Link to your logo image
- Click Save Settings
If you use Google AdSense:
- Go to Settings → AdSense Settings
- Add your AdSense Client ID (ca-pub-XXXXXXXXX)
- Add Slot IDs in JSON format:
[
{"position": "header", "slot": "1234567890"},
{"position": "sidebar", "slot": "0987654321"}
]- Save
- Go to Settings → Analytics
- Add your Google Analytics ID (G-XXXXXXXXXX)
- For custom tracking code, use Header Code section
- Save
- Go to Admin → Posts → Create Post
- Fill in:
- Title: Your first article headline
- Content: The article text (supports HTML)
- Excerpt: Short summary for listing pages
- Featured Image URL: Link to a cover image
- Category: News, Tech, etc.
- Tags: Relevant keywords (comma-separated)
- Set Status to "Published"
- Click Save Post
- Go back to http://localhost:3000
- Your post should appear on the homepage
- Click to read the full article
- Test the WhatsApp share button!
- Prepare a CSV file with columns:
title,content,excerpt,featured_image_url,category,tags Breaking News,Content here,Excerpt here,https://...,News,breaking - Go to Admin → Bulk Import
- Upload CSV or paste data
- Click Import Posts
- Posts will be created and published automatically
- Go to Admin → Trending
- Click Enable Auto-Publishing
- The system will fetch Google Trends every hour
- New trending topics become published posts automatically
- Go to Admin → Pages → Create Page
- Create pages for:
- About Us
- Contact
- Terms & Conditions
- These appear in the footer automatically
Add navigation items via Supabase:
- Go to SQL Editor
- Run:
INSERT INTO menu_items (label, url, order_index)
VALUES
('Latest', '/category/latest', 1),
('Tech', '/category/tech', 2),
('Business', '/category/business', 3);- Push your code to GitHub
- Visit https://vercel.com/new
- Import your repository
- Add environment variables:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEY
- Click Deploy
The app works with:
- Netlify
- AWS Amplify
- Railway
- Render
- Any Node.js host
Just set the environment variables and deploy!
- Admin login works
- Can create a post
- Post appears on homepage
- Post has featured image
- Post has categories/tags
- WhatsApp share button works
- Settings save correctly
- Site title appears in header
- Logo displays correctly
- Footer shows correctly
- Check Supabase URL and keys in
.env.local - Verify keys are correct and not expired
- Try restarting dev server
- Check password was hashed with bcrypt
- Verify user exists in database
- Clear browser cookies and try again
- Ensure posts have status "published"
- Check date is not in future (for scheduling)
- Verify featured image URL is valid
- Clear browser cache (Ctrl+Shift+Delete)
- Restart dev server
- Check tailwindcss is compiled
- Google takes 24-48 hours to activate ads
- Verify Client ID is correct
- Check Slot IDs are valid
- Ads only show on live domains, not localhost
- Customize Design: Modify colors and fonts in
tailwind.config.ts - Add Custom Pages: Create About page and other static content
- SEO Setup: Add meta tags and descriptions
- Analytics: Connect Google Analytics and track readers
- Backup: Regular database backups in Supabase
- ✅ Change default admin password
- ✅ Use strong passwords for all accounts
- ✅ Keep API keys secret (never commit to Git)
- ✅ Enable HTTPS in production
- ✅ Regular database backups
- ✅ Monitor admin activity
- ✅ Keep dependencies updated
- Check README.md for detailed documentation
- Review error messages in browser console
- Check Supabase logs for database errors
- See troubleshooting section in README
| Task | Location |
|---|---|
| Create Post | Admin → Posts → Create |
| Edit Settings | Admin → Settings |
| View Site | http://localhost:3000 |
| Admin Dashboard | http://localhost:3000/admin |
| Supabase Console | https://supabase.com |
Congratulations! Your news CMS is ready. Happy publishing! 📰