🚀 A modern social media management platform built with Next.js 15 and TypeScript
Freepost is a comprehensive social media management SaaS platform that allows users to schedule, manage, and analyze their social media content across multiple platforms.
- 🎯 Multi-workspace Management - Organize your social media accounts by workspace
- 📝 Content Scheduling - Schedule posts across multiple social platforms
- 📊 Analytics Dashboard - Track performance and engagement metrics
- 💳 Subscription Management - Integrated billing with Stripe
- 🔐 Secure Authentication - Powered by BetterAuth
- 📱 Responsive Design - Beautiful UI built with Tailwind CSS and Radix UI
- ⚡ Modern Tech Stack - Built with the latest Next.js 15 features
- Frontend: Next.js 15, TypeScript, Tailwind CSS, Radix UI
- Backend: Next.js API Routes, Server Actions
- Database: Prisma ORM (SQLite for dev, PostgreSQL for production)
- Authentication: BetterAuth
- Payments: Stripe
- Deployment: Vercel
- Package Manager: pnpm
- Architecture: Monorepo with workspaces
freepost-saas/
├── apps/
│ ├── web/ # Next.js web application
│ └── api/ # API server (if needed)
├── packages/
│ ├── db/ # Database schema and client
│ └── types/ # Shared TypeScript types
├── pnpm-workspace.yaml
└── vercel.json
- Node.js 18+
- pnpm (recommended) or npm
- Git
-
Clone the repository
git clone https://github.com/Youhai020616/freepost-saas.git cd freepost-saas -
Install dependencies
pnpm install
-
Environment setup
cp .env.example .env
Update the
.envfile with your configuration:# Database (SQLite for development) DATABASE_URL="file:./prisma/dev.db" # Authentication AUTH_SECRET="your-secret-key" # Stripe (for billing) STRIPE_PUBLISHABLE_KEY="pk_test_..." STRIPE_SECRET_KEY="sk_test_..."
-
Database setup
# Generate Prisma client pnpm db:generate # Run migrations pnpm db:migrate
-
Start development server
pnpm dev
The application will be available at:
- 🌐 Web: http://localhost:3000
- 🔌 API: http://localhost:8787
💡 遇到端口占用? 查看 快速启动指南 或运行
pnpm cleanup
# Development
pnpm dev # 智能启动开发服务器(推荐)
pnpm dev:clean # 清理端口后启动
pnpm dev:web # 仅启动 Web 应用
pnpm dev:api # 仅启动 API 服务
pnpm cleanup # 清理占用的端口
pnpm build # Build all apps for production
pnpm start # Start production builds
# Database
pnpm db:generate # Generate Prisma client
pnpm db:migrate # Run database migrations
pnpm db:studio # Open Prisma Studio
# Linting
pnpm lint # Run ESLint across all packages- User - User accounts and authentication
- Workspace - Organization/team workspaces
- Membership - User-workspace relationships
- SocialAccount - Connected social media accounts
- Post - Social media posts and content
- Media - File uploads and media management
- SchedulerJob - Scheduled post jobs
- Subscription - Billing and subscription management
- Log - System logs and audit trail
- Cache - Application caching layer
POST /api/workspaces- Create new workspaceGET /api/workspaces- List user workspaces
POST /api/social-accounts- Connect social accountGET /api/social-accounts- List connected accounts
GET /api/posts- List postsPOST /api/posts- Create new postPATCH /api/posts/[id]- Update postDELETE /api/posts/[id]- Delete postPOST /api/posts/[id]/publish- Publish post immediately
POST /api/media/upload- Upload media files
GET /api/billing/plans- List subscription plansPOST /api/billing/checkout- Create checkout session
-
Push to GitHub
git add . git commit -m "Initial commit" git push origin main
-
Connect to Vercel
- Import your GitHub repository in Vercel
- The
vercel.jsonconfiguration will handle the monorepo setup automatically
-
Environment Variables Configure the following in Vercel dashboard:
DATABASE_URL=your-postgresql-connection-string AUTH_SECRET=your-production-secret STRIPE_PUBLISHABLE_KEY=pk_live_... STRIPE_SECRET_KEY=sk_live_...
-
Database Migration
# Run migrations on production database pnpm db:migrate:deploy
Configure cron jobs in Vercel to handle scheduled posts:
- Endpoint:
POST /api/cron/publish - Schedule: Every minute (
* * * * *)
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Next.js
- UI components from Radix UI
- Styling with Tailwind CSS
- Database with Prisma
If you have any questions or need help, please:
- Open an issue on GitHub
- Check the documentation
Made with ❤️ by the Freepost team