!Note project not deployed because digital ocean is refusing to allow outgoing smtp and that is what my auth currently hinges upon :( Need to find a workaround at some point
REST API for returning quotes from authors
v0.0.1
in your browser go to /authenticate
- Enter your email
- Check your emails for the OTP sent (might be in spam)
- Go back to the page and enter your email again and the OTP
!Note if you already have an api key, doing this again will delete it and recreate a new one
GET /random => fetches a single quote at random for you
GET /author?name= => fetches all quotes from authors matching that name
POST /author => inserts a new quote into the global quote db for everyone ** Content-Type must be application/json ** example of request body: {author":"Donald Trump","message":"CHINA!"}
This application can be run either natively or using Docker. Supported architectures: arm64, amd64
- Pull the image:
docker pull jamoowen/quoteapi:latest - Create a
.envfile in your project directory with your secrets:SECRET_KEY=your_secret_here # Add other required environment variables - Run with docker compose:
docker compose up
-
Clone the repository
-
Install Go (if not already installed)
-
Create a
.envfile with your secrets (as above) -
Use the following make commands:
# Initialize the database (required first time) make init-db # Build the application make build # Run the server directly without building make run # Or build and start the server make build make start-server # Run tests make test # Clean build artifacts make clean # For development: recreate database with sample data make recreate-dev-db
Required Environment Variables:
- SECRET_KEY: Your secret key
- [List any other required env variables]
Note: The application uses SQLite for data storage. Database files will be created in the db directory.