📜 ⬆️ ⬇️

How we did and do memed

Bonjouric!


In this post I want to share the experience of organizing the project in the conditions of grade 11. I think this post may be useful for schoolchildren. If you are over 18 years old - most likely, the post will not carry a large semantic load.


Little about memed


For the past 2 months, how is the development of the social network memed . I will be brief, so that again they do not throw the tag "I am promoting". Social network, where everything that you can, turns on memes. They can comment, they can be saved in the collection ... The idea is clear.


Start


The idea to write a similar project almost all of the 10th grade was spinning around me, but I didn’t finish it. It all came down to the fact that the project was growing, and I alone saw both the design, and the code, and all that I could not have thought of. Well, just annoying, the end of motivation and I threw. But having become quite podnatorev in web development for the first half of 2017, I realized that the time had come. Time to finish.


And I started writing. August 8, I created a project. I must say that in the summer I had an amusing regimen - I went to bed in the morning, ~ 6-10 am, and got up at 5 o'clock. No one liked it, but at night I was comfortable working.


The stack became Django on the server, I decided to use the JSON API specification for data exchange, and for the frontend I decided to use VueJS. At that time I was familiar with him superficially, but this only stimulated interest. A week later, I realized that I fell in love with Vue.


Database - PostgreSQL. The server with the site is deployed on Heroku . It is enough - when you do not use, he sleeps, when you sleep - he also sleeps, when you work - he also works. But the main thing is free))


By August 12, I sketched the framework of the site - the basic functionality, ala authorization, posting, rating. By the way, I began to use authorization through VK Open API. I really do not like to store passwords and do not advise you.


So, I wrote down a cool library with a size of 350 lines, which would allow me to conveniently use the required fields, configure accesses and all that.


class MessageSerializer(Serializer): model = Message name = Message.type() def item_attributes(self, item): requester = resolve_user(self.request) if requester is None or item.dialog.participants.filter(id=requester.id).first() is None: raise PermissionDenied default_attributes = self.resolve_keys(item, ['text']) default_attributes["timestamp"] = item.timestamp.timestamp() return default_attributes @staticmethod def relationships_provider(): return { 'dialog': lambda item: item.dialog, 'author': lambda item: item.author, 'post_attachments': lambda item: item.post_attachments.all(), } class MessageRoute(ModelRoute): model = Message name = Message.type() items_per_page = 50 serializer_class = MessageSerializer def custom_endpoints(self): return [ Endpoint("^$", "GET", lambda request: HttpResponseForbidden()) ] 

Here is an example of its use. We implement 2 classes - Serializer and ModelRoute.
In the first we describe which fields and when we can stick in the answer, and in the second we add our own endpoints. Life becomes easy, and joy fills the mind of the developer.


Someday I will throw her into an open source, but for now I'm lazy. In any case, when I throw, I will update the post. I do not hide it, in any case, but somehow laziness))


Attracting friends


Since I am still in school and quite friendly, I have many good friends and comrades who can respond to my requests.


In general, having written to the class conversation, the beautiful Arina harnessed herself to the project and started discussing the design with me for interest, making layouts in Photoshop. It was very cool, at some point I did not even have time for her edits.


In general, the design process went like this: Arina makes mockups, throws me, I say that they are bad and why (for example, in the mobile version, something does not fit), or that the colors are too bright, or something else, and I burn down the final version of the site.


Then I realized that I can use the power of friends in order to gain an audience of alpha testers.


I posted a small post on my page with a link to the site and the group, kicked my friends in HP, so that they would fix it and voila - I have ~ 40 kids who periodically go to the site, and then hammer me into HP, that somewhere a joint . With their help more than 210 bugs were neutralized .


Active development


Further in the period from mid-August to the end of September, active development was carried out. The number of lines of the frontend code has increased to 16 thousand, and the backend to 5.


It is important to say about dad. He was extremely dissatisfied that I come home from school at 5 o'clock and until 12 o'clock I am engaged in a project, I spoke only about him. Then we had a serious talk with him, and I said that I needed the first 2 months - September and October, after which I would stop spending so much time on the project and begin to prepare. A little groaning, he agreed. <3


I do not know that you can still write about active development; I guess I make a mistake that I practically scored on the school during this time period. It was worth paying more attention to mathematics.


As, for example, Arina did - and we had significantly less time to discuss the design, but this is not so scary: I already caught a wave and could make new components in the style of old ones.


But Ilya , who made us a logo, appeared. Sorry, Ilya, for so long have you been steaming with him!


Refactoring


Practically the whole of October, I am refactoring the code. From 16k lines, the frontend lowered to 13, the backend almost did not decrease - the manuscript library worked for glory.


Some examples of refactoring include:


1) It turns out that making blocks — components of Vue is more convenient than making blocks — html + common css properties. That is, instead of


 <div class="block-container" > ...content... </div> 

Turns out


 <BlockContainer> ....content.... </BlockContainer> 

This is more convenient for several reasons, for example, it looks better in the Vue dev tools tree of components. Another thing is to edit a specific block where html, scss, js is more convenient than to search for the required _block-container.scss and edit something there. When everything is on the same screen, the context is not lost, and with it time.


2) Vuex. I didn’t want to add it for a long time, because I really didn’t want to redo it from local states to global states, but after trying it, I immediately realized that it was cool. Caching is power. For example, I do not need to request from the server /user/me every time I need to check, I have the right to change the community, my profile or something. Or I do not need to update every time my "community", if I already downloaded from. In general, Vuex is a class.


End of development


I plan to finish active development and refactoring by October 20th. The last 10 days will be devoted to advertising and working with metrics.


Conclusion


I do not know why I wrote this post. Maybe I just have no one to discuss the project with and tell everything from the very beginning. Nevertheless, here is a list of my advice to those who make projects as a schoolboy:


  1. Reasonably allocate your time. You should not go to extremes and skip school to spend more time on the project. You now have a lot of time, especially if you are not in grade 11 yet.
  2. Use the human resources that are near you. You should not expect that the person you are asking for help will agree and will spend as much time as you do. Try to discuss immediately how much time you are willing to spend on the project, so that there will be no surprises. When communicating with friends - employees try to throw away jokes, trashtalk and not be distracted. If you wanted at this time to engage in the project, they are engaged.
  3. Set real deadlines. Initially, I thought that by September 1, almost the entire project would be ready, but as it turned out, from September 1, I added 30% of the functionality. When the term is indicated, you should not start practicing 1234132432 hours a day. If you regularly spend several hours on a project, it’s already more productive.
  4. Sleep well. I have a small shift - if between how I finished work and less than an hour sleep, then I can not fall asleep in any way. There are a lot of thoughts, ideas, possible realizations in my head. I have to count sheep (not kidding) until I calm down. And yet - it is not necessary to take the phone in hand when you go to bed. Guaranteed lost hours of sleep))

Chao!


')

Source: https://habr.com/ru/post/339974/


All Articles