DEV Community

Cover image for How I built a real world project for the first time 🌈
Killian Frappart
Killian Frappart

Posted on • Edited on

How I built a real world project for the first time 🌈

I have been learning web development for a year and I have just delivered my very first MVP for a client, this is a huge step forward in my journey to become a real world developer.

In this article, I will write about the building process and design thinking in general. This is not a tutorial by any means, I will simply share my experience with anyone interested.

Table of contents

  1. Project Introduction
  2. Tech Stack
  3. Wireframe & Design
  4. Data modeling
  5. Project Organization
  6. Sprint 01: Frontend
  7. Sprint 02: Backend
  8. Sprint 03: Implementing features
  9. Sprint 04: Fix & Deploy
  10. Conclusion

Project Introduction πŸ‘‹

Let me introduce the project first. We have to build an MVP for a mobile app that works on both Android and IOS. This app's name is Allergio and aims to make people with food allergies' life easier.

Thanks to Allergio, you can create a profile for your relatives, register their allergies and share their profiles with your contacts.

The core feature is the scanner. Open up your phone's front camera, point it towards any food product and a list of the potential allergens will be displayed.

In order to complete this mission, I teamed up with my friend Walid. He is a talented growing JavaScript developer, and it is a pleasure to share this experience with him.

Tech Stack βš›οΈ

To build this app, we decided to rely on the very popular MERN stack which includes:
➑️ MongoDB
➑️ Express
➑️ React Native
➑️ Node

Although these are technologies I am familiar with, I never worked with React Native and I don't know much about Mobile development concepts.

We are considering AWS and Heroku to host the Backend part and for file management but I will provide more details in the Fix & Deploy section.

It already sounds like a great and exciting challenge 🀩

Here is a list of tools I usually work with to enhance my programming experience:
➑️ OS: MacOS
➑️ Terminal: iterm2
➑️ IDE:VSCode
➑️ Versioning: Git
➑️ Package Manager: NPM
➑️ iOS Emulator: Xcode
➑️ Andorid Emulator: Android studio
➑️ Communication: Slack
➑️ Project Organization: Trello

Wireframe & Design 🎨

Our client Xavier provided simple wireframes and we reworked them a little to make it look "modern" and improve UI/UX.

We mainly worked with Figma which is a great tool that I 100% recommend. Let me show you a few examples.

Splash Screen:
Alt Text

Login Screen:
Alt Text

Of course, we redesigned the app following 2020's mobile development conventions, and we took inspiration from famous applications such as Yuka, Shazam, Spotify, ...

Data modeling πŸ’Ύ

Since we are building a Full-Stack application, we must store and manage data. It would be crazy to jump into the coding process without a clear and well-designed action plan.

What kind of data are we playing with:

Users πŸ‘€

{
  email: { type: String, required: true, unique: true },
  password: { type: String, required: true },
  name: { type: String, required: true },
  lastName: { type: String, required: true },
  image: { type: String },
  profiles: [{ type: mongoose.Types.ObjectId, ref: 'Profile' }],
  allergens: [{ type: mongoose.Types.ObjectId, ref: 'Allergen' }],
  contacts: [{ type: mongoose.Types.ObjectId, ref: 'User' }],
}
Enter fullscreen mode Exit fullscreen mode

Profiles πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ (Created by the user for his relatives)

{
  name: { type: String, required: true },
  image: { type: String, required: true },
  allergens: [{ type: mongoose.Types.ObjectId, ref: 'Allergen' }],
  readers: [{ type: mongoose.Types.ObjectId, ref: 'User' }],
  owner: { type: mongoose.Types.ObjectId, ref: 'User', required: true }
}
Enter fullscreen mode Exit fullscreen mode

➑️ Allergens πŸ₯œ

{
  name: { type: String, required: true },
  image: { type: String, required: true },
  description: { type: String, required: true },
  reaction: { type: String, required: true }
}
Enter fullscreen mode Exit fullscreen mode

PS: Unique IDs are provided by MongoDB by default.

Awesome, we now know what our data looks like but this is not enough. To make our app able to create, read, delete and update data, we must give it the chance to communicate with our server.

You might already know it, Express makes it really easy to build Rest API and that is exactly what we are about to do!

If you are not familiar with API architecture, I recommend you skip this section.

API routes:

Users πŸ‘€ ⏩ /api/users/
➑️ (GET /:uid ) Get user by ID.
➑️ (POST /signup ) Create user account.
➑️ (POST /login ) Log user in.
➑️ (PUT / ) Edit user information.

Profiles πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ ⏩ /api/profiles/
➑️ (GET /:uid/all ) Get all profiles of user.
➑️ (GET /:pid ) Get profile by ID.
➑️ (POST / ) Create a new profile.
➑️ (PUT /:pid ) Edit profile information.

Contacts πŸ‘₯ ⏩ /api/contacts/
➑️ (GET /:uid ) Get user's contacts.
➑️ (POST /search ) Search new contacts.
➑️ (POST /share ) Share profiles with contact.
➑️ (POST / ) Add a contact.
➑️ (DELETE / ) Delete a contact.
➑️ (POST /unshare ) Unshare profiles with contact.

Allergens πŸ₯œ ⏩ /api/allergens/
➑️ (GET /:aid ) Get allergen by ID.
➑️ (GET / ) Get all allergens.
➑️ (GET /name/:name ) Get allergen by name.

We are almost good to go, before you head to the next section, I want to have a quick word about file management.

This is one of the trickiest topic we came across when building Allergio and I thought it would be interesting to share the solution we came up with.

Here is the problem: how to store images ?

Uploading images directly to the database would slow it down and most image hosting services require you to pay monthly fees.

We decided to build a very simple custom image uploader service that stores images on the server itself and provides a URL to fetch them. This simple server is hosted on an Ubuntu instance running in the cloud.

This is definitely not the best solution but considering the huge amount of work we have to achieve in a relatively short period of time, it does the job.

Project Organization πŸ—‚οΈ

I will never tell this enough: Organization is the key! πŸ”‘

The organization relies mostly on the Agile Methodology because we were introduced to it during our coding bootcamp.

The building process is split in 4 sprints of 5 days (each sprint has its own section) and every one of them must have clearly defined tasks.

On Monday morning, we used to group up to establish an exhaustive list of tasks for the whole week. We used Trello to create little cards for every task.

Alt Text

Every Friday, there was a meeting with our client. He was always happy to have a little demo and thanks to his weekly feedback we could finally deliver a product close to his initial expectations.

Moreover, we tried to stick to daily stand-up in the morning and day retrospective around 5.30 pm.

There is another organization key point whenever you start a brand-new project and it is workflow setup.

We are working with GitHub following Git flow's recommendations as much as possible.

➑️ Not familiar with Git flow ? No worries, have a look to my article! 🧐

Finally, let me show you the folder structure we worked with:

Allergio πŸ“‚

  • Backend/
    --- controllers/
    --- models/
    --- routes/
    --- utils/
    --- middlewares/

  • Frontend/
    --- app/
    ------ assets/
    ------ components/
    ------ screens/
    ------ context/
    ------ utils/
    ------ navigation/

Sprint 01: Frontend πŸ“²

Time has finally come to start coding! πŸ”₯

Alt Text

Shout out to Expo that litteraly made this project possible. Expo is a framework for React applications, it provides a set of tools to start building your application in a matter of minutes and hides most of the complexity when setting up a new project.

It was very scary at first to work with React Native because we never used it before but Expo's documentation is well-written and I felt like doing mobile development forever in a couple days only.

After we initialized the project, setting up in-app navigation is a great starting point. Very similar to React Router for Web, React Navigation is a great library that is easy to get started with and provides a good solution for every use cases.

We decided to implement a bottom tab navigation for optimal user experience:

Alt Text

Another important step is to setup a global context. Every React developer knows how tidious it might be to lift state up through props when you project is growing bigger.

To answer that need of a global state, we went for React Context mainly to store user information such as name, last name, image and wether he is logged or not.

Everything seems to work fine so far, let's build our screens and components. We have about 10 screens to build (There is inner navigation for each tab) and around twice as much components like buttons, cards, inputs, bottom sheets and much more.

At this point, we are working with dummy hard coded data. Our components are mostly function components and their state is managed with React Hooks.

Hopefully, we have enough time to implement camera features and request to an external API to gather information about food products before the end of the first sprint.

Sprint 02: Backend πŸ“Š

As I mentionned before, this project's backend is a Node/Express Rest API linked to a cloud MongoDB database.

In order to make it work, we start by installing dependencies such as cors, body-parser, mongoose, nodemon, ...

When working with MongoDB, I highly recommend you work with mongoose as well. It makes your life so much easier. Define mongoose models for your data, connect to the database and you are good to go βœ…

Alt Text

Then, we register routes just like I already explained here and connect each route to a dedicated controller.

Every controller's behavior must be tested and for that you can give Postman a try.

Alt Text

Finally, we improve our server's robustness with proper error handling middleware and enhance development experience with nodemon and environement variables.

Sprint 03: Implementing features ⭐

This is by far the most exciting week, when we finally see the result of everything we did before.

We spend this entire week connecting Frontend user interface to Backend controllers via HTTP requests and update the database in real time.

HTTP request are done using Axios which is a personnal preference.

There are many features to implement this week:
➑️ Login/Signup with Email and password.
➑️ Create and update profiles.
➑️ Edit user information.
➑️ Add/remove contacts.
➑️ Share profiles with contacts.
➑️ Upload images from phone's gallery.
➑️ Send SMS to invite friends.
➑️ ...

Native functionnalities such as SMS, camera and photo gallery could be implemented thanks to Expo's incredible doc 🌟

Alt Text

Sprint 04: Fix & Deploy ☁️

Last week of this incredibly enriching adventure. I already learned a lot and spent so much time and energy. We are getting tired but there is still work to do before we send our project to the client.

Thousands of lines are waiting to be refactored and plenty of little bugs still remain. Let's start by cleaning this up and fixing as many style issues as possible.

AWS has a cloud service called EC2. We create an Ubuntu instance and connect via SSH. After a bit of setting things up, our server and image manager are running in the cloud.

Right now, the app is only available through Expo's hosting but we are looking to deploy it on App store and play store soon.

Conclusion βœ…

Four intensive weeks have passed, we are tired, the project is still a little buggy but the client is happy and that is what matters the most.

In my opinion, my friend Walid and I did a great job here, working on a real project for the first time and facing obstacles made us better developers.

I wanted to provide a link to the app's demo or source code with this article but since this project is in the alpha phase, the client would like to keep some information confidential.

Thank you very much for reading!

I would love to have a feedback from you, any tips to improve as a developer or as a blogger is very appreciated πŸ˜‡

Top comments (48)

Collapse
 
cyantarek profile image
Cyan Tarek

Wonderful article.

But I am missing something.

You didn't tell us how did you go for the actual requirements process?

  1. How did you understand what to build from client?
  2. How did you prepare requirements?
  3. How did you prioritize them?

And last but not least, at which point did you gather the requirements? Before UI/UX Design and Data Modeling?

How did you model the data and design the UI? Based on features?

Please share, or write a new article about this since this is the first step where new comers stumble upon.

Thanks

Collapse
 
killianfrappartdev profile image
Killian Frappart

Hello Cyan,
It is a very interesting point you raises here! I should have explained in the introduction, we had a long meeting with the client before we officialy start the project where we discussed together what features to build and how the app should look in the end.
Moreover, we had a weekly meeting to check that the project is going in the right direction.
Lastly, we organized our work and filter requirements according to what we are able to do as junior developers.
Thank you for reading, I hope this answered your question! πŸ˜‡

Collapse
 
eric profile image
freePean

This articler worked one year.

Collapse
 
alejogb1 profile image
Alejo Garcia

Can I collaborate doing the landing page? I really think I can give you some help on the landing page, adding illustrations and some good design. This is great, I like to see when projects turn out to be practical examples. This is my github: github.com/Alejogb1 and one of the websites I currently run: iosaprovall.com/

Collapse
 
killianfrappartdev profile image
Killian Frappart

Hello Alejo,
Thanks a lot for your enthusiasm!
I am not responsible of the landing page at all, it has been made by my client before I took part in the project.
I can let him know about your offer if you want.
Have a great day!

Collapse
 
codewithgauri profile image
gaurav pandey

Great information loved your content, I have also started writing post about Opensource, Github, Android dev, Webdev, IoT, Cloud etc.
you can check it out here
Codewithgauri

Thanks :)

Collapse
 
killianfrappartdev profile image
Killian Frappart

Thank you!
Your blog looks great, keep up the good work πŸ”₯

Collapse
 
codewithgauri profile image
gaurav pandey

thank you :)

Collapse
 
meganpaffrath profile image
Megan Paffrath

I really enjoyed this read! I am working to become a full stack developer and I really like the organization of this project. I think it is important to get most of the planning and design done before making a project, great work! I look forward to seeing what else you do!

Collapse
 
killianfrappartdev profile image
Killian Frappart

I really appreciate your comment Megan! In my opinion organization is more important than the code itself. Thank you for reading and I wish you best of luck.

Collapse
 
krgrs profile image
kenny

This is an awesome write-up, and kudos to you for building a real-world project as an aspiring dev. That's huge! Most people stick with building little toy apps or apps built following courses or tutorials, building something on your own that solves a real problem is a huge step, congrats!

Collapse
 
killianfrappartdev profile image
Killian Frappart

I know what you are speaking about! There are dozens of dummy app on my GitHub πŸ˜‚ You can imagine how satisfying it is to finally build something worthwile!

Collapse
 
devdufutur profile image
Rudy NappΓ©e • Edited

Another important step is to setup a global context. Every React developer knows how tidious it might be to lift state up through props when you project is growing bigger.

Do you know constate ? It's a great library to lift state up easily at any time.

github.com/diegohaz/constate

Collapse
 
killianfrappartdev profile image
Killian Frappart

I have never heard of this package before, thank you for sharing I will have a look βœ…

Collapse
 
billraymond profile image
Bill Raymond

I’m thinking about developing an app that just came to mind recently and your article is amazing! Thank you for taking so much time to walk through the logistics of working on such a project! So many people glaze over what technologies are used or how thework gets managed. Great job!

Collapse
 
killianfrappartdev profile image
Killian Frappart

I could not be happier if my article somehow helped you get started with your app! Thank you for your feedback BillπŸ˜‡

Collapse
 
juandave25 profile image
juandave25

I really enjoyed read this article , you learned a lot with this project in every aspect since planning , development and implementation, big congratulations for you.
If you need help with future projects,I would like to have the chance of working with you.
Best regards

Collapse
 
ridhikgovind profile image
Ridhik Govind

This post have given me an overview about how things work in real life. Thanks !

Collapse
 
killianfrappartdev profile image
Killian Frappart

I am glad that my article helped you anyhow 😁

Collapse
 
vpxavier profile image
vpxavier • Edited

Hello Killian,
What an amazing journey. I want to thank you and Walid for reaching the objectives in only a few weeks: validating the MVP and changing it to a working prototype. There is still a lot of work to do to turn in into an app in production but I am now sure that Allergio (allergio.net) will help a lot of families when its final version will be released. Thanks a lot for your work!

Collapse
 
killianfrappartdev profile image
Killian Frappart

Hello Xavier,
Thank you for trusting us, it was a great challenge, we learned a lot and we could not dream of a better project to work on.
As you said, there is still a lot of work to do before production and I wish you the best.