Files
Eventify-frontend/lib/core/api/api_endpoints.dart
Sicherhaven ebe654f9c3 fix: v2.0.4+24 — login fixes, signup toggle, forgot-password, guest SnackBar, Google OAuth
- Google Sign-In: wire serverClientId (639347358523-mtkm...apps.googleusercontent.com) so idToken is returned on Android
- Email login: raise timeout 10s→25s, add single retry on SocketException/TimeoutException
- Forgot Password: real glassmorphism bottom sheet with safe-degrade SnackBar (endpoint missing on backend)
- Create Account: same-page AnimatedSwitcher toggle with glassmorphism signup form; delete old RegisterScreen
- Desktop parity: DesktopLoginScreen same-page toggle; delete DesktopRegisterScreen
- Guest mode: remove ScaffoldMessenger SnackBar from HomeScreen outer catch (inner _safe wrappers already return [])
- LoginScreen: clearSnackBars() on postFrameCallback to prevent carried-over SnackBars from prior screens
- ProGuard: add Google Sign-In + OkHttp keep rules
- Version bump: 2.0.0+20 → 2.0.4+24; settings _appVersion → 2.0.4

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 21:40:17 +05:30

70 lines
3.6 KiB
Dart

// lib/core/api/api_endpoints.dart
class ApiEndpoints {
// Change this to your desired backend base URL (local or UAT)
// For local Django dev use: "http://127.0.0.1:8000/api"
// For UAT: "https://uat.eventifyplus.com/api"
static const String baseUrl = "https://em.eventifyplus.com/api";
/// Base URL for media files (images, icons uploaded via Django admin).
/// Relative paths like `/media/...` are resolved against this.
static const String mediaBaseUrl = "https://em.eventifyplus.com";
// Auth
static const String register = "$baseUrl/user/register/";
static const String login = "$baseUrl/user/login/";
static const String logout = "$baseUrl/user/logout/";
static const String status = "$baseUrl/user/status/";
static const String updateProfile = "$baseUrl/user/update-profile/";
static const String forgotPassword = "$baseUrl/user/forgot-password/";
// Events
static const String eventTypes = "$baseUrl/events/type-list/"; // list of event types
static const String eventsByPincode = "$baseUrl/events/pincode-events/"; // pincode-events
static const String eventDetails = "$baseUrl/events/event-details/"; // event-details
static const String eventImages = "$baseUrl/events/event-images/"; // event-images
static const String eventsByCategory = "$baseUrl/events/events-by-category/";
static const String eventsByMonth = "$baseUrl/events/events-by-month-year/";
static const String featuredEvents = "$baseUrl/events/featured-events/";
static const String topEvents = "$baseUrl/events/top-events/";
// Bookings
// static const String bookEvent = "$baseUrl/events/book-event/";
// static const String userSuccessBookings = "$baseUrl/events/event/user-success-bookings/";
// static const String userCancelledBookings = "$baseUrl/events/event/user-cancelled-bookings/";
// Reviews (served by Node.js backend via app.eventifyplus.com)
static const String _reviewBase = "https://app.eventifyplus.com/api/reviews";
static const String reviewSubmit = "$_reviewBase/submit";
static const String reviewList = "$_reviewBase/list";
static const String reviewHelpful = "$_reviewBase/helpful";
static const String reviewFlag = "$_reviewBase/flag";
// Node.js gamification server (same host as reviews)
static const String _nodeBase = "https://app.eventifyplus.com/api";
// File upload (Node.js — routes to OneDrive or GDrive via STORAGE_BACKEND env)
static const String uploadFile = "$_nodeBase/v1/upload/file";
// Gamification / Contributor Module
static const String gamificationDashboard = "$_nodeBase/v1/gamification/dashboard";
static const String leaderboard = "$_nodeBase/v1/gamification/leaderboard";
static const String shopItems = "$_nodeBase/v1/shop/items";
static const String shopRedeem = "$_nodeBase/v1/shop/redeem";
static const String contributeSubmit = "$_nodeBase/v1/gamification/submit-event";
static const String gradeContribution = "$_nodeBase/v1/admin/contributions/"; // append {id}/grade/
// Bookings
static const String ticketMetaList = "$baseUrl/bookings/ticket-meta/list/";
static const String cartAdd = "$baseUrl/bookings/cart/add/";
static const String checkout = "$baseUrl/bookings/checkout/";
static const String checkIn = "$baseUrl/bookings/check-in/";
// Auth - Google OAuth
static const String googleLogin = "$baseUrl/user/google-login/";
// Notifications
static const String notificationList = "$baseUrl/notifications/list/";
static const String notificationMarkRead = "$baseUrl/notifications/mark-read/";
static const String notificationCount = "$baseUrl/notifications/count";
}