user1432059
user1432059

Reputation:

AngularJs + Laravel application development and repositories management

For the next 6 months I've to manage two or more developer on a web application development, based on Laravel (backend framework used for restful ws) and AngularJs (frontend framework which calls my ws).

As far as I know, the Angular code must resides into the public folder (the Laravel public folder), but in this way, I cannot use different repositories for two submodules (frontend app and backend app), in order to assign to each developer own repo (frontend repo to frontend dev, backend repo to backend dev).

  1. How can I organize the project, allowing each dev to work independently?
  2. How can I organize the project, in order to be able to deploy frontend and backend code on production server in different moments?

I'll plan to use agile methods.

Upvotes: 1

Views: 162

Answers (1)

Limon Monte
Limon Monte

Reputation: 54419

Git Submodules can be the solution here.

You can organize you code this way: main repo (backend) + submodule (frontend).

  1. to deploy backend only:
cd backend
git fetch && git reset --hard origin/master
  1. to deploy frontend only:
cd frontend
git fetch && git reset --hard origin/master
  1. to deploy both backend and frontend:
cd backend
git fetch && git reset --hard origin/master
git submodule sync
git submodule update --init --recursive

Of course this is only the simple example, but I assume it's clear enough to get the point of Git submodules :)

Upvotes: 1

Related Questions