r/reactnative • • Feb 03 '20

After almost a year of learning React Native, here is my first full project, Ledger - a workout logging and analytics app

435 Upvotes

140 comments sorted by

39

u/draftax5 Feb 03 '20 edited Feb 03 '20

I built this out of my own frustration with the weight lifting / workout apps currently out there. I don't necessarily want to choose from someone else's pre built workouts. I want an app where I can simply create my own workouts without having to choose from pre made workouts, where I can see and follow my progress with analytics, and where the app keeps track of my overall metrics such as weight, rest time, etc.

I couldn't find anything the really fit what I wanted well enough, so I built my own, partly to solve my problem, and also to gain more experience building a full scale application.

I built a landing page for it as well since I needed to host the API anyway:

Ledger

EDIT:

If you are interested in the stack:

Backend:

- Node /Express REST API with JWT for auth

- Used Joi to help with validation

DB:

- MongoDB

- I usually work with SQL databases and wanted to try out NoSQL. I figured the structure of a workout app with workout logs would make sense to use a NoSQL structure. It worked pretty well especially using the mongoose ODM.

Everything for the backend is dockerized and hosted on AWS

Using travis for CI which builds my images on successful tests pushes to my registry. I am fairly new to devops so I have a lot to learn here.

Frontend:

- I wanted to focus on custom Components so nearly everything is built from scratch. I wanted a smooth feel so I tried to focus heavily on animations.

- In my opinion one of the big benefits React Native has is their animations API so I heavily utilized that.

- Another focus was on charts and analytics, I custom built many of the charts using forked react-native-svg-charts Components.

Any questions just ask!

6

u/nousetlogos Feb 03 '20

Thanks for sharing the stack--I'm always interested in what people are using. It looks really great! I'd be interested in how it will look at Android as I think making UIs look great on both platforms is a challenge of using RN. I think it will work out well though, since the UI seems pretty customized (compared to the typical iOS app).

1

u/draftax5 Feb 03 '20

Thanks! Yeah hopefully it will look alright, I am sure there will be a few issues because I know some of the effects such as Blur that I used are iOS only, but hopefully it won't be too tough to get it looking similar in android.

5

u/[deleted] Feb 03 '20

Dude, nice f***ing work. This looks so smooth. If you find yourself feeling it, use Typescript on the backend. Killer design!

3

u/draftax5 Feb 03 '20

Thanks a lot man! Typescript is one of the next things I want to learn!

How difficult is it to pick up and get comfortable with?

4

u/[deleted] Feb 03 '20

So if you convert your project to typescript it will just work out of the box. Once you start setting flags like “strict” (highly suggest this) it will start to yell at you about stuff. It is amazing. I don’t know how I ever didn’t use it looking back. It would take you one night with a few beers to learn.

4

u/draftax5 Feb 04 '20

Awesome! This comment has convinced me to just do it cause I have heard mostly very good things similar to what you are saying

3

u/[deleted] Feb 04 '20

Awesome! Feel free to message me on keybase (u: elijahcobb) if you have any questions about it!

2

u/carlos_suds Feb 03 '20

These animations are FIRE man. Congrats, it looks really awesome. I'm definetely downloading it

2

u/draftax5 Feb 03 '20

Thank you! If you do download it let me know if you have any suggestions / feedback!

2

u/carlos_suds Feb 03 '20

I was super excited but then I saw its only available for ios :'( Nonetheless, I sent it to my gf and she also was amazed by the UI :)

2

u/draftax5 Feb 04 '20

Thank you!! I am working on getting it out for android next!

1

u/carlos_suds Feb 04 '20

RemindMe! 3 Months

1

u/RemindMeBot Feb 04 '20 edited Feb 04 '20

I will be messaging you in 3 months on 2020-05-04 16:45:52 UTC to remind you of this link

1 OTHERS CLICKED THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


InfoCustomYour RemindersFeedback

1

u/carlos_suds May 04 '20

Hi, im back after these months to know if its available for android now. :)

1

u/madcapnmckay Feb 04 '20 edited Feb 04 '20

This looks great so far. Is there a way to add missing exercises? I couldn’t find, reverse plank, hollow hold, side plank.

2

u/draftax5 Feb 04 '20

Unfortunately not yet, it's next on my list of things to add though!

1

u/madcapnmckay Feb 04 '20

Great thanks. Just a thought, you could pool user submitted exercises to quickly fill out your database, you'll end up with some dupes as people call the same exercise different things but can either keep the dupes or tidy up after.

1

u/Morsmetus Feb 04 '20

Just curious, did you use Redux or any state management tool? What middleware did you use?

2

u/draftax5 Feb 04 '20

Yeah, I used redux for state management with redux persist, and I used redux-saga for async stuff.

1

u/abiespinal04 Feb 04 '20

Hi, nice job buddy. Why use redux-saga and not thunk?

1

u/Xaurn Feb 05 '20

Looks amazing! How did you implement the weight slider?

1

u/draftax5 Feb 05 '20

Hey thanks!

Its just a scrollview with the snapToInterval prop set and then the interval is calculated based on a min and max number!

1

u/SWEMan0 Oct 27 '21

How long did it take? Approx how many hours

1

u/draftax5 Oct 27 '21

I didn’t keep very close track. Many months

2

u/darrylyoung Feb 03 '20

This looks great. Thanks for sharing. Gonna download and check it out.

9

u/[deleted] Feb 03 '20

The UI looks great 👍

3

u/gketuma Feb 03 '20

Great work. Can you post more about your implementation?

2

u/draftax5 Feb 03 '20

Thanks u/gketuma! I edited my comment above with more info but I will post it here too:

Backend:

- Node /Express REST API with JWT for auth

- Used Joi to help with validation

DB:

- MongoDB

- I usually work with SQL databases and wanted to try out NoSQL. I figured the
structure of a workout app with workout logs would make sense to use a No SQL
structure. It worked pretty well especially using mongooses ODM.

Everything for the backend is dockerized and hosted on AWS

Using travis for CI which builds my images on successful merges to master and pushes to my registry. I am fairly new to devops so I have a lot to learn here.

Frontend:

- I wanted to focus on custom Components that I could reuse so nearly everything is
built from scratch. I wanted a smooth feel so I tried to focus heavily on animations.

- In my opinion of on the big benefits React Native has is their animations API so I
heavily utilized that.

- Another focus was on charts and analytics, I custom built many of the charts using a
fork of react-native-svg.

Any questions just ask!

3

u/foocux Feb 03 '20

I loved the UI. If you don't mind, I'd like to know more about how you created the charts. Also, are you using expo or just react-native-cli?

4

u/draftax5 Feb 03 '20

Hey! Thanks a lot! Yea definitely, for the charts I started with this library react-native-svg-charts which is actually pretty awesome in itself, it is built on top of react-native-svg.

But the problem is only basic bar and line charts are supported (plus a few others), and I wanted something that looked a little cooler, so I forked the bar chart and added the ability to use gradients, and then added the ability for bars to start at different points on the y axis as well, so that way I could base it on the time a workout was started.

Do change those things I changed a decent amount of the source code but I was able to keep a lot of it as well.

As for knowing what to change and how to do it, I spent some time reading through the react-native-svg docs which is closely based on web svg, and once I started to understand that it became a little easier. The charts were definitely the trickiest part though, and there are still minor quirks with things like the number of ticks on the x axis that I need to improve.

1

u/foocux Feb 05 '20

That sounds so cool. Also, did you use expo or just pure react-native(cli)?

1

u/ahvmckay Feb 24 '20

Is your fork available in a public repo?

2

u/[deleted] Feb 03 '20

Great looking UI!

1

u/draftax5 Feb 03 '20

Thank you! That means a lot!

2

u/[deleted] Feb 03 '20

I’ve been looking for an app exactly like this one! My only wish is that it would store my data client side instead of having to connect to a backend

2

u/draftax5 Feb 03 '20

u/slash_20chars I went back and forth for so long on which way I should go with the data storage part!

I ended up deciding to store it in a backend DB because I figured if I want to continue building out the analytics / chart options I could do all of the data transformation on the server and then only send back what I need for that specific chart instead of for example having to map through an entire year of workout logs just to grab a specific exercise's data on the client which might have less powerful CPU.

Also I am not sure of anything client side that can handle No SQL structure with that much potential data? I am sure something exists though!

2

u/vertigo_101 Feb 03 '20

Amazing stuff mate

2

u/draftax5 Feb 03 '20

Thank you!!

2

u/scrook Feb 03 '20

Great looking app! What did you use to make the GIF in this post?

2

u/draftax5 Feb 03 '20

Thank you!

I recorded the video with the iOS simulator using the command line to get the masks, and then ran it through iMovie to crop it correctly. I'm pretty new with anything to do with video editing so it was pretty basic.

2

u/Hazy_Fantayzee Feb 03 '20

Heh... one of the first apps I want to properly build is a workout app for the exact same reasons as your self (all the ones I have tried so far are all slightly lacking in at least one - often more! - departments).

App looks great mate! Did you do ALL the UI/animations yourself? Very impressive - I'm currently trying to learn the Animated API at the moment and its all a little over my head at the moment. Care to share your learning path for that side of things?

EDIT: I'd also like to add to the voices asking for an Android version....

1

u/draftax5 Feb 04 '20

Thank you!! Yeah I did all of the UI and animations myself, one of my main goals was to make a smooth feeling app so I focused heavily on the UI and animations, super glad you like them!

The animations API can be a little hard to grasp initially but once you get it, it will start to make sense and it is so powerful!

Honestly I just used trial and error and kept going back to the docs and re reading when I ran into a wall. Also something that really helped was looking at the source code of other libraries that use animations such as react-navigation.

One source I can recommend though that is a bit easier to understand than the animation API docs is https://animationbook.codedaily.io/introduction/

1

u/Hazy_Fantayzee Feb 04 '20

Thanks for replying, I guess nothing really beats trial and error! In regards to looking at source code of other libraries, I've given that a go but so many of them are in Typescript and as a TS virgin a lot of them are hard to follow. I'll def make more of an effort to poke around in them though as I progress.

Good luck with your future RN endeavors, looks like your a natural judging by your first effort!

2

u/J-Wh1zzy Feb 03 '20

This looks awesome! I love the gradient and how it flows through the graphs. Nice work. This looks really clean.

What library did you use for the graphs?

2

u/draftax5 Feb 04 '20

Thanks a lot! I forked react-native-svg-charts and customized it to allow the gradients!

2

u/A3mercury Feb 04 '20

Killer job! I’ve been getting back into working out this year and I feel the same way about apps out there now. Definitely just downloaded and I’m gonna give this a shot.

2

u/draftax5 Feb 04 '20

Thanks! If you try it out definitely let me know if you find any bugs or have any suggestions!

2

u/beniman8 Feb 04 '20

This is amazing

1

u/draftax5 Feb 04 '20

Thank you!

2

u/jmar31 Feb 04 '20

This is beautiful! A fantastic first app. Congratulations. Let me know if you’re looking to do your second ;)

1

u/draftax5 Feb 04 '20

Haha you got any ideas?!

1

u/jmar31 Feb 05 '20

Yes I do. Meet me in the DMs.

2

u/[deleted] Feb 04 '20

As a frontend developer currently working for a software company, this has motivated me massively to start learning React Native. We use React + Typescript day to day so hopefully it’s not too dissimilar and when (if) we move to native, I’ll have the jump start. Great work pal!

2

u/draftax5 Feb 04 '20

Awesome! Glad it helped!!

2

u/marius4896 Feb 04 '20 edited Feb 04 '20

Well done! really like the app. One question on that control to set the weight ( the dialer where you scroll horizontally) . i like how it stops only on predefined values. what did you use there?

1

u/draftax5 Feb 04 '20

I forked a similar slider Component I found, but really it is just a ScrollView Component that takes advantage of the snapToInterval prop :)

1

u/marius4896 Feb 04 '20

Can you please share with me the component you forked from?

2

u/draftax5 Feb 04 '20

Here you go: https://github.com/nicinabox/react-native-line-gauge

If you use the library directly try to give the author credit if you can! :)

1

u/marius4896 Feb 04 '20

Thank you!

2

u/ItTechBlogs Feb 04 '20

Nice job! Thanks for sharing.

1

u/draftax5 Feb 04 '20

Thanks you!

2

u/heresmyfrickeface Feb 04 '20

Has anyone asked you how you made the demonstration video/gif yet? Amazing work x

1

u/draftax5 Feb 04 '20

Hey thanks! I recorded the video with an iOS simulator using the command line to get the masks, and then I ran it through iMovie to get the background. I am super new to video editing so it was super basic haha

2

u/swese44 Apr 24 '20

Authentication is broken today :(

It's too bad this relies on server data instead of storing locally and doing a background sync. I can't even view my workout right now. Im guessing the app is probably not usable for people who work out where they don't have cell service or wifi.

2

u/draftax5 Apr 24 '20 edited Apr 24 '20

Server went down, fixed and working now.

I may work on moving towards local storage and background sync in the future but there are benefits to storing data on a server such as easier updates since I have access to the data, adding new features that require changing how things are stored, etc.

But there are downsides like you just experienced. So I am working towards something that will get the best of both worlds.

However, this app is free for everyone and I don't make any money off of it, actually I lose money by hosting it, dev account, etc. So major updates are not the highest thing on my priority list at the moment, I have been pretty busy so just maintaining has been enough haha. Hopefully you are enjoying the app otherwise!

1

u/swese44 Apr 24 '20

Otherwise the app is pretty good, I've been using it for several weeks.

1

u/swese44 Apr 24 '20

Back up now! Thanks

2

u/youngjustice204 May 05 '20

Nice! I’m gonna check this today

1

u/draftax5 May 05 '20

Cool! If you like it feel free to rate it on the App Store!

4

u/[deleted] Feb 03 '20

Jesus Christ that's pretty

1

u/OMDB-PiLoT Feb 03 '20

React Native ... no Android version? :(

8

u/draftax5 Feb 03 '20

Not currently. I mainly built it for myself and I have an iPhone, plus some of the animations and blurs are iOS only so I would have to implement those on android.However if anyone was interested in using it I could release it on android as well. Its FREE! lol

2

u/Lord_Cheese Feb 03 '20

I would love an Android version, and would be happy to provide feedback. I've been looking for literally this app for a long time.

1

u/draftax5 Feb 04 '20

Thanks! I would love the feedback! I am working on releasing the android version now!

4

u/patelrr_21 Feb 03 '20

Can you release on Android. Interested to look forward animations and performance specific for android. Actually I am thinking of building an app on react native :p

2

u/EvilMortyMM Feb 04 '20

Please make a andorid version :)

1

u/tjsix Feb 03 '20

Just a heads up, on my iPhone 8, if I tap 'Other Sign Up Options' on the main login screen, the 'Sign Up' button on the email/pw screen overlaps the 'Social Sign In Options' button. Also on the Sign in with Email page, the Forgot Password? link overlaps the social sign in button as well

2

u/draftax5 Feb 03 '20

u/tjsix thank you so much for letting me know! Fixed!

1

u/dtome00 Feb 03 '20

Looks pretty cool, I downloaded it and will let you know what I think. If you don’t mind me asking, how did you learn React Native? I’m a sophomore comp sci student proficient in Java Python SQL and C, and I really want to learn RN.

2

u/draftax5 Feb 03 '20

u/dtome00 Awesome! Any feedback (bugs or errors you find) will be greatly appreciated cause I am sure there are tons!

I jumped over to React Native after learning React, which I kind of self taught myself but I have more of a functional programming background vs yours sounds like more of a traditional object oriented background.

Both the React & React Native docs are great so I would start there, just keep in mind that the programming style might be a little weird for you at first since the React mindset is more functional IMO (even moving away from classes).

1

u/dtome00 Feb 03 '20

Great, thanks so much! I’ll get back to you on any bugs / suggestions I have!

1

u/ejDiDon Feb 03 '20

How did you build the bottom bar ..any suggestion or direction been trying to find how to build he same

1

u/draftax5 Feb 03 '20

Hey! Yea I am using React navigation for all of the navigation, so I just subbed out the navigation bar with my own custom one, they provide a prop to give your own navigation bar.

As for building the bar itself, it depends how you are going to hook it into your navigation but since I wanted mine to work with react-navigation I forked their bottom tab bar Component and then changed the functionality and styling to suit my needs (to allow the middle button to open a modal with more buttons, etc). And the rest is just animations.

That way I could see what props were required, what was used, etc and I knew what I needed to change.

I hope that helps!

1

u/ejDiDon Feb 04 '20

Amazing ! do share any extra or code links to anything that could help more

1

u/peterrattew Feb 03 '20

Looks amazing, great UI and UX. Have you ever used Fitocracy? Similar functionality.

1

u/draftax5 Feb 03 '20

Thanks! I have not heard of fitocracy but I will check it out!

1

u/[deleted] Feb 04 '20

The app design looks great, love having the option to sign in with Apple. So far the only suggestion I have is when you sign up have like a setup screen where the user is promoted to enter their name, age, weight and goals opposed to the user having to search for it and add it to blank fields.

1

u/draftax5 Feb 04 '20

Thank you for the feedback! That makes a lot of sense and I definitely want to add some sort of setup / onboarding screen!

1

u/[deleted] Feb 04 '20

Awesome! What charting library did you use?!?

1

u/draftax5 Feb 04 '20

Thank you! I forked react-native-svg-charts and customized it!

1

u/jasdeep13 Feb 04 '20

That’s a sweet and yummy app man! Kudos for putting this up live.

Whats your github if you don’t mind sharing?

1

u/draftax5 Feb 04 '20

Hey man, I will PM it to you!

1

u/versay_Y Feb 04 '20

Hey man, I will PM it to you!

Hey, can you PM me aswell with a github link? I'm curious how you organize your project and probably will learn a few things from it. Thanks!

1

u/style-112 Feb 04 '20

https://github.com/LedgerHQ/ledger-live-mobile

Hi /u/draftax5 I am doing a React Native course on Udemy and would really like to look closer into your app and learn from it. it contains anything that and app should have. Would you mind sharing it with me as well. Thx so much!

1

u/Nealoke9120 Feb 04 '20

Can I ask how you handle logging in with Facebook on your back-end? :)

2

u/draftax5 Feb 04 '20

Yeah for sure, basically I just use oAuth to get a facebook key for the user and then send that to my backend, from there I forward the key along with my apps secret key to facebook to retrieve the profile image, email, and name, create the account in my DB and then log the user in!

1

u/Nealoke9120 Feb 12 '20

Thanks! And how do you handle it for email logins? Did you create a JWT that is valid forever or such a thing? :)

1

u/draftax5 Feb 13 '20

I use JWT for everything, but they have a very short expiration, like 15 minutes. This is a best practice, the benefit of JWT's is greatly diminished if they are valid long term.

I then auto renew the JWT if it is expired. If this fails then the user will have to log back in manually.

1

u/[deleted] Feb 04 '20

Greate work body!!! Which navigation library did you use?

1

u/draftax5 Feb 04 '20

Hey thanks!! I used react-navigation and then I forked their bottom tab bar and customized it!

1

u/[deleted] Feb 10 '20

Amazing work mate. I am just getting started with React native and I am curious of some of the stuff you used. How did you make the modal at the beginning that says BARBELL CURL are there any libraries for that? Also, which library did you use for navigation?

1

u/draftax5 Feb 13 '20

Hey, thanks! That "sheet" you are refering to is custom made, but it is just an absolutely positioned View with Animated Pan Handlers attached! I used React-Navigation but a lot of the UI for it was custom built.

1

u/amir129 Apr 10 '20

How did you built the timer? is there any library

1

u/draftax5 Apr 10 '20

Its custom built

1

u/amir129 Apr 10 '20

CD an you share some hints. I have a requirement to build similar to this.

Thanks

1

u/draftax5 Apr 10 '20

What kind of suggestions?

1

u/amir129 Apr 10 '20

Like how can I implement it. How did you use slide effect. Any component similar to that?

1

u/draftax5 Apr 10 '20

No Components really that will do that off the shelf, it's all custom built using Views and the Animated API. I would start by reading the docs for the Animated API, or you could try using the Reanimated library which can be easier to do certain things.

If you have specific questions I can try answering them but I can't really explain exactly how I built the entire thing, too much goes into it

2

u/gianemi2 Feb 03 '20

Oh my god that UI! A lot better than more famous app! Great job!

2

u/darkmoody Feb 03 '20 edited Mar 30 '20

Looks like a great work out app. I’ll give it a shot

2

u/Mechseb Feb 03 '20

Looks beautiful! Congrats mate

2

u/mcarov Feb 04 '20

Woah man this is awesome!

2

u/[deleted] Feb 04 '20

Congratulation! It looks awesome!

2

u/compasscard Feb 04 '20

Did you use expo?

2

u/AnteDelorean Feb 05 '20

The application looks very nice and no doubt very functional. But as an android user cannot check it by myself, so I would be very excited to have it for android! Really good job!

1

u/darkpiv Feb 03 '20

Very nice one, mate. Just wondering how do you implement the animation on plus(button) and some top button animation :D

1

u/sebastienlorber Feb 03 '20

looks great :)

Note: there's also another Ledger app that's actually opensource RN app, related to a bitcoin wallet https://github.com/LedgerHQ/ledger-live-mobile

1

u/AroXAlpha Feb 03 '20 edited Feb 03 '20

Hey, short bug finding. I entered my height in feet and changed to metric then. First, I think the calculation does not work correctly. I entered 6ft 2inch and the App then changed it to 174cm. Google says it’s 188cm. Second bug: I can’t change the height in the edit screen. Tried a restart of the app.

It also seems to not start any workout I create. Ohoh

Account created with Apple login

1

u/eazylaykzy Feb 03 '20

This is absolutely beautiful, just want to know, did you make use of expo for your development? And is there an Android version too, as I’ve checked the iOS version out, and it really looks great.

1

u/nyeupekubeba Feb 03 '20

Great work man! I wanted to make similar app in react native for more than a year, but I didn't have free time. All other apps are unusuable, I don't know who pays for that shit, The only one I could use was Strongly, I'm gonna try Ledger definitely!

One question, how did you made weight log horizontal scroller, some open source component, or custom made, love it.

And one suggestion, profile editor can't be canceled, and I hated clicking 91 times to enter my height. Maybe to implement some auto increase when holding +- buttons.

But overall, really great work, UI, animations, everything!

1

u/darrylyoung Feb 03 '20

Did you use Expo or just with the standard React Native CLI? I’m working on an Expo app now. I tried adding Sign In with Apple but it was a real pain to test.

The app looks great, by the way. Gonna have a play with it. Congratulations on the launch. I hope to be able to launch mine in the next couple of months, too.

1

u/CuriousErnestBro Feb 03 '20

how do I sign up without facebook?

1

u/csgonutty Feb 03 '20

That's a beautiful UI. Any plans to release on android?

1

u/harish2887 Feb 03 '20

Great UI really like it... Can you suggest some course I can follow to learn react native

1

u/ziggy723 Feb 03 '20

Can you expand more details about all of your dependencies like navigation, gestures, modals ect.? Did you use redux? Hooks?

1

u/casiotron Feb 03 '20

Great idea and interface! How much of the app using local storage vs remote? How do you handle storing data while keeping a seamless UI?

1

u/theWindInYourButt Feb 03 '20

This looks great my man

1

u/[deleted] Feb 03 '20

Top ! Well done !

1

u/sleepyHead008 Feb 04 '20

awesome ui, do you have github acc ?

1

u/Nikosssgr Feb 04 '20

Very nice, and a lot of, work. You could also check `react-native-reanimated`, if you want to animate properties other than translation and opacity that run on UI thread entirely.

1

u/phytophilia Mar 03 '20

This looks great! Can you recommend any resources or guides for learning and practice!

1

u/[deleted] Nov 07 '22

Is this app still active? Getting a network error on sign up

0

u/[deleted] Feb 03 '20

[deleted]

3

u/draftax5 Feb 03 '20

u/modestmeans Thank you so much for that feedback. It really means a lot that you took the time to look around. All of your suggestions make a lot of sense and I will definitely work on them.

This is my first full app so I am sure I missed quite a bit that I will have to go back and fix!

0

u/[deleted] Feb 04 '20

[deleted]

2

u/draftax5 Feb 04 '20

Honestly the React docs are great, I am not huge into courses so I can't offer any that are worthwhile unfortunately :/

2

u/[deleted] Feb 04 '20

[removed] — view removed comment

2

u/draftax5 Feb 04 '20

Hey, thanks!

It is a custom component that I built, I hook it into redux and redux-saga which is what triggers them.

They are called snackbars, at least that is what googles material design calls them :)