This repository contains a photo-focused Instagram clone built with a Flutter frontend and a NestJS backend. It is structured as both a working full-stack app and a beginner-friendly learning project, with supporting guides in docs/.
- User signup, login, and current-user auth flow with JWT
- Photo uploads with optional captions
- Feed retrieval with author, likes, comments, and liked-state
- Like and unlike posts
- Add update delete post/comments
- Native share flow on the Flutter side
- Frontend: Flutter, Riverpod, GoRouter, Dio
- Backend: NestJS, JWT auth, Prisma
- Database: PostgreSQL
- File storage: local uploads in
backend/uploads
backend/ NestJS API, Prisma schema, uploads
frontend/instagramflutterapp/ Flutter application
docs/ Setup guides, architecture notes, lesson plan
- Flutter SDK
- Node.js 20+
- PostgreSQL
cd backend
npm install
cp .env.example .env
npm run prisma:migrate
npm run seed
npm run start:devOptional database browser:
cd backend
npm run prisma:studioBackend endpoints:
- Health:
http://localhost:3000/health - API base:
http://localhost:3000/api - Uploaded files:
http://localhost:3000/uploads/<filename>
cd frontend/instagramflutterapp
flutter pub get
flutter runSet API_BASE_URL in the Flutter .env file to:
http://localhost:3000/apifor macOS or iOS simulatorhttp://10.0.2.2:3000/apifor Android emulator
After running the backend seed:
- Email:
student@example.com - Password:
password123
Read these in this order if you are learning or onboarding:
docs/01_LESSON_PLAN.mddocs/02_SETUP.mddocs/ARCHITECTURE.mddocs/API.mddocs/BACKEND.mddocs/FRONTEND.mddocs/FRONTEND_SETUP.mddocs/FRONTEND_ARCHITECTURE.md
- Uploads are stored locally first to keep the learning flow simple.
- The current upload approach can later be replaced with S3, Cloudinary, Supabase Storage, or Firebase Storage while keeping the database
imageUrlpattern.