Skip to content

michaelact/cafe-everywhere-api

Repository files navigation

Cafe Everywhere

Welcome to Cafe Everywhere, API with purpose to connecting Baristas and Customers. This documentation will guide you through setting up and building Cafe Everywhere.

Dashboard: https://github.com/michaelact/cafe-everywhere

Cafe Everywhere is a toy project and was only made in less than 2 days, for a college assignment.

Quick Start

Follow these simple steps to get Cafe Everywhere up and running on your local environment.

Prerequisites

Make sure you have the following installed on your system:

Setup

  1. Clone the Repository:

    git clone https://github.com/michaelact/cafe-everywhere-api
    cd cafe-everywhere-api
  2. Start the Database:

    docker compose -f docker-compose.dev.yml up -d
  3. Perform Database Migration:

    • Access Adminer
    • Connect to PostgreSQL with the following details:
      • System: PostgreSQL
      • Database: database
      • Username: dev
      • Password: HaloPassword138
    • Create a new database named cafe-everywhere
    • Execute queries from database/migrations/
  4. Install Dependencies:

    go install
  5. Set Environment Variables:

    source .env.example
  6. Run the API:

    go run main.go

Access Cafe Everywhere API at http://localhost:9999.

Build Cafe Everywhere

To Binary

If you want to build Cafe Everywhere into a single binary file, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/michaelact/cafe-everywhere-api
    cd cafe-everywhere-api
  2. Install Dependencies:

    go install
  3. Build the Application:

    go build
  4. Check the Generated Binary File:

    • The binary file named cafe-everywhere will be in the root directory.
  5. Make it Executable:

    chmod +x ./cafe-everywhere
  6. Move it to bin directory:

    sudo mv ./cafe-everywhere /usr/local/bin/

Now you can run Cafe Everywhere from anywhere in your terminal by simply typing cafe-everywhere.

To Docker

If you want to build Cafe Everywhere into a container image, follow these steps:

  1. Run Container:
    docker compose up -d

Now you can run Cafe Everywhere from your computer browser by simply typing http://localhost:9000.

License

Cafe Everywhere is licensed under the MIT License.

Author

Cafe Everywhere is created by Michael Act.

About

Cafe Everywhere API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published