DEV Community

Nick Janetakis
Nick Janetakis

Posted on

How do you organize source code on your computer?

I'd be curious to see how everyone organizes their source code.

Let's see some screenshots or terminal dumps of your set up.

Here's what I've been doing for the last 5 or 6 years:

Source code layout

I like to organize my code by what it's used for rather than by language.

I've been a freelance developer for about 20 years and inside of those folders are hundreds of projects ranging from Visual Basic 6 from the mid 1990s to more recent projects written in Flask, Rails and Phoenix.

Latest comments (32)

Collapse
 
bmalbusca profile image
Bruno Figueiredo

Well, I'm using this github project as the standard: dworkspace

Divides the internal from external projects, and inside the internal projects, sub-divide the lab (tutorials, experiences, where also are grouped by the tech/frameworks) from personal projects. Already cames with script that automatically creates the folders.

Collapse
 
moopet profile image
Ben Sinclair

I'd like to say I'm organised but I'm actually quite scrappy. I'll go so far as to make a directory called work or something, but that's about it.

One thing you do I don't understand is have a directory called github. I wouldn't do that unless I was working on the code for github :) Other than that, everything I do is version controlled and I don't care what company provides remotes for it.

Collapse
 
nickjj profile image
Nick Janetakis • Edited

The github/ folder is dedicated to open source projects, not necessarily all projects that happen to use git (2 different things).

I could probably rename it to opensource/ but in this case, 100% of my open source work is on github.

Collapse
 
rogues_gallery profile image
🃏

thiiiiis is so fantastically helpful to read, had not even occured to me in much detail previously. thanks Nick! and to all of you who have thrown in on this discussion, this has been exponentially more helpful for me to your responses in context. y'all are great!

Collapse
 
kayis profile image
K

Normally I throw everything in a development folder on any machine I'm working on.

Not every project is on every machine, these are just my desktop projects.

listing

One folder for one project. My mobile projects are on the MacBook.

Private projects go on Bitbucket, public projects go on GitHub.

Collapse
 
vlasales profile image
Vlastimil Pospichal • Edited
  • ~/CompanyName/ProjectName # Day Jobs
  • ~/Customer/CompanyName/ProjectName # Legacy Jobs
  • ~/Prototype/ProjectName # My Experiments
  • ~/GitHub/ProjectName # Downloaded Projects
  • ~/bin/ScriptName # My Own CLI Scripts
  • ~/Tutorial/ThemeName # Courses
  • ~/Documents # Contracts
  • ~/Downloads # Unprocessed Downloads
  • ~/Dropbox # Shared Configurations

I inserted some directories into CDPATH for easy use.

Collapse
 
nelsonmestevao profile image
Nelson Estevão

I like the idea of having everything on my home.

(~ is where ❤️ is)

Any kind of ~/Developer or ~/Projects would be a good fit for me. However, in the last year I settle on ~/Code. And since then I store all my repos on that folder. And I try to keep only projects that I am working on. I use GitHub, GitLab and Bitbucket for store all of them remotely.

I have three exceptions though. First, my dotfiles repo is at ~/.dotfiles. Second, a spells repo is at .spells which contains some shell scripts.

The third exception is anything that I might use for learning purposes. I store those at ~/Desktop.

Collapse
 
avalander profile image
Avalander
~/Projects
    |- archived
    |- ongoing
    |- tutorials

ongoing is where I have the projects that I'm currently (or I've reasonably recently been) working on.

archived is where I move my projects after I abandon them. I try to be honest with myself and move projects from ongoing to here when I haven't worked on them in a few weeks and it's unlikely that I will take them up in the next few days. Also, sometimes I move projects from archived to ongoing if I decide to resurrect them.

tutorials is where I store the code I write following tutorials. I have a special consideration for those because usually when I'm learning something new and I follow a tutorial, I create a project with all the examples and stuff, that is handy to review when I'm working on a project with that stuff.

Collapse
 
amin007 profile image
amin007 • Edited

well, I Want It That Way - Backstreet Boy

Collapse
 
ctrleffive profile image
Chandu J S • Edited

I have a Developer folder in my home directory.
I put all my code into the Developer folder. No other folders have project codes.
Folder name of the project will be the same as git repo name (only lowercase and dashes. no underscores).

I use GitHub for public sources and GitLab for private sources.

I have same structure for work

Collapse
 
mraubreycodes profile image
Aubrey Fletcher

Because we use a project management software at work. I break it down by the following:

  • What department is the user? (I work in a college).
  • What is the Project Management Number?

I started using Git for changes, but I should be getting back to using it more regularly than I have.

Collapse
 
drewknab profile image
Drew Knab

~/code/fun/[project]
~/code/work/[client]/[project]

Collapse
 
a544jh profile image
Axel Wikström

I just have my repos in ~/git.

Collapse
 
squgeim profile image
Shreya Dahal • Edited
  • Day job:
    ~/Projects/CompanyName/ProjectName

  • Personal serious side projects or regular open-source contribution:
    ~/Projects/Personal/ProjectName

  • Practice non-serious side projects:
    ~/Projects/Practice/TechnologyName/ProjectName

  • Some open-source apps/scripts that I use and tinker with or have to self-host:
    ~/Projects/Applications/ProjectName

  • One-off scripts and POCs:
    ~/Projects/tmp

Collapse
 
tadaboody profile image
Tomer

All my projects are on ~/ except for future pull requests on ~/Forks.

Collapse
 
pkristiancz profile image
Patrik Kristian

I have everything under one directory and then all arraged by client/project/