Skip to content

How to develop leanote 如何开发leanote

life edited this page Mar 13, 2017 · 26 revisions

Technologies and Architecture Overview

The main Leanote projects are:

  • Leanote Server (https://github.com/leanote/leanote). It’s the Leanote server and web client. Which is written in Google's Go language using the revel framework. The data is stored in a MongoDB database. You can run Mongo in the cloud (recommended) or on your own computer (for development purposes). The server must be running all the time to allow clients (Desktop, iOS, Android) to connect and sync data to it. These apps communicate with the Leanote server via REST requests in JSON format via an API. The technologies which the Leanote Server use are:

    • Golang
    • Mongodb
    • jQuery (Just jQuery, no other frameworks like Angularjs or React)
    • Bootstrap
    • Less
  • Leanote Desktop App (https://github.com/leanote/desktop-app) which is the Leanote Desktop App. The data is synced from Leanote Server. The desktop apps allow offline note editing and sync seamlessly with the server once an internet connection is reestablished. Uses Leanote Server API. The technologies which the Leanote Server use are:

    • Electron (github.com/electron/electron)
    • jQuery (Just jQuery, no other frameworks like Angularjs or React)
    • Bootstrap
    • Less
  • Leanote iOS (https://github.com/leanote/leanote-ios). Uses Leanote Server API. The technologies which the Leanote Server use are:

    • Objective-c
    • Core Data
  • Leanote Android (https://github.com/leanote/leanote-android). Uses Leanote Server API. The technologies which the Leanote Server use are:

    • Java

Install Leanote Server & Web

If you want to develop Leanote, you must install the Leanote server (https://github.com/leanote/leanote) first! Please see Install Leanote

Run Leanote Server & Web app

In order to get Leanote ready for development, follow this guide to help you set up the server/web app. Go to the applications /app folder and run go get to install dependencies. Then you should be able to run Leanote with dev mode or production mode.

Dev mode:

$> revel run github.com/leanote/leanote dev [port]
eg:
$> revel run github.com/leanote/leanote dev 9000

Production mode:

$> revel run github.com/leanote/leanote prod [port]
eg:
$> revel run github.com/leanote/leanote prod 8080

Please note that, for dev mode, Leanote use "note-dev.html" as the note view, and for product mode, Leanote use "note.html" as the note view.

Build Leanote Server & web static file

Leanote use "Gulp" to build Leanote static file (js and note-dev.html -> note.html). You should install nodejs, gulp firstly.

On Leanote home, please run:

$> npm install
$> gulp

How to develop Leanote Clients


安装Leanote

参考 Leanote开发版安装教程

运行Leanote

以开发模式运行Leanote:

$> revel run github.com/leanote/leanote dev [port]
如:
$> revel run github.com/leanote/leanote dev 9000

以生产模式运行Leanote:

$> revel run github.com/leanote/leanote prod [port]
如:
$> revel run github.com/leanote/leanote prod 8080

注意, 以开发模式运行Leanote笔记主页使用的view是note-dev.html, 以生产模式运行Leanote笔记主页使用的view是note.html.

使用eclipse开发Leanote

首先确保你的eclipse已安装goclipse插件, 然后直接将leanote导入到eclipse中(leanote已是一个eclipse项目, 直接导入即可)

为了确保eclipse能自动编译leanote, 你可以建一个symlink src 指向app(src是goclipse默认的源码路径)

当然, 你还可以用Sublime开发Leanote.

构建 Leanote 静态文件

以开发模式启动Leanote时, 使用的是note-dev.html, 发布Leanote时需要合并js, note-dev.html转成note.html.

Leanote前端通过gulp编译, 请在leanote根目录下执行:

$> npm install
$> gulp

在此之前你可能需要安装nodejs, gulp.

You can’t perform that action at this time.