Skip to content

Latest commit

 

History

History
101 lines (76 loc) · 2.22 KB

File metadata and controls

101 lines (76 loc) · 2.22 KB

SETUP GUIDE ⚒️

Below is a step-by-step guide to set up the Frontend (Next.js) and Backend (Golang + Fiber) for Honya Books.

Prerequisites

Make sure you have the following installed:

Environment Variables

Duplicate the .env.example file in both frontend and backend directories and rename it to .env. Make sure you have the following environment variables set up:

Frontend

  • BACKEND_API_URL

Backend

  • DATABASE_URL: URL of the PostgreSQL database
  • SERVER_PORT: Port the server will run on
  • LOG_STACK: Stack the logs will be stored in
  • LOG_RETENTION: Retention period for the logs

AWS Credentials

  • AWS_BUCKET_NAME: Name of the AWS bucket
  • AWS_REGION: Region of the AWS bucket
  • AWS_ACCESS_KEY_ID: Access key ID for the AWS bucket
  • AWS_SECRET_ACCESS_KEY: Secret access key for the AWS bucket

URL Cleanup Original Domain

  • URL_CLEANUP_ORIGINAL_DOMAIN: Original domain of the URL for cleanup

Run the Application

1. Clone the Repository

git clone https://github.com/TechAtikiN/honya.git
cd honya

2. Install Dependencies

  1. Using Makefile
make install

make install will install both frontend and backend dependencies.

  1. Custom Install
cd frontend
pnpm install # Install frontend dependencies
cd backend
go mod download # Install backend dependencies

3. Run the Application

  1. Using Makefile
make run # Run the application
  1. Using Docker
make docker-up # Run the application in containers
  1. Custom Run

Frontend

cd frontend
pnpm dev # Run the frontend

Backend

cd backend
go run main.go # Run the backend

4. Access the Application

  • Frontend: http://localhost:3000
  • Backend: http://localhost:8080

Swagger UI: http://localhost:8080/swagger/

API Documentation

The API documentation can be found at API.md file.