GithubHelp home page GithubHelp logo

luna825 / blogrework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dtysky/blogrework

0.0 1.0 0.0 5.85 MB

Rework my blog with flask, mongodb, react...

Home Page: http://dtysky.moe

Python 21.78% JavaScript 58.25% CSS 15.64% HTML 4.07% Shell 0.25%

blogrework's Introduction

BlogRework

dtysky|一个行者的轨迹

Progress

Back -------- done.

Front -------- done.

Others ------ done.

Description

Reworke my blog with react, flask, mongodb...here are what I did for my blog:

2014.05

Create my blog with pelican with a default theme.
It was deployed on github:
**https://dtysky.github.io**(It dosn't work now.)

2014.06

Change the theme... emm, my aesthetics at that time, so...

2015.02

With the improved level of aesthetic quality, I changed the theme again with javascript and css animation, that theme is very close to it now.
At the same time, I registered domains dtysky.moe and move the site to a VPS on DigitalOcean.
This version is here now:
old.dtysky.moe

2016.02

I changed my career from FPGA enginner to software enginner(web).
Emm...one day, I felt a music player is necessary so that I need change my blog from static to dynamic.
That's the reason why I do these.

To(Never www)Do list

Adding cache on server

One record will be added to cache while the server recives a request first time.
All records in cache will be cleared when database is updated.

Using redux and ES7 to rework "Front" again

Well, this blog is not friendly with search enginner now(although I used react-router server side rendering and fragment meta tag now), for resolving this problem, I must use another framework to make the data sync between the server and client.
Why using ES7?
ES5... I can't writing clean code with it...

Front

Platform

Node.js 0.10.37
NPM 1.4.28

Dependencies

React
React-router
Veloctiy-react
React-modal
Rrcode.react
React-helmet
React-ga
Jquery

Dependencies-server

Express.js
Tracer
Request
Jade(One method for SEO, but it seems... does not work well)
React and react-router(For server side rendering)

Dependencies-dev

Grunt and plugins:
clean, copy, compress, rename, uglify, file-creator

Webpack and plugins:
extract-text-webpack-plugin, babel, css-loader, file-loader, json-loader, react-hot-loader, url-loader, style-loader, jsxhint-loader

Adaptation

APlayer:
A beautiful music player, the one in blog is based on it with some changes.

Finish

View:
All pages.

Cache:
A cache for storing data, it's useful for reduce the number of requests.

Router:
In stie router with react-router.

Social-share:
Sharing articles to socal Apps.

Animations with js and css3:
Most of animations are based on css3, a little(title-bar and left-image) are based on velocity.

Music player:
The music list can be defined in markdown, if not, a default music list will be used.

First page rendering on server for SEO:
React router server side rendering and full page rendering with jade.

One key build

Back

Platform

Python 2.7.11

Dependencies

MongoDB
Markdown
Pygments
Watch dog
Flask
Flask-compress

Finish

Most of these use inheritance and reflection so that I can add any new function easily.

Server:
Web server for providing articles as json compressed with gzip.

Parser:
File parsers and slug(URL) warppers.

Feeds and sitemap generator:
Generating the feeds and sitemap.

Database manager:
Write articles to database with "Incremental build", the desgin of it is here:
Database desigin

File state monitor:
Monitoring state of pages , if there are files changed, it will check database and call parsers, warppers and database writers to update database.

Logger:
A logger for recording infomations, errors and warnings.

Others

Forever.js is used for starting all servers as daemons.

How to use?

Back:
Edit the "config.py" then run the "main.py".

Front:
Edit the "config.json" then:

  1. "grunt client-build" will build the client code
  2. "grunt server-build" will build the server code
  3. "grunt build" will build client and server all
  4. "grunt debug" will open the port 8000 for development

blogrework's People

Contributors

dtysky avatar

Watchers

August avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.