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.
Follow these simple steps to get Cafe Everywhere up and running on your local environment.
Make sure you have the following installed on your system:
- Golang v1.20.4 or latest version
- Rancher Desktop or Docker
-
Clone the Repository:
git clone https://github.com/michaelact/cafe-everywhere-api cd cafe-everywhere-api
-
Start the Database:
docker compose -f docker-compose.dev.yml up -d
-
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/
-
Install Dependencies:
go install
-
Set Environment Variables:
source .env.example
-
Run the API:
go run main.go
Access Cafe Everywhere API at http://localhost:9999
.
If you want to build Cafe Everywhere into a single binary file, follow these steps:
-
Clone the Repository:
git clone https://github.com/michaelact/cafe-everywhere-api cd cafe-everywhere-api
-
Install Dependencies:
go install
-
Build the Application:
go build
-
Check the Generated Binary File:
- The binary file named
cafe-everywhere
will be in the root directory.
- The binary file named
-
Make it Executable:
chmod +x ./cafe-everywhere
-
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
.
If you want to build Cafe Everywhere into a container image, follow these steps:
- Run Container:
docker compose up -d
Now you can run Cafe Everywhere from your computer browser by simply typing http://localhost:9000.
Cafe Everywhere is licensed under the MIT License.
Cafe Everywhere is created by Michael Act.