Skip to content

Latest commit

 

History

History
99 lines (87 loc) · 2.79 KB

README.md

File metadata and controls

99 lines (87 loc) · 2.79 KB

PAYAM

Table of Contents

Introduction

This is a mobile application built with react native on the front and a graphql server backend with MySQL. The mobile app is a simple market app listing products fetched from the database.

Loading Data Products Displayed
Loading Products

Getting Started

Requirement:

  1. Node
  2. Docker (for the backend)
  3. Xcode and support tools (for ios development)
  4. Android Studio and support tools (for android development)

Clone, download or fork the repo.

Developer Guide

You will need to setup the frontend and backend.

Backend API

Open the api folder

cd api

Install dependencies.
npm:

npm install

yarn:

yarn install

You then need to spin a container to connect mysql

docker-compose up

You then need to configure knex to connect to you database.

  1. Obtain the ip address by running the following command in the api folder

    ifconfig -l | xargs -n1 ipconfig getifaddr
    

    This will produce the ip address to be added in your .env file

  2. Create an .env file in your api directory following:

    IP_ADDRESS = <Generated IP Address>
  3. You can open the web-based admin dashboard, adminer with the generated IP address. Open your browser at http://localhost:8080. Your credentials to login will be the same as that in the connection file. If you create another user with the appropriate permissions, you can also login with that too.

Frontend App

Open the client folder

cd client

Install dependencies.
npm:

npm install

yarn:

yarn install

Start the server:

npm run start

Create an .env file in your client directory following:

EXPO_PUBLIC_GRAPHQL_URI=http://000.000.000.000:4000

If you are developing locally, the IP address will be the same generated from the backend command:

   ifconfig -l | xargs -n1 ipconfig getifaddr

If you have a production server, the environment variable EXPO_PUBLIC_GRAPHQL_URI will be the graphql server link.

Congratulations, you can start your development journey!

Build

For the backend, you will need to host the server with a provider. For the frontend mobile app, Check out the EAS Guide.

Contribution

Feel free to fire an issue if any or a pull request. Find this project helpful? Leave me a star.