Skip to content

REST API for dev-diaries; a blog service, written entirely in Go

Notifications You must be signed in to change notification settings

vineet192/dev-diaries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dev Diaries

Blog API written entirely in Go. This repository contains the backend code written in Go with MySQL as the database.

Steps to run locally

  • This project uses Infisical as the secrets vault. Create an account for their free cloud service or have a local instance running
  • You will also need to have a local/remote instance of MySQL up and running
  • Add the following secrets to Infisical:
    • DB_PASSWORD=<your-MySQL-user-password>
    • DB_USER=<your-MySQL-username>
    • JWT_SECRET=<256-bit-secret>
  • Add a .env file in the project root with the following variables
    • DB_URL=@tcp(<your-db-host>:<your-db-port>)/blog_db?charset=utf8mb4&parseTime=True&loc=Local
    • TOKEN_VALIDITY_MINUTES=<duration-of-JWT-Token-in-minutes>
    • INFISCAL_SECRET=<infisical-secret>
    • INFISCAL_CLIENT_ID=<infisical-client-id>
    • INFISCAL_HOST=<infisical-host-url>
    • INFISCAL_ENVIRONMENT=<dev/staging/prduction>
    • INFISCAL_WORKSPACE_ID=<infisical-workspace-id>
  • Run go mod download to install all dependencies
  • Run go run main.go to run the server on PORT 4000

About

REST API for dev-diaries; a blog service, written entirely in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published