AnniversaryAPI is the backend component of the Anniversary project, a personal photo album developed as a Valentine's gift. It is designed to manage photo uploads, secure authentication, and ensure that photos can only be viewed on special days like the couple's dating anniversary or Valentine's Day. The backend is built with Go (Golang) and integrates with Grafana and Prometheus for monitoring, and gin for handling HTTP requests efficiently.
- RESTful API: Facilitates photo uploads and retrievals with a focus on security and efficiency.
- Secure Authentication: Utilizes JWT for secure authentication, ensuring that only authorized users can access the application.
- Monitoring with Grafana and Prometheus: Offers insights into the application's performance and usage metrics.
- Efficient HTTP Requests: Leverages the gin framework for fast and lightweight HTTP request handling.
- SQLite Database: Utilizes SQLite for lightweight and reliable data storage, making it easy to manage user data and photo metadata.
- Go (Golang): For robust backend logic and performance.
- Grafana & Prometheus: For application monitoring and performance metrics.
- Gin: A HTTP web framework written in Go for building efficient and scalable RESTful APIs.
- SQLite: A lightweight, disk-based database that does not require a separate server process.
Ensure you have the following installed on your system before you begin:
- Git
- Docker & Docker Compose
- Make (optional)
- Insomnia (for API documentation viewing)
-
Clone the Backend Repository:
git clone https://github.com/VicSobDev/AnniversaryAPI
-
Navigate to the Project Directory:
cd AnniversaryAPI -
Environment Setup: Before building or running the application, set up the
.envfile with the required environment variables:JWT_KEYGF_SECURITY_ADMIN_PASSWORDPROMETHEUS_KEYAPI_KEY
-
Create a Key File for Prometheus: Within the
prometheusfolder, create a file namedkeycontaining theAPI_KEYfor accessing Prometheus metrics. -
Run the Backend: You can start the backend server using the Makefile or by building the Docker Compose file:
- Using the Makefile:
make run
- Using Docker Compose:
docker-compose up --build
- Using the Makefile:
- To view the API documentation, install Insomnia and import the
insomnia docs.jsonfile provided in the project directory.
Make sure to configure the frontend application to communicate with this backend API by setting the appropriate API service configurations in the React application.