Code Monkey home page Code Monkey logo

react-native-goals's Introduction

React Native Goals

Mobile app of React Daily Goal Tracker, a web app I build previously to track weekly goals on a daily basis.

User journey

This is a weekly goal tracking app, which means its purpose is to set weekly goals to meet each day.

When the app is opened, the user can access the Goals screen by either using a guest account, registering a new account or loggin in his/her own account.

If a page is refreshed or reloaded, the account and the goal are persisted, which means that the user session is kept, hence the account keeps being logged in.

Refresh token

This app uses the Refresh token with rotation security strategy

Note

This app uses Expo - a framework to develop React Native apps easily withouth worrying about all the setup needed to start working on a native mobile app - and Expo Go, a sandbox that let you run and test your locally developed app on a physical device (IOS or Android) without needing to publish your app on the respective app store

Technologies being used

Requirements

Make sure to have installed the Latest Stable Version of Node on your machine. This is to avoid incompatibilty and/or conflict issues among the needed dependencies to run the app

Install common dependenceis

Run the command npm i at the root folder level

Start Backend locally

Configure environment variables

In the apps/react-native-goals-backend directory, create an .env file with the following environment variables:

DATABASE_URL:file:./src/prisma/dev.db

ACCESS_TOKEN_SECRET='password_you_set'
ACCESS_TOKEN_EXPIRATION=1h
REFRESH_TOKEN_SECRET='password_you_set'
REFRESH_TOKEN_EXPIRATION=6h

Install dependencies

  • Open a terminal in the project root folder
  • Run cd apps/react-native-goals-backend
  • Run npm i
  • Run npm run prisma:generateClient
  • Run npm run start:watch

Run the frontend locally

Download the Expo Go app

Download Expo Go from the app store of your mobile device (App Store for IOS and Play Store for Android)

Expose the local server with Ngrok

  • Download and intstall Ngrok, a software needed to expose the local backend server to the internet, so that it is accessible from the Expo Go app
  • Open a terminal
  • Run the command ngrok http 3000
  • Once Ngrok generates the public url, open apps/react-native-goals-frontend/src/components/router/Router.tsx and replace the url inside the httpLink variable, as shown below

const httpLink = new HttpLink({ uri: <replace link here>, });

Install dependencies

  • Open a terminal in the project root folder
  • Run cd apps/react-native-goals-frontend
  • Run npm i
  • Run npm run start (you may need to run expo in tunnel mode in some cases, with the npm run start:tunnel command)

Features to add

  • App tour
  • Automated tests for frontend app
  • Google sign in
  • Publish app on Google Play Store
  • Publish app on Apple App Store

react-native-goals's People

Contributors

davide2894 avatar turbobot-temp avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

onurgezgin2

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.