Free and opensource blogging social network
I have built this project to get familiar with modern web and database technologies such as React, Next.js and Prisma.
- User authentication with GitHub
- User profiles with customizable usernames, images, and bios
- Create, read, update, and delete blog posts
- Image uploads for posts and profiles
- Markdown support for post content
- Like and comment system
- Follow/unfollow users
- Feed filtering (all posts vs. following)
- Responsive design
- Frontend: React, Next.js 14 (App Router), TypeScript, TailwindCSS
- Backend: Next.js API routes, Prisma ORM
- Database: PostgreSQL
- Authentication: NextAuth.js with GitHub provider
- Image Storage: Vercel Blob
- Deployment: Vercel
- Node.js (v20 or later recommended)
- PostgreSQL database
- GitHub OAuth application
- Vercel account (for Blob storage)
-
Clone the repository
git clone https://github.com/Pero-coder/openblog.git cd openblog -
Install dependencies
npm install # or with pnpm pnpm install -
Set up environment variables (create a .env file)
# NextAuth AUTH_SECRET=your-secret-key # GitHub OAuth AUTH_GITHUB_ID=your-github-client-id AUTH_GITHUB_SECRET=your-github-client-secret # Database POSTGRES_PRISMA_URL=your-postgres-connection-string POSTGRES_URL_NON_POOLING=your-postgres-direct-connection-string # Vercel Blob BLOB_READ_WRITE_TOKEN=your-vercel-blob-token
-
Set up the database
npx prisma migrate dev
-
Run the development server
npm run dev # or pnpm dev -
Open http://localhost:3000 in your browser
app/- Next.js App Router pages and layoutscomponents/- React componentsprisma/- Prisma schema and migrationslib/- Utility functions and shared codepublic/- Static assets
This project is configured for easy deployment on Vercel:
- Push your code to GitHub
- Import the repository in Vercel
- Set up the environment variables
- Deploy
