DEV Community

Allen Shin
Allen Shin

Posted on

Project organization

I've been working on a grocery delivery application, and I'm proud to say I reached my goal of finishing it this week. I just wanted to spend some time reflecting on what were some things that I thought went well in terms of the overall organization of the project.

As an overview I want to share one of the more helpful tools that I've received when it comes to organizing a project, and that's an overview that holds 3 lesser fields of organization which my lead instructor from FlatIron showed me.

Models

First is your models, or the class structure for your data model. This part involves 3 main concerns that pertain to your data. First you have the data model names and the attributes themselves. Second, you need the associations for your data (how your data is interconnected). Third, you need to spell out your CRUD actions out in plain English. This portion is especially important, because the data is the backbone for your project.

Routes

Next, you have your routes, which also has 3 subsections. First is the fetch requests, which represent routes that you'll need to get data from external sources such as API's. Next, you have your HTTP requests, which is putting your CRUD actions into actual HTTP route methods. Lastly, you'll need to spell out your controller methods. The last two might sound a little repitive, but they are both iterations of your basic CRUD methods but representing your frontend and backend methods, respectively, necessary to implement them.

Frontend

Last, you have your component, props, and state hierarchy, which is specific to React applications, but can probably be applied to other frontend frameworks like Angular. I ended up using Redux in my application so the state management portion made things much simpler, and I didn't need to deal with the whole handing down props and knowing which component would need to hold the state. The components were for the most part straightforward, but one thing to be conscious of is learning to reuse components wherever possible.

Overall, getting this section right the first time and ironing everything out before hand is going to save you a lot of time in the long run. Having the chance to take a look at how everything connects, will be essential in the implementation of the smaller parts of your project. This was a primary theme for me. Whenever I was writing a function, a lot of time could have been saved if I was cognizant of what output I needed, given the where I was sending the information in the application. Having a solid overview, and continuing to refer back to it will be helpful.

There are definitely things you might not be sure about and might have to revise as you go along. For example, one of the biggest time sucks was trying to get the data for my grocery store items. I initially planned on using an API to grab the information, but found out that a lot of grocery store API's require payment. I ended up spending a ton of hours doing research on if there were any free options and even potentially using web scraping as a possibility. After a week of realizing I was getting nowhere, I ended up seeding my own data.

I'm still trying to parse out what I could have done better, because I really wished I could have used some kind of an API service and wish to include an live source of data in the future. Given the circumstances, I think what I learned from this part was that I learn to stay away from rabbit holes as much as possible, by sticking to an MVP (Minimum Viable Product). I still have a lot to work for the project to get to where I want it to be, but focusing on the minimum requirements helped me to make consistent progress.

One other tidbit, which I mentioned before with the components, was to think about how you can reuse components and functions. Having a separate function everytime you do something can lead to a lot of clutter and unnecessary code which is not fun to read or debug. In the future I'm thinking about how I can refactor existing data so that I can try to condense the amount of code I have to write.

Overall I'm very happy with how my project looks, even though I definitely want to work on some of the more fine details. As far as when it came to kickstarting the project, having the overview in mind, and working simply and effectively to implement the backbone helps make solid foundation, which is easy to add to later on.

Top comments (0)