A carpooling application for skiers and snowboarders to find or offer rides to ski resorts.
This repository contains both frontend and backend code for the Ski Carpool application:
- /vite-frontend/ - React frontend built with Vite
- /backend/ - Node.js/Express backend with Supabase integration
-
Navigate to the backend directory:
cd backend -
Install dependencies:
npm install -
Start the development server:
npm run dev
The backend API will be available at http://localhost:3000
-
Navigate to the frontend directory:
cd vite-frontend -
Install dependencies:
npm install -
Start the development server:
npm run dev
The frontend will be available at http://localhost:5173
- User authentication (sign up, login, profile management)
- Create and search for rides to ski resorts
- Request to join rides as a passenger
- Accept/reject ride requests as a driver
- View upcoming and past trips
- Frontend: React, Vite, CSS
- Backend: Node.js, Express, Supabase (PostgreSQL)
- Authentication: JWT, Supabase Auth
The application uses Supabase with the following tables:
- id: UUID, primary key
- driver_id: UUID, foreign key to profiles.id
- departure_location: text
- destination: text
- departure_time: timestamptz
- available_seats: int4
- price: numeric
- created_at: timestamptz
- id: UUID, primary key
- ride_id: UUID, foreign key to rides.id
- passenger_id: UUID, foreign key to profiles.id
- status: text ('pending', 'accepted', 'rejected', 'cancelled')
- created_at: timestamptz
- id: UUID, primary key (linked to auth.users.id)
- username: text
- full_name: text
- avatar_url: text
- created_at: timestamptz
- POST /api/auth/signup: Register a new user
- POST /api/auth/login: Login a user
- POST /api/auth/logout: Logout a user
- GET /api/auth/me: Get current user data
- GET /api/profiles/me: Get current user's profile
- PUT /api/profiles/me: Update current user's profile
- GET /api/profiles/:id: Get profile by ID
- GET /api/rides: Get all rides with filters
- GET /api/rides/:id: Get a specific ride by ID
- POST /api/rides: Create a new ride
- PUT /api/rides/:id: Update a ride
- DELETE /api/rides/:id: Delete a ride
- GET /api/rides/driver/me: Get rides offered by the current user
- GET /api/requests/ride/:rideId: Get all ride requests for a ride (driver only)
- GET /api/requests/passenger/me: Get all ride requests made by current user
- POST /api/requests: Create a new ride request
- PUT /api/requests/:id: Update a ride request status
- Clone the repository
- Install dependencies:
npm install - Create a
.envfile with the following variables:SUPABASE_URL=your_supabase_url SUPABASE_KEY=your_supabase_key PORT=3000 FRONTEND_URL=http://localhost:5173 - Start the development server:
npm run dev
- Node.js
- Express
- Supabase (PostgreSQL database)
- JWT Authentication
The frontend React application communicates with this backend through RESTful API calls. Make sure the FRONTEND_URL in your .env file matches your frontend's URL for proper CORS configuration.