Skip to content

shaneajeffery/udacity-go-crm-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Udacity Go CRM Backend

Course Link: https://www.udacity.com/course/golang--cd11970

Project Layout Recommendations: https://github.com/golang-standards/project-layout

Given the times that I have worked with Go in a professional capacity have been sporadic, I started the Udacity course to make sure I didn't miss out on any of the fundamentals. I had never built a Go project from scratch and was always stepping into projects that were already mature.

So, with that, I wanted to stick to Go standard library as much as possible for this project. I know I could have reached for a lot of different packages to make my code more simplistic, but I wanted to be sure I understood the standard library concepts before getting into the abstractions too heavily.

External Packages Used

  • air: Needed for live reloading.
  • pgx: Needed for interfacing with postgres.
  • godotenv: Needed for .env file import.

I would definitely reach for a HTTP library to make building out of these REST API pieces easier and more concise. I would look at Gin or Chi mainly.

I am not interested in libraries that are bringing the "Javscript Problem" along like Fiber or Echo.

air Setup Note

Needed alias air='$(go env GOPATH)/bin/air' to get air init to run properly.

Running Project

  1. Import the seed_data.sql in your local Postgres client.
  2. Create your .env file with cp .env.example .env .
  3. Set your POSTGRES_DB_URL in the .env.
  4. Run go get . to download all external packages.
  5. Run air from the root of the project to start up the server via hot reloading. Make sure you have air setup on your machine by running go install github.com/cosmtrek/air@latest, then adding alias air='$(go env GOPATH)/bin/air' to your bash or zshrc file, and finally re-sourcing the file.
    • You can also just run go run ./main.go if you don't want the hot reload server.
  6. To build the binary, run go build -o ./bin ./cmd/udacity-go-crm-backend.

About

CRM Backend Final Project for Udacity's Go course.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages