A SaaS platform for automated reminders that helps companies notify their clients about recurring services (e.g., AC maintenance every 6 months).
- Company Management: Registration, authentication, and profile management
- Client Management: CRUD operations for managing service clients
- Automated Reminders: Scheduled notifications based on service intervals
- Multi-channel Notifications: Email and SMS notifications
- Analytics Dashboard: Track delivery, open rates, and bookings
- Admin Panel: Platform-wide management and monitoring
- Backend: Go with Gin framework
- Database: PostgreSQL with GORM
- Authentication: JWT tokens
- Notifications: SendGrid (Email) + Twilio (SMS)
- Architecture: REST API
- Go 1.21+
- PostgreSQL
- SendGrid API key (for email)
- Twilio account (for SMS)
- Clone the repository:
git clone <repository-url>
cd pingclients-api
- Install dependencies:
go mod tidy
- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration
- Run database migrations:
go run main.go
- Start the server:
go run main.go
The API will be available at http://localhost:8080
POST /api/v1/auth/register
- Company registrationPOST /api/v1/auth/login
- Login
GET /api/v1/company/profile
- Get company profilePUT /api/v1/company/profile
- Update company profileGET /api/v1/company/dashboard
- Get dashboard dataGET /api/v1/company/analytics
- Get analytics
GET /api/v1/clients
- List clients (with pagination & search)POST /api/v1/clients
- Create new clientGET /api/v1/clients/:id
- Get client detailsPUT /api/v1/clients/:id
- Update clientDELETE /api/v1/clients/:id
- Delete client
GET /api/v1/reminders
- List remindersPOST /api/v1/reminders
- Create reminderGET /api/v1/reminders/:id
- Get reminder detailsPUT /api/v1/reminders/:id
- Update reminderDELETE /api/v1/reminders/:id
- Delete reminder
GET /api/v1/templates
- List notification templatesPOST /api/v1/templates
- Create templateGET /api/v1/templates/:id
- Get templatePUT /api/v1/templates/:id
- Update templateDELETE /api/v1/templates/:id
- Delete template
GET /api/v1/admin/companies
- List all companiesGET /api/v1/admin/companies/:id
- Get company detailsPUT /api/v1/admin/companies/:id/status
- Update company statusGET /api/v1/admin/stats
- Platform statistics
POST /api/v1/webhooks/email/opened/:reminder_id
- Track email openPOST /api/v1/webhooks/email/clicked/:reminder_id
- Track link clickPOST /api/v1/webhooks/service/booked/:reminder_id
- Track service booking
The application uses the following main entities:
- Users: Authentication and basic user info
- Companies: B2B customers using the platform
- Clients: End customers of the companies
- Reminders: Scheduled notifications
- NotificationTemplates: Customizable email/SMS templates
- Analytics: Tracking data for notifications
Key environment variables:
DATABASE_URL
: PostgreSQL connection stringJWT_SECRET
: Secret key for JWT tokensSENDGRID_API_KEY
: SendGrid API key for emailsTWILIO_SID
&TWILIO_TOKEN
: Twilio credentials for SMSPORT
: Server port (default: 8080)
The application includes an automated scheduler that:
- Runs every hour to check for due reminders
- Processes pending reminders based on
scheduled_date
- Sends notifications via configured channels (email/SMS)
- Updates reminder status and analytics
- Automatically schedules next reminder after service booking
- JWT-based authentication
- Password hashing with bcrypt
- Role-based access control (admin, company)
- Input validation and sanitization
- Soft deletes for data preservation
pingclients-api/
├── main.go # Application entry point
├── internal/
│ ├── api/ # HTTP handlers and routes
│ │ ├── handlers/ # Request handlers
│ │ └── routes.go # Route definitions
│ ├── auth/ # Authentication logic
│ ├── config/ # Configuration management
│ ├── database/ # Database connection and migrations
│ ├── models/ # Database models
│ ├── notifications/ # Email/SMS services
│ └── scheduler/ # Reminder scheduling
└── docs/ # Documentation
- Update models in
internal/models/
- Create handlers in
internal/api/handlers/
- Add routes in
internal/api/routes.go
- Update database migrations if needed
[Add your license here]