Skip to content

Shakhrai8/trail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trail - Discover the World around you

Trail Animated Logo

Trail is an intuitive, user-friendly web application that helps users discover the top 5 historical sites near their location. Users can get detailed descriptions of each location, complete with text-to-speech functionality and step-by-step navigation. We leverage the Google Places API for location data, and OpenAI's GPT for generating engaging and informative descriptions.

The application is live and can be accessed at trailapp.net.

JavaScript React Express.js Node.js Cypress Jest HTML5 CSS3 AI Google Cloud

Table of Contents

Installation and Configuration

1. Clone the repository:

git clone https://github.com/Shakhrai8/trail.git

2. Obtain necessary API keys:

Google Cloud API Key:

  • Create/login to your Google Cloud account: cloud.google.com
  • Navigate to APIs and Services
  • Create a new project and enable Places API, Distance Matrix API, Maps Javascript API, and Cloud Text-To-Speech API.
  • Generate an API Key under credentials.

OpenAI Key:

  • Head to openai.com and create an account.
  • Follow the instructions to generate an API key.

3. Set Environment Variables:

export GOOGLE_API_KEY=<insert key here>
export OPENAI_KEY=<insert key here>
export TextToSpeech_KEY=<insert RELATIVE PATH to key file here>

4. Install dependencies:

  • Navigate to the api directory and install:

    cd trail/api/
    npm install
    
  • Navigate to the frontend directory and install:

    cd ../frontend/
    npm install
    

Screenshots

Directory Structure

This project is organized into two main directories:

  • api/: This directory contains the backend server logic written in Express. The routes/, controllers/, and common/ folders can be found here. The common/ folder contains all the required API call files.
  • frontend/: This directory houses the React frontend. All the components used in the project are contained in the src/ directory.

Usage

To run the server:

  1. Go to api/bin/:

    cd api/bin/
    
  2. Run the following command:

    node www.js
    

To run the frontend:

  1. Go to the frontend folder:

    cd ../../frontend/
    
  2. Run the following command:

    npm run dev
    

Now, the app should be running on your specified local port.

Testing

We use Jest for backend testing and Cypress for end-to-end testing on the frontend.

  • To run backend tests, navigate to the api directory and run jest.
  • To run frontend tests, navigate to the frontend directory and run npm run cypress:run.

Acknowledgements

About

Discover the World around you

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •