Code Monkey home page Code Monkey logo

hooligram-client's People

Contributors

imranariffin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hooligram-client's Issues

force update

  • Fetch min version from backend
  • If version on the app < min version lock the whole application to a single screen
  • The screen should provide link to the Hooligram download page on play store

It is best to implement this as soon as v1 so we won't have issues forcing clients to update on major releases.

Improve conversation UX

Issues:

  • Chat should scroll down after a new message so that it's visible
  • Add chat sound effect.
  • Don't allow newline like in WhatsApp.
  • Move the send button to the keyboard (bottom right).
  • Fix message input expanding horizontally for long messages.

design migration strategy

I realize we maybe need to force client to fetch migration script from server, otherwise there is no way the client can get the latest migration scripts without upgrade or codepush.

I have sketched some rough strategy but I'm not sure if this is over the top nor do I know what's the best practice for mobile database migration, but here it is:

migration-strategy-v1

inconsistent file naming

The file names are not consistent and it's not obvious why certain name convention is used. For example hooligramApi.js & persistence-api.js

refactor/migrate-to-react-native-config

react-native-dotenv has been very buggy in picking up changes in .env file -- it is very annoying to add, for example, a new line just to trigger it to pick up the changes and even then it may not work and even when it does work you cannot remove the added new line or else your changes to .env will be ignored again without you realizing it.

I suggest we migrate to react-native-config which I have used at work. Never had a problem with it so far.
link: https://github.com/luggit/react-native-config

Put action types in one place

I think we should put all the action types in one place. Actions are/should be the only way to change the state of the app. Putting them in one place will make it easy to understand the code base. As of now, they are scattered across the app. If we put all possible action types in one place, it will be easier to draw out the Finite State Machine (FSM) later.

setup pre-push git-hook

run test pre-push, push should fail if not all tests pass and message should be displayed.

Create app/apis directory

I think we should move hooligram-api & persistence-api directories to app\apis directory. Once in there, let's name them hooligram & persistence

bug/persistence-saves-state-to-storage-when-it-shouldnt

The expression used against action type in persistence middleware is incorrect:

if (
  action.type.startsWith('PERSISTENCE:') && (
    !action.type.match(/API:(.*)_SUCCESS/) || 
    !action.type.match(/API:(.*)_FAILURE/)
  )
) {
  // do not save state to storage
  return
}
// save state to storage

When:
Action is dispatched that is not an api response

Expected:
State should not be persisted

Actual:
State is persisted

spike on fastlane+fabric

  • Fabric.io is a simple tool to distribute apks for android and ios apps
  • Fastlane is a simple tool to release android & ios apps

authenticate & navigate on app startup

So far, every time the app starts up, it will go through onboarding. Once #47 is merged, we should work on enabling the app to:

  1. authenticate on startup
  2. decide based on authentication outcome whether to go through onboarding or navigate right away to global chat screen.

setup state persistence

  • update local storage everytime state changes
  • on app startup, define initial state using persisted state from storage
  • user of persistence must be agnostic of underlying persistence implementation ie api user doesn't care if using AsyncStorage vs SQLite etc.

docs/how-to-connect-to-local-server

I just found a way to connect to local server: storybook-eol/react-native-storybook#107

I will add an instruction to README.md something like the following

  1. Assume local server is running on ws://localhost:8080 (see hooligram-server README on how to run server locally)
  2. set API_HOST=ws://localhost:8080 in .env file
  3. run emulator
  4. adb tcp:8080 tcp:8080
  5. yarn android
  6. check out the redux logger and you should see API_INIT_SUCCESS is being logged

remove/minize warnings during yarn or npm install

This is ugly and, most importantly, likely to cause issues in the future:

yarn install v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > [email protected]" has incorrect peer dependency "react-native-vector-icons@^4.2.0".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/plugin-proposal-class-properties > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/plugin-proposal-object-rest-spread > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/plugin-proposal-optional-chaining > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/plugin-transform-flow-strip-types > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
warning "babel-preset-react-native > @babel/plugin-transform-react-jsx > @babel/[email protected]" has incorrect peer dependency "@babel/[email protected]".
[4/4] Building fresh packages...
warning Your current version of Yarn is out of date. The latest version is "1.13.0", while you're on "1.12.3".

Should we remove form states from the store?

export const FORMS_VERIFICATION_SET_PHONE_NUMBER = 'FORMS:VERIFICATION_SET_PHONE_NUMBER'
export const FORMS_VERIFICATION_SET_COUNTRY_CODE = 'FORMS:VERIFICATION_SET_COUNTRY_CODE'
export const FORMS_VERIFICATION_SET_CODE = 'FORMS:VERIFICATION_SET_CODE'
export const FORMS_SET_USERNAME_INPUT = 'FORMS:SET_USERNAME_INPUT'
export const setVerificationCode = (code) => {
return {
type: FORMS_VERIFICATION_SET_CODE,
payload: {
code
}
}
}
export const setPhoneNumber = (phoneNumber) => {
return {
type: FORMS_VERIFICATION_SET_PHONE_NUMBER,
payload: {
phoneNumber
}
}
}
export const setCountryCode = (countryCode, countryName) => {
return {
type: FORMS_VERIFICATION_SET_COUNTRY_CODE,
payload: {
countryCode,
countryName
}
}
}
export const setUserNameInput = (userNameInput) => {
return {
type: FORMS_SET_USERNAME_INPUT,
payload: {
userNameInput
}
}
}

Reasoning:

  • Same reasoning for why it's a good idea to separate navigation from the store
  • I don't see any benefit of putting it there
  • Form states should be local to the component
  • It will simplify the shape of the store

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.