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 |
---|---|
Requirement:
- Node
- Docker (for the backend)
- Xcode and support tools (for ios development)
- Android Studio and support tools (for android development)
Clone, download or fork the repo.
You will need to setup the frontend and backend.
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.
-
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
-
Create an .env file in your api directory following:
IP_ADDRESS = <Generated IP Address>
-
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.
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!
For the backend, you will need to host the server with a provider. For the frontend mobile app, Check out the EAS Guide.
Feel free to fire an issue if any or a pull request. Find this project helpful? Leave me a star.