E-commerce-mobile is an app created with react-native expo for the OneBitCode bootcamp.
First clone the project.
ssh
git clone git@github.com:OneBitCodeBlog/e-commerce-mobile-Dev.git
http
git clone https://github.com/OneBitCodeBlog/e-commerce-mobile-Dev.git
After cloning, access the project folder and use the package manager yarn to install dependencies.
yarn install
Or the package manager npm.
npm install
If you don't have expo-cli installed yet, you will receive a prompt, just type y
and press the enter key.
After the dependencies installation, access the project folder and execute the command bellow
yarn
yarn start
npm
npm start
After a while, your browser will be open in the Metro bundler page, where you can run the project on your browser, an ios emulator, an android emulator or you can scan a qrcode to execute in your mobile device.
To use this project, you must have the e-commerce-api-dev setup and running.
To use with android emulator, you must run this command after start the app and the emulator:
adb reverse tcp:3000 tcp:3000
To use with Expo go, you must run the api server with the command:
bundle exec rails s -b 0.0.0.0
And must change the baseURL
property from services/api.ts
to your IP.
Example:
From:
const api = axios.create({
baseURL: 'http://localhost:3000'
});
to:
const api = axios.create({
// check your local network IP and replace it bellow
baseURL: 'http://<your IP>:3000'
});