chirpy

command module
v0.0.0-...-c171b48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

README

chirpy

This is a lightweight backend for a web service similar to twitter (X). But instead of tweets, users post chirps!

Some key features:

  • User authentication management through JWTs and refresh tokens
  • Create, read, and delete chirps
  • Basic metrics (hit count)

Please note that this is not a production server.

Installation

Install the binary to your machine with go install.

go install github.com/mgwinsor/chirpy@latest

You will also need a PostgeSQL server running locally. Be sure to run the goose migrations on the database before starting the server!

goose postgres "postgres://user@localhost:5432/chirpy" up

An .env file will also be required for the server to run. It must be placed in the same location as the chirpy binary. The following variables need to be defined:

  • DB_URL: the URL for the PostgeSQL database
    • Example: "postgres://user@localhost:5432/chirpy?sslmode=disable"
  • PLATFORM: the environment where the code runs (recommended value is dev)
  • JWT_SECRET: the secret key for generating the JWT tokens
    • You can generate one with openssl rand -base64 64
  • POLKA_KEY: the key for the imaginary Polka webhook

Usage

There are different endpoints available:

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL