Skip to content

EPSpaces/EPShareRides

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

330 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EPCarpool πŸš—πŸŒ±

Live Site Node.js MongoDB License

A sustainable carpooling platform for Eastside Preparatory School students to share rides to school events while reducing their carbon footprint.

🌟 About

EPCarpool was born from the first EPS Hackathon in January 2024, addressing the challenge: "How can we make EPS more sustainable?" Rather than just raising awareness, we chose to create a practical solution that empowers students to take direct climate action through carpooling.

The platform enables students to coordinate rides for school eventsβ€”sports games, academic competitions, social gatherings, and moreβ€”transforming transportation into a collaborative, eco-friendly experience that builds community while protecting the environment.

✨ Key Features

πŸš— Smart Carpooling System

  • Create & Join Carpools: Organize rides for any EPS event with detailed route information
  • Intelligent Matching: Get personalized carpool recommendations based on your interests (sports, academics, social events)
  • Real-time Management: Handle passenger requests, track available seats, and manage your carpools

🌍 Environmental Impact Tracking

  • CO2 Savings Calculator: Automatically calculate environmental impact using EPA emission standards (0.404 kg CO2/mile)
  • Personal Impact Dashboard: Track your cumulative CO2 savings over time
  • Visual Equivalents: See your impact in relatable terms (plastic bottles, rice servings equivalent)
  • Community Goals: Work together toward school-wide sustainability targets

πŸ—ΊοΈ Location & Route Features

  • Interactive Maps: Visualize pickup routes and event locations using Leaflet mapping
  • Address Geocoding: Automatic conversion of addresses to coordinates for accurate routing
  • Distance Calculation: Smart algorithms to optimize routes and calculate travel distances

πŸ‘€ User Experience

  • Secure Authentication: Firebase-powered login system with EPS email verification
  • Personalized Settings: Customize notification preferences and interests
  • Event Categories: Filter by sports, academic, social, and other event types
  • Responsive Design: Works seamlessly on desktop and mobile devices

πŸ›‘οΈ Safety & Security

  • School Email Verification: Restricted to verified EPS students and staff
  • Rate Limiting: Protection against abuse with intelligent request throttling
  • Data Privacy: Secure handling of personal information and location data
  • Admin Controls: Administrative oversight for platform management

πŸš€ Getting Started

Prerequisites

  • Node.js (v22.x or higher)
  • MongoDB database
  • Firebase service account credentials
  • EPS email account for authentication

Installation

  1. Clone the repository

    git clone https://github.com/EPSpaces/EPShareRides.git
    cd EPShareRides
  2. Install dependencies

    npm install
  3. Configure environment

    Contact the development team for required configuration files:

    • .env - Environment variables
    • service_account.json - Firebase credentials
    • config.js - Application configuration

    πŸ“§ Contact: ajosan@eastsideprep.org, nmahesh@eastsideprep.org, ayamashita@eastsideprep.org

  4. Set development mode

    # In your .env file
    MODE=DEV
  5. Start the development server

    npm run dev

    The application will start at http://localhost:3000 with hot reloading via nodemon.

Production Deployment

npm start

The app is configured for Google Cloud Platform deployment with automatic scaling.

πŸ—οΈ Architecture

Technology Stack

  • Backend: Node.js with Express.js framework
  • Database: MongoDB with Mongoose ODM
  • Authentication: Firebase Authentication
  • Frontend: EJS templating with Bulma CSS framework
  • Maps: Leaflet.js for interactive mapping
  • Testing: Jest with Supertest for API testing
  • Deployment: Google Cloud Platform App Engine

Project Structure

EPShareRides/
β”œβ”€β”€ index.js                 # Main server file
β”œβ”€β”€ package.json             # Dependencies and scripts
β”œβ”€β”€ app.yaml                 # GCP deployment configuration
β”œβ”€β”€ jest.config.js           # Test configuration
β”‚
β”œβ”€β”€ routes/                  # Express route handlers
β”‚   β”œβ”€β”€ apiRoutes.js        # API endpoints for carpools, events, CO2 tracking
β”‚   └── authRoutes.js       # Authentication routes
β”‚
β”œβ”€β”€ schemas/                 # MongoDB data models
β”‚   β”œβ”€β”€ User.model.js       # User account information
β”‚   β”œβ”€β”€ Carpool.model.js    # Carpool details and participants
β”‚   β”œβ”€β”€ Event.model.js      # School events
β”‚   └── UserSettings.model.js # User preferences
β”‚
β”œβ”€β”€ utils/                   # Utility functions
β”‚   β”œβ”€β”€ authUtils.js        # JWT authentication helpers
β”‚   β”œβ”€β”€ co2Calculator.js    # Environmental impact calculations
β”‚   β”œβ”€β”€ distanceUtils.js    # Route distance calculations
β”‚   β”œβ”€β”€ geoUtils.js         # Geocoding and location services
β”‚   └── studentUtils.js     # Student data processing
β”‚
β”œβ”€β”€ public/                  # Static frontend assets
β”‚   β”œβ”€β”€ js/                 # Client-side JavaScript
β”‚   β”œβ”€β”€ style.css           # Custom styling
β”‚   β”œβ”€β”€ bulma.min.css       # UI framework
β”‚   └── *.js                # Feature-specific scripts
β”‚
β”œβ”€β”€ views/                   # EJS templates
β”‚   β”œβ”€β”€ index.ejs           # Dashboard homepage
β”‚   β”œβ”€β”€ mycarpools.ejs      # Personal carpool management
β”‚   β”œβ”€β”€ findrides.ejs       # Browse available rides
β”‚   └── *.ejs               # Additional pages
β”‚
└── __tests__/              # Test suites
    └── *.test.js           # Jest test files

πŸ§ͺ Testing

Run the comprehensive test suite:

npm test

Tests cover:

  • API endpoint functionality
  • Carpool recommendation algorithms
  • CO2 calculation accuracy
  • Authentication flows
  • Database operations

🌱 Environmental Impact

EPCarpool calculates real environmental benefits:

  • CO2 Reduction: Uses EPA standards (0.404 kg CO2 per mile) for accurate calculations
  • Passenger Sharing: Each additional passenger significantly reduces per-person emissions
  • Visual Impact: Converts savings to understandable equivalents
  • Community Goals: Tracks school-wide progress toward sustainability targets

Example Impact

A 4-person carpool for a 20-mile round trip saves approximately 2.42 kg CO2 compared to driving separatelyβ€”equivalent to the CO2 used in producing 29 plastic water bottles!

🀝 Contributing

We welcome contributions from the EPS community! Here's how to get involved:

Development Guidelines

Code Style:

  • Follow JavaScript/Node.js best practices
  • Use camelCase for variables and functions
  • Use PascalCase for classes and models
  • Write descriptive commit messages
  • Include tests for new features

Architecture Patterns:

  • Organize routes by functionality in separate files
  • Use MongoDB/Mongoose patterns for database operations
  • Implement async/await for asynchronous operations
  • Handle errors with comprehensive try/catch blocks
  • Comment complex business logic and algorithms

How to Contribute

  1. Fork the repository and create a feature branch
  2. Make your changes following the style guidelines
  3. Add tests for any new functionality
  4. Run the test suite to ensure everything works
  5. Submit a pull request with a clear description of changes

Reporting Issues

Found a bug or have a feature request? Please create an issue with:

  • Clear description of the problem/request
  • Steps to reproduce (for bugs)
  • Expected vs actual behavior
  • Screenshots if applicable

πŸ“ License

This project is licensed under the ISC License - see the LICENSE file for details.

πŸ‘₯ Team

EPCarpool is developed and maintained by EPS students and faculty:

πŸ™ Acknowledgments

  • EPS Hackathon 2024 - Where the idea was born
  • Eastside Preparatory School - For supporting student innovation
  • Environmental Protection Agency - For CO2 emission standards
  • Open Source Community - For the amazing tools and libraries

Ready to reduce your carbon footprint while connecting with your EPS community? Start carpooling today! πŸŒπŸš—

Visit us at epcarpool.com or contact the development team for questions and support.

About

A place for students to connect on carpools for events.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors