Code Monkey home page Code Monkey logo

tramp.os's Introduction

Tramp.Os Project Documentation

Introduction

Welcome to the official documentation of the Tramp.Os project, a mobile application developed in React Native with Expo. This project was undertaken as part of studies in a college course and utilizes the Jsearch API from RapidAPI to search for job opportunities and display them in the application.

Project Structure


The project is structured as follows: (major folder structure)

Tramp.Os/
|-- app/
|   |-- jobdetails/
|   |-- search/
|   |-- _layout.js
|   |-- home.js
|   |-- index.js
|-- assets/
|   |-- fonts/
|   |-- icons/
|   |-- images/
|-- components/
|   |-- common/
|	|   |-- cards/
|	|   |-- header/
|   |-- home/
|	|   |-- nearby/
|	|   |-- popular/
|	|   |-- welcome/
|   |-- jobdetails/
|	|   |-- about/
|	|   |-- company/
|	|   |-- footer/
|	|   |-- specifics/
|	|   |-- tabs/
|   |-- index.js
|-- constants/
|   |-- icons.js
|   |-- images.js
|   |-- index.js
|   |-- theme.js
|   hook/
|   |-- useFetch.js
|-- styles/
|   |-- search.js
|-- utils/
|   |-- index.js
|-- package.json
|-- ...
  • The /components/ folder contains reusable components.

  • The hooks/ folder contains the useFetch file, responsible for making calls to the Jsearch API using Axios.

Environment Setup


Ensure that Node.js, Expo CLI, and Yarn (or npm) are installed in your development environment. If not, follow the instructions in the official Expo documentation.

# Install Expo CLI globally
npm install -g expo-cli

# Install project dependencies
npm install

Project Dependencies


Tramp.Os uses several essential dependencies for development and proper application functioning. Below are the main dependencies, along with a brief explanation of each:

Expo is a platform that facilitates the development of React Native applications by providing additional tools and services. It simplifies tasks such as accessing native device resources, making multi-platform development easier.

# Expo CLI installation
npm install -g expo-cli

React Native is a framework for building mobile applications using React and JavaScript. It enables the development of native iOS and Android apps with a common codebase.

# React Native installation
npm install react-native

Axios is a Promise-based HTTP client used for making HTTP requests. It simplifies the process of communicating with APIs, providing an easy-to-use interface for making requests and handling responses.

# Axios installation
npm install axios

JavaScript is the programming language used to develop logic and dynamic interaction in Tramp.Os. It is the primary programming language for web and mobile development, providing the ability to create interactive and responsive applications.

No separate installation of JavaScript is required, as it is interpreted by browsers or the Node.js environment.

Jsearch API Configuration


The project uses the Jsearch API from RapidAPI to search for job opportunities. To configure the API, follow these steps:

  1. Access RapidAPI.
  2. Create an account or log in if you already have one.
  3. Subscribe to the free plan of the Jsearch API.
  4. Get the Jsearch API key on the RapidAPI settings page.
  5. Replace the API key in the hook/useFetch.js file.
// src/services/api.js

import { useState, useEffect } from "react";
import axios from "axios";

const useFetch = (endpoint, query) => {
  const [data, setData] = useState([]);
  const [isLoading, setIsLoading] = useState(false);
  const [error, setError] = useState(null);
  
  const options = {
    method: "GET",
    url: `https://jsearch.p.rapidapi.com/${endpoint}`,
    headers: {
      "X-RapidAPI-Key": 'YOUR_API_KEY',
      "X-RapidAPI-Host": "jsearch.p.rapidapi.com",
    },
    params: { ...query },
  };

  
  const fetchData = async () => {
    setIsLoading(true);
    try {
      const response = await axios.request(options);
  
      setData(response.data.data);
      setIsLoading(false);
    } catch (error) {
      setError(error);
      console.log(error)
    } finally {
      setIsLoading(false);
    }
  };

  
  useEffect(() => {
    fetchData();
  }, []);

  const refetch = () => {
    setIsLoading(true);
    fetchData();
  };

  return { data, isLoading, error, refetch };
};
  

export default useFetch;

Running the Project


With the dependencies installed and the API key configured, you can start the project with the following command:

npx expo start

This will open the Expo Developer Tools in your browser. You can then run the app on an emulator or on a physical device using the Expo Go app.

Notes

This project was developed based on a tutorial and as part of an academic project. If you encounter difficulties or want to contribute, feel free to open an issue or submit a pull request on the GitHub repository.

Project GitHub: Tramp.Os


We hope this documentation is helpful for understanding the structure and setting up the environment for the Tramp.Os project. If you have additional questions, refer to the official Expo and React Native documentation.

tramp.os's People

Contributors

yan-pi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.