user857159
user857159

Reputation: 91

How do I structure directories for a repo that holds a rails app and other code separate from the website?

If I'm creating a rails app and will also be writing other code for the project (think tools and background processes that will be run separately from the website), how should I structure the repository? If my project is called Foobar, is it better to name my repository/top level directory foobar and then name my rails app "website" so that I don't end up with a directory structure like foobar/foobar/...? Should I create them as separate repos on Github so my rails app can be its own repo?

Upvotes: 1

Views: 210

Answers (3)

user1031280
user1031280

Reputation:

If it's an actual self contained entity, roll it up in a gem so you can use it in other projects easily. That way it can have it's own repository, test, etc... The more you can break apart your application at logical components, the easier it is to maintain in the long run.

Upvotes: 1

Alexis
Alexis

Reputation: 4499

You don't need to move your supporting tools outside of your project directory. There are already subfolders which are meant to include things "to be run separately from the website" (for example, /lib/tasks and /script folders). It's absolutely ok to create your own /tools or /any-other-name-you-like subfolder inside your project directory tree.

And especially background processes - it's so likely that they will be closely connected with project internals... they are certainly part of the project.

Upvotes: 1

iltempo
iltempo

Reputation: 16012

Just because the other code runs separately doesn't mean you have to have separate repositories. If the code is somehow related to each other it's fine to keep it in the same one.

Upvotes: 0

Related Questions