As we have been doing memed
Songwrite!
In this post I want to share the experience of the organization of the project in terms of grade 11. I think this post may be useful to students. If You are over 18 years — is likely to post a large semantic load will not bear.
a Little about memed
Here 2 months, how is the development of a social network memed. I will be brief, to again add the tag "I'm a PR". Social network where everything turns on the meme. They can comment, they can be stored in the collection... you get the Idea.
Start
the Idea for a similar project I have spun almost the whole 10th grade, but I didn't finish any of them. Everything depends on the fact that the project grew, and the one I saw and design and code and all that want to could not. Well just tired, out of motivation and I threw. But pretty much perfected in web development for the first half of 2017, I realized that the time has come. The time to complete.
I started to write. August 8 I created a project. I must say that I was funny — I went to bed in the morning, ~6-10 a.m. and got up about 5 o'clock. Nobody liked, but at night I was comfortable to work.
the Stack has been Django on the server, for data exchange, I decided to use JSON API specification, and for the frontend I decided to use VueJS. I at that time knew him superficially, but it only spurred interest. A week later I realized that I had fallen in love with Vue.
the Database is PostgreSQL. Server website diploidy Heroku. Is enough — when not in use, it sleeps when you sleep — he's sleeping, too, when I work — he works too. But the main thing — free))
By August 12, I sketched the framework of site — basic functions, Ala authorization, posting, rating. Way authorization I tried using VK Open API. I really don't like to store passwords and neither should you.
So, I washed down the steep library size of 350 lines, which would allow me to conveniently, exposit the required fields, and choose and all that.
the
class MessageSerializer(Serializer):
model = Message
name = Message.type()
def item_attributes(self, item):
requester = resolve_user(self.request)
if the 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 sell 2-class — Serializer and ModelRoute.
In the first we describe which fields and when we can squeeze in response, and the second — add your own endpoint's. Life becomes light, and joy fills the mind of the developer.
someday I will throw it in opensource, but yet I am lazy. In any case, when let down, will update the post. I'm not hiding it, in any case, but somehow laziness))
referring friends
Since I'm still in school and quite friendly, I have many good friends and comrades who can respond to my queries.
In General, writing in the conversation class, excellent Arina harnessed to the project and for the interest began to discuss with me the design to do mockups in photoshop. It was very cool, at some point, I did not even have time for her edits.
In the process of design took place: Arina makes layouts, throws me, I say these are bad and why(for example, in the mobile version of something will not fit), or the colors too bright or something, and put the final version on the website.
Then I realized that I can use the power of friends in order to gain the audience of alpha testers.
Active development
Then in the period from mid-August until the end of September was in active development. The number of lines of code front-end has increased to 16 thousand, and the backend to 5.
it is important to say about dad. He was extremely unhappy that I come from school about 5 o'clock and up to 12 hours engaged in the project, talked of him only. Then we seriously talked to, and I said I need the first 2 months — September and October, after which I will stop spending on a project so much time and will begin to prepare. A little pokraev, he agreed. <3
I don't know what else to write about active development; perhaps I made a mistake that almost slaughtered at school in this period of time. Cost to pay more attention to mathematics.
for example, How did Arina — and we have much less time to discuss the design, but it's not so bad: I have caught the wave and was able to do the new components in the style of the old.
But there Ilya which made us a logo. I'm sorry, Ilya, that for so long I ruined you with it!
Refactoring
Almost all of October I have been doing code refactoring. With 16K rows, front-end reduced to 13, the backend is almost not diminished and manuscript library worked well.
some examples of refactoring:
1) it Turns out that to make the blocks — the components Vue easier than doing blocks — html + css common properties. That is, instead of
the
<div class="block-container" >
...content...
</div>
Turns out
the
<BlockContainer>
....content....
</BlockContainer>
It is easier for several reasons, for example, looks better in the Vue dev tools the feature tree. Another is to edit a specific block, where there is a html, scss, js is easier than looking in the _block-container.scss
and there is something to them. When everything is on one screen, context is lost, and with it the time.
2) Vuex. I did not want to add it because I did not want to redo from the local states on the global, but I immediately realized that it's cool. Caching — force. For example, I don't need to request from the server /user/me
whenever you need to check I have the right to change the community, your profile or something. Or do I not need to update every time my "community", if I already have uploaded. In General, Vuex class.
End development
I plan to finish the active development and refactoring to October 20. The last 10 days will be devoted to advertising and working with metrics.
Conclusion
I don't know why I wrote this post. Maybe I just have no one to discuss the project and to tell everything from the beginning. However, here is a list of my tips for those who doing projects as a student:
-
the
- be Reasonable in setting the time. It is not necessary to go to extremes and skip school to have more time to spend on the project. You have a lot of time, especially if You're not in the 11th grade. the
- Use the human resources that are near You. Do not expect that the person You ask for help, agree to spend as much time as You. Try to talk at once, how much time are you willing to spend on the project so there are no surprises. When communicating with fellow employees try to cut jokes, trashtalk and not be distracted. If you wanted to do a project they are doing. the
- Set realistic deadlines. Initially I thought that by September 1 will be ready almost the entire project, but as it turned out, September 1 I added 30% of the functionality. When the term is indicated, it is not necessary to start 1234132432 hours a day. If You regularly give to the project a few hours, it is more productive. the
- Sleep normal. I have a small shift — if meanwhile, I finished work and bedtime is less than an hour, I can't sleep in any. In mind a lot of thoughts, ideas and possible implementations. Has counting sheep (not kidding), until you calm down. And yet — do not take the phone in hand when going to sleep. Guaranteed lost hours of sleep))
Ciao!
Комментарии
Отправить комментарий