Skip to content

coquencio/pluralink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Pluralink - Booking App

A comprehensive booking application for service providers and clients, built with React Native (TypeScript) and Go (Gin/GORM).

Features

  • Service Providers: Create profiles, manage availability, view bookings, and receive reviews
  • Clients: Search for services, book appointments, manage bookings, and leave reviews
  • Categories: Multiple service categories (tattoo, haircut, nails, salon, pet grooming, etc.)
  • Location-based Search: Find services near your location
  • Reviews: Both providers and clients can leave reviews
  • Booking Management: Create, cancel, and reschedule bookings
  • Availability Management: Providers can set their available time slots

Tech Stack

Backend

  • Go with Gin framework
  • GORM for database ORM
  • PostgreSQL database
  • JWT authentication
  • OAuth support (Google)

Frontend

  • React Native with TypeScript
  • Expo for cross-platform development
  • React Navigation for navigation
  • Axios for API calls
  • AsyncStorage for local storage

Project Structure

Pluralink/
├── backend/          # Go backend
│   ├── config/       # Configuration
│   ├── database/     # Database connection and migrations
│   ├── handlers/     # API handlers
│   ├── middleware/   # Auth and CORS middleware
│   ├── models/       # Database models
│   ├── routes/       # Route definitions
│   └── utils/        # Utility functions
├── frontend/         # React Native app
│   ├── components/   # Reusable components
│   ├── context/      # React context providers
│   ├── navigation/   # Navigation setup
│   ├── screens/      # Screen components
│   ├── services/     # API service layer
│   ├── types/        # TypeScript type definitions
│   └── utils/        # Utility functions
└── README.md

Setup Instructions

Backend Setup

  1. Navigate to the backend directory:
cd backend
  1. Install dependencies:
go mod download
  1. Set up PostgreSQL database and create a database named pluralink

  2. Create a .env file in the backend directory (use .env.example as reference):

DB_HOST=localhost
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=pluralink
DB_PORT=5432
SERVER_PORT=8080
JWT_SECRET=your-secret-key-change-in-production
OAUTH_CLIENT_ID=your-oauth-client-id
OAUTH_SECRET=your-oauth-secret
OAUTH_REDIRECT=http://localhost:8080/api/auth/callback
  1. Run the server:
go run main.go

The server will start on http://localhost:8080

Frontend Setup

  1. Navigate to the frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Update the API base URL in frontend/services/api.ts if needed

  2. Start the development server:

npm start

For specific platforms:

  • iOS: npm run ios
  • Android: npm run android
  • Web: npm run web

API Endpoints

Authentication

  • POST /api/auth/register - Register a new user
  • POST /api/auth/login - Login
  • GET /api/auth/oauth - OAuth login
  • GET /api/auth/callback - OAuth callback

Providers

  • GET /api/providers - List providers (with filters)
  • GET /api/providers/:id - Get provider details
  • POST /api/providers - Create provider profile (protected)
  • PUT /api/providers - Update provider profile (protected)

Bookings

  • GET /api/bookings - List user's bookings (protected)
  • GET /api/bookings/:id - Get booking details (protected)
  • POST /api/bookings - Create booking (protected)
  • PUT /api/bookings/:id/reschedule - Reschedule booking (protected)
  • DELETE /api/bookings/:id - Cancel booking (protected)

Availability

  • GET /api/availabilities - Get my availabilities (provider, protected)
  • POST /api/availabilities - Create availability (provider, protected)
  • PUT /api/availabilities/:id - Update availability (provider, protected)
  • DELETE /api/availabilities/:id - Delete availability (provider, protected)

Reviews

  • POST /api/reviews - Create review (protected)
  • GET /api/reviews/provider/:id - Get provider reviews
  • GET /api/reviews/client/:id - Get client reviews

Search

  • GET /api/search/providers - Search providers
  • GET /api/search/categories - Get all categories

Database Models

  • User: Base user model with authentication
  • ServiceProvider: Provider profile with business details
  • Client: Client profile
  • Category: Service categories
  • Service: Services offered by providers
  • Availability: Time slots availability
  • Booking: Appointment bookings
  • Review: Reviews from both parties

Development Notes

  • The backend uses GORM auto-migration to create database tables
  • Categories are seeded automatically on server start
  • JWT tokens are used for authentication
  • CORS is enabled for all origins (configure for production)
  • Location-based search uses simple distance calculation (consider PostGIS for production)

Next Steps

  1. Implement proper geospatial queries for location-based search
  2. Add email notifications for bookings
  3. Implement payment integration
  4. Add image uploads for provider profiles
  5. Implement push notifications
  6. Add calendar integration
  7. Enhance OAuth implementation with user info fetching
  8. Add unit and integration tests

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors