A back-end service for APOD Viewer written in Go. Communicates with NASA's API to serve image and allow various actions by users.
APOD (Astronomy Picture of the Day) is published by NASA daily, and can be found here. APOD Viewer uses NASA's API to service a web-app that allows users to:
- Browse
- Search
- Like
- Save
- Comment
The front-end React app repo can be found here.
This project can be run using docker or running the service locally on your machine. Make sure you've installed all the correct software before running the service. Please create a .env
file in your root directory with the correct environment variables.
You will need to install docker and docker-compose
- You can find the guide to install docker here
- You can read more about docker on their website
The service is written in Go and uses MongoDB for data persistence. You will need to install both onto your machine.
This project is using go modules. After pulling the repo, simply run
go get -v -d ./...
NASA let's you sign up for a free API key. Once you have the key, add that as an environment variable
NASA_API_KEY=<YOUR_API_KEY>
User authentication is done via Google's Firebase. You will need to set up your own firebase project and generate a private Admin SDK key (used to verify user token from front end) stored as a .json
file, which you can set the path as an environment variable.
GOOGLE_APPLICATION_CREDENTIALS=<PATH_TO_SECRETS>
To start the mongodb and go service containers.
docker-compose up
Once the container is running, you can ssh into the container by using the command
docker exec -it <CONTAINER_NAME> sh
From the root directory you can build and run the binary file
go build main.go
main.exe
Or if you'd like to directly run the service without building
go run cmd/apodviewer/main.go
To run all tests
go test -v ./...
To run a single test file, specify the test file path
go test -v ./test/dir/<FILE_NAME>
Make sure you have golangci-lint installed on your computer. You can check out their github page
golangci-lint run
-
Once all the core features are ready, I'm hoping to implement a simple ML algorithm to recommend images to users depending on what they have searched, liked and saved.
-
Maybe I can implement a section where users can upload and share their own astronomy images instead of only relying on NASA as the source
-
Mobile applications on iOS and android to reach a larger audience
- Kevin Kwon - portfolio