GithubHelp home page GithubHelp logo

zhangaz1 / blog-react Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fxy5869571/blog-react

0.0 0.0 0.0 432 KB

基于typescript koa2 react的个人博客

Home Page: https://fxy5869571.github.io

HTML 1.87% CSS 34.90% TypeScript 62.29% JavaScript 0.93%

blog-react's Introduction

Apple的个人博客

动机

一直想学习下typescript的,趁着业余时间,于是就写了这个博客0.0

技术栈

前后端都基于typescript3.0,使用tslint规范代码

后端使用 koa2 提供一个简易的 http 服务器, 并将所有路由定位到入口 router/index.ts 处理. 使用 react-router分发接口, 后端 API 采用类似 Restful 风格的接口, 数据库是 MongoDB, , 权限控制采用 jwt token 的方式.目前只有两种权限,游客只有浏览的权限,管理员可以增删改查文章

博客和管理端基于 react 框架, 使用 redux 和 redux-saga 统一处理数据, react-router 提供路由, ui 使用antd, 使用fetch请求后端数据. 深圳求个react坑

演示地址

Apple的个人博客

Apple的个人博客管理端

更新

1.更新typescript 到3.0。

2.解决服务器接口本地跨域的问题。 3.修改了文章只有第一段代码高亮的bug

Usage

安装

git clone https://github.com/fxy5869571/blog-react.git

cd blog-react

yarn install

yarn start

入口

import { LocaleProvider } from 'antd'
import zhCN from 'antd/lib/locale-provider/zh_CN'
import * as React from 'react'
import * as ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
import { applyMiddleware, createStore } from 'redux'
import createSagaMiddleware from 'redux-saga'
import './index.less'
import reducer from './reducers'
import RouterMap from './router/RouterMap'
import rootSaga from './saga'

const sagaMiddleware = createSagaMiddleware()
const store = createStore(reducer, applyMiddleware(sagaMiddleware))
sagaMiddleware.run(rootSaga)
ReactDOM.render(
  <LocaleProvider locale={zhCN}>
    <Provider store={store}>
      <RouterMap />
    </Provider>
  </LocaleProvider>,
  document.getElementById('root') as HTMLElement
)

目录结构

管理端截图

博客截图

请我喝杯咖啡

图片名称

图片名称

blog-react's People

Contributors

fxy5869571 avatar yubulen 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.