mini-crm-elfctns-projects.vercel.app
Küçük işletmeler için basit ve etkili müşteri takip sistemi. Next.js 14, MongoDB Atlas, Mongoose, JWT authentication, Cloudinary ve TailwindCSS ile geliştirilmiştir.
- Kullanıcı Yönetimi: JWT tabanlı güvenli authentication
- Profil Yönetimi: Kullanıcı bilgilerini güncelleme ve şifre değiştirme
- Profil Fotoğrafı: Cloudinary ile avatar yükleme ve yönetimi
- Müşteri Yönetimi: Tam CRUD operasyonları (Ekleme, Okuma, Güncelleme, Silme)
- Not Sistemi: Müşteriler için not ekleme ve yönetimi
- Arama ve Filtreleme: Müşteri arama ve etiket bazlı filtreleme
- Responsive Tasarım: Mobil uyumlu modern arayüz
- Canlı Ortam Desteği: Production-ready yapılandırma
- Frontend: Next.js 14, React 18, TypeScript
- Styling: TailwindCSS
- Backend: Next.js API Routes
- Veritabanı: MongoDB Atlas, Mongoose
- Authentication: JWT (JSON Web Tokens)
- Password Hashing: bcryptjs
- File Upload: Cloudinary
- Deployment: Vercel (önerilen)
- Node.js 18+
- npm veya yarn
git clone <repository-url>
cd mini-crmnpm install.env.local dosyası oluşturun:
cp env.example .env.local.env.local dosyasını düzenleyin:
# jwt secret - canlı ortamda mutlaka değiştirin!
JWT_SECRET=your-super-secret-jwt-key-here-change-this-in-production
# mongodb atlas connection string
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/mini-crm?retryWrites=true&w=majority
# cloudinary configuration
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret
# development settings
NODE_ENV=development- cloudinary.com adresine gidin
- Ücretsiz hesap oluşturun
- Dashboard'dan bilgileri alın:
- Cloud Name
- API Key
- API Secret
- Bu bilgileri
.env.localdosyasına ekleyin
npm run seednpm run devUygulama http://localhost:3000 adresinde çalışacaktır.
Uygulama ilk çalıştırıldığında otomatik olarak demo hesap oluşturulur:
- Email:
admin@minicrm.com - Şifre:
admin123
Bu hesap ile sistemi test edebilirsiniz.
npm test-
src/__tests__/auth.test.ts- Kimlik doğrulama testleri- Kullanıcı kayıt işlemleri
- Giriş işlemleri
- JWT token doğrulama
- Şifre hashleme testleri
-
src/__tests__/customers.test.ts- Müşteri CRUD testleri- Müşteri ekleme işlemleri
- Müşteri güncelleme işlemleri
- Müşteri silme işlemleri
- Müşteri listeleme işlemleri
- Arama ve filtreleme testleri
-
src/__tests__/notes.test.ts- Not CRUD testleri- Not ekleme işlemleri
- Not güncelleme işlemleri
- Not silme işlemleri
- Müşteri bazlı not listeleme
- Tüm notları listeleme
-
src/__tests__/components.test.tsx- React bileşen testleri- AuthProvider render testleri
- Component wrapper testleri
- Next.js router mock testleri
Postman collection'ı kullanarak API'leri manuel olarak test edebilirsiniz:
-
Postman Collection Import
MiniCRM.postman_collection.jsondosyasını Postman'e import edin- Collection'da tüm endpointler ve örnek veriler hazır
-
Environment Variables Ayarlayın
base_url: http://localhost:3000 token: (login endpoint'inden alınan JWT token) customerId: (müşteri ekledikten sonra dönen ObjectId) noteId: (not ekledikten sonra dönen ObjectId) -
Test Sırası
- Önce
authentication/kullanıcı girişiendpoint'ini çalıştırın - Dönen token'ı environment variable'a kaydedin
- Diğer endpointleri test edin
- Önce
- Authentication: Register, Login
- Customers: CRUD işlemleri, Arama, Filtreleme
- Notes: CRUD işlemleri, Müşteri bazlı listeleme
-
Authentication Test
- Login/Register işlemleri
- Token expiration kontrolü
- Protected route access
-
CRUD Testleri
- Müşteri ekleme/düzenleme/silme
- Not ekleme/düzenleme/silme
- Arama ve filtreleme
-
Canlı Ortam Testleri
- Production deployment kontrolü
- Database persistence
- Environment variable kontrolü
mini-crm/
├── src/
│ ├── app/
│ │ ├── api/ # API routes
│ │ │ ├── auth/ # Authentication endpoints
│ │ │ ├── customers/ # Customer CRUD endpoints
│ │ │ └── notes/ # Note CRUD endpoints
│ │ ├── customers/ # Customer pages
│ │ ├── notes/ # Notes page
│ │ ├── login/ # Login page
│ │ └── register/ # Register page
│ ├── lib/ # Utility functions
│ │ ├── auth.ts # Authentication helpers
│ │ ├── jwt.ts # JWT utilities
│ │ ├── mongodb.ts # MongoDB connection
│ │ ├── models/ # Mongoose modelleri
│ │ └── seed-mongodb.ts# MongoDB seed script
│ ├── providers/ # React context providers
│ │ └── AuthProvider.tsx
│ ├── types/ # TypeScript type definitions
│ └── __tests__/ # Test dosyaları
│ ├── auth.test.ts # Authentication testleri
│ ├── customers.test.ts # Customer CRUD testleri
│ ├── notes.test.ts # Note CRUD testleri
│ └── components.test.tsx # React bileşen testleri
├── public/ # Static assets
├── .env.example # Environment variables template
├── jest.config.js # Jest configuration
├── next.config.js # Next.js configuration
├── package.json # Dependencies and scripts
├── README.md # Project documentation
├── tailwind.config.js # TailwindCSS configuration
└── tsconfig.json # TypeScript configuration
- Vercel hesabı oluşturun
- GitHub repository'nizi bağlayın
- Environment variables'ları ayarlayın:
JWT_SECRETMONGODB_URICLOUDINARY_CLOUD_NAMECLOUDINARY_API_KEYCLOUDINARY_API_SECRET
- Deploy edin!
- Netlify: Static export ile
- Railway: Full-stack deployment
- Heroku: Container deployment
- Fork yapın
- Feature branch oluşturun (
git checkout -b feature/amazing-feature) - Commit yapın (
git commit -m 'feat: add amazing feature') - Push yapın (
git push origin feature/amazing-feature) - Pull Request oluşturun
Elif Çetin - @elfctn
Not: Bu proje eğitim amaçlı geliştirilmiştir. Production kullanımı için güvenlik önlemlerini artırmanız önerilir.