尼斯的Git架构服务器/客户端? [英] Nice Git architecture for server / client?

查看:168
本文介绍了尼斯的Git架构服务器/客户端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我即将开始pretty浩大的工程。

I'm about to start a pretty huge project.

该项目是一个网站。


  • 后端将与节点做出

  • 前端将主要用做角

后端将是一个API(这是与角凉)也(后下)Android应用程式。

Backend is going to be an API (which is cool with Angular) but also (later) for an Android app.

前端将是这一回购的叉: https://github.com/maxime1992/webTemplate,我希望能够从上游拉来保持叉最新的。

Frontend is going to be a fork of this repo : https://github.com/maxime1992/webTemplate and I want to be able to pull from upstream to keep the fork up to date.

我想知道。我应该如何管理呢?

I am wondering. How should I manage it?


  1. 我应该只创建一个回购协议,包含背部和前端使用Git子模块或子树。

  2. 我应该创建两个分开的回购,一个是前台,一个是后台,然后用符号链接来让他们在一起吗?但是,如果有人想在Windows上运行它...太糟糕了。

我想这个项目是在GitHub上的开源,所以我想有一些清晰,便于大家:)

I want this project to be open source on GitHub so I would like to have something clear and easy for everyone :)

告诉我你会怎么做呢,什么是好的,什么是错的......我真的很好奇!

Tell me how you would do it, what's good, what's wrong ... I'm really curious!

推荐答案

由于在评论中指出的,Git的子模块(或Git的子树)是不是这个合适的解决方案。使用依赖管理工具,这一点,这将跨平台工作(在Linux,Mac,Windows)中,是这样做的标准方式。

As indicated in the comments, Git submodules (or Git subtrees) are not the right solution for this. Use a dependency management tool for this, which will work cross-platform (Linux, Mac, Windows), and is the standard way of doing this.

您的后端和前端分离成单独的项目是一个好主意,因为它可以让你独立管理项目和添加功能或额外的客户端应用程序后无腹胀您的应用程序。

Separating your backend and frontend into separate projects is a good idea, as it will allow you to manage projects independently and add functionality or additional client applications later without bloating your application.

既然你已经采用了棱角分明的前端,我建议你看一看鲍尔,这是德-facto标准依赖管理工具,前端项目。它允许你定义一个 bower.json 文件来定义你的依赖,例如角等前端库,让您组装您的前端的项目,而无需手动下载和存储库。

Since you're already using Angular for the frontend, I suggest you take a look at Bower, which is the de-facto standard dependency management tool for frontend projects. It allows you to define a bower.json file to define your dependencies, e.g. Angular and other frontend libraries, allowing you to assemble your frontend project without having to download and store libraries manually.

在后端的项目,你会再还指着其中添加的声明前端项目作为的依赖的一个 bower.json 的文件Git的位置和分支。那么鲍尔将下载您前端的项目,并添加到您的后端项目的照顾。

In your backend project, you would then also add a bower.json file which declares your frontend project as a dependency by pointing to its Git location and branch. Bower will then take care of downloading your frontend project and adding it into your backend project.

检查出一些流行的鲍尔教程以获取更多的信息.​​..

Check out some of the popular Bower tutorials for more info on this...

您可以使用亭子链接来自动创建您的项目之间的符号链接 - 这将跨操作系统工作,以及

You can use bower link to automatically create symlinks between your projects - this will work across operating systems as well.

这你可能想看看一些其他的工具:

Some other tools that you might want to check out:

  • Yeoman for scaffolding a base project. There are some nice generators for scaffolding Angular projects, including things like LESS/SASS and Bootstrap (https://github.com/yeoman/generator-angular)
  • Wiredep for automatically wiring your Bower dependencies into your index.html file.

获取最初的项目设置权将是非常重要的。你可以开始小和成长的东西到一个更高级的配置更高版本。

Getting your initial project setup right will be important. You can start small and grow things to a more advanced configuration later.

这篇关于尼斯的Git架构服务器/客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆