Elixir/Phoenix Project: Project Setup
Tags: elixir, tutorial, sideprojects
Published: 2020-09-23 15:04:45


#### Goals:
  - Create new Elixir/Phoenix project and get it running on my local machine
  - Initialize git and push to Github

----

Before I took the dive in creating my new Elixir/Phoenix project I did what I bet most people would do, and typed something like _Creating Elixir Phoenix Project_ into my favorite search engine. That produced plenty of hits, and I looked at the first steps of a handful of them. Then I took a look at [hexdocs](https://hexdocs.pm/). What is hexdocs? Hexdocs is the source of documentation for all the hex packages for Erlang (which is the base language for Elixir). _Pheonix_ is a package for Elixir, and is managed by hex, and as a result has amazing [documentation](https://hexdocs.pm/phoenix/overview.html).

#### Create new project and get it running on my local machine
I took a look at the other blog posts and tutorials to just double check there wasn't something new or improved from the official docs that I should incorporate into my new project. It appears that everyone is going through the same steps as is recommended in the documentation, so thats what I did. If you are new to Elixir/Phoenix you might be surprised by just how good the hexocs are. In fact, they are so good that I'm not going to rewrite the step-by-step instructions, but instead simply include the links for [installation](https://hexdocs.pm/phoenix/installation.html) and how to get a project [up an running](https://hexdocs.pm/phoenix/up_and_running.html#content). 


#### Initialize git and push to Github
With the new project working locally, I wanted to get it pushed up to Github. Again, great documentation for this whole process. First, I needed to initialize `git` in my newly created project folder. The documentation for that can be found [here](https://github.com/git-guides/git-init). Once that was setup, I needed to create a new Github repo to push this project to. Being that I was already signed into Github, I navigated to [https://github.com/new](https://github.com/new). There are a few options when setting up a new repo, but I was fine just entering the new repo name and keeping it public. The Phoenix generator already created a `README` and `.gitignore` file, and if I decide I want a license I can add it later. Once the repo was created, Github provided instructions on how to link this new repo with the newly created project, I think this [documentation](https://docs.github.com/en/github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line) is a bit more verbose in what needs to be done and why. Following those instructions, all of my Phoenix-generated files are in my newly created repo.

There isn't a ton to see, but [this](https://github.com/noelworden/atlas/tree/d0f6f02eb32093e2311eb3f6b5785dc7f343b761) is what my repo looks after completing the goals of this post.

#### Closing thoughts
Now, I know it might seem to be a bit lazy to write an entire post about how I started my new project and basically rely on the language and service's documentation. But this particular documentation is so good and detailed, I don't see much benefit in me just rewriting it. And, if there's one piece of advice I would give a new engineer, it's that he or she should get comfortable reading and implementing from documentation. The next few parts of this project will be less _out of the box_, influenced by multiple sources of inspiration, and have more written guidance.

#### References
- https://hexdocs.pm/
- https://hexdocs.pm/phoenix/overview.html
- https://hexdocs.pm/phoenix/installation.html
- https://hexdocs.pm/phoenix/up_and_running.html#content
- https://github.com/git-guides/git-init
- https://github.com/new
- https://docs.github.com/en/github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line

------

This post is part of an ongoing [series](https://dev.to/noelworden/new-side-project-new-blog-series-135h). I encourage any critique, feedback, or suggestions in the comments.