Skip to content

YangTuanAnh/solution_challenge_golang_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solution Challenge 2024 - Golang Server

Architecture

Architecture

Technologies

Database: Firebase, Firestore, Firebase Authentication

API Deployment: Golang

Server Deployment: Docker, GCP Compute Engine - Golang Instance, NGiNX

Instruction

  1. Put the private files into folder foodfeed_app (.env and .json files)

  2. Install the dependencies (The hardest one)

go mod download
  1. Build the Docker image and run the container using the following commands:
  docker build -t app .
  docker run -d -p 3000:3000 app

TODO: Use Docker-compose to automate deployment

  1. (Optional - Should use when running on a server) Deploy Backend on ngrok
  • Open a new terminal and run ngrok:

      ngrok http 3000
    
  • If not using ngrok, just use the localhost http://127.0.0.1:3000/

API Access: must have user JWT, or denied access

User info:

GET /

Coupons (get active coupons, claim active coupons)

GET /coupons

POST /coupons/:id

Challenges (get avail challenges, active challenges, join challenge)

GET /challenges

GET /challenges/active

POST /challenges/:id

Timer (get, close current timer, create new timer, recommend goal)

GET /timer

PUT /timer

POST /timer/:duration

GET /timer/goal

GET /timer/firsttime

Nicotine consumption (get usage in timeframe, add usage)

GET /nicotine/:duration

POST /nicotine/:value

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published