A social media app — share posts, follow people, discover content.
Built with Next.js 16 · TypeScript · Tailwind CSS · Supabase · JWT
git clone https://github.com/your-username/socialconnect.git
cd socialconnect
npm install
cp .env.local.example .env.local # fill in your credentials
npm run devNEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
JWT_SECRET=any-random-string-at-least-32-chars
NEXT_PUBLIC_APP_URL=http://localhost:3000Find your Supabase keys at Dashboard → Settings → API.
- Create a project at supabase.com
- Open SQL Editor → New query
- Paste and run the contents of
supabase-schema.sql
That's it — all tables, indexes, RLS policies, and the storage bucket are created automatically.
- Register and login with email or username
- Create posts (280 chars) with image upload
- Like, comment, follow, unfollow
- Personalised feed based on who you follow
- Profile pages, settings, explore/search
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /api/auth/register |
Register | |
| POST | /api/auth/login |
Login (email or username) | |
| POST | /api/auth/logout |
Logout | |
| GET | /api/users |
List / search users | |
| GET/PATCH | /api/users/me |
✓ | Own profile |
| GET | /api/users/:id |
Public profile | |
| POST/DELETE | /api/users/:id/follow |
✓ | Follow / unfollow |
| GET | /api/users/:id/followers |
Followers list | |
| GET | /api/users/:id/following |
Following list | |
| GET/POST | /api/posts |
POST ✓ | List or create posts |
| GET/PATCH/DELETE | /api/posts/:id |
PATCH/DELETE ✓ | Single post |
| POST/DELETE | /api/posts/:id/like |
✓ | Like / unlike |
| GET/POST | /api/posts/:id/comments |
POST ✓ | Comments |
| DELETE | /api/posts/:id/comments/:cid |
✓ | Delete comment |
| GET | /api/feed |
Personalised feed | |
| POST | /api/upload |
✓ | Upload image (JPEG/PNG, max 2 MB) |
Vercel — import the repo, add the five env vars, deploy.
Netlify — same process; also install @netlify/plugin-nextjs for full App Router support.