This project is designed to fetch and update driving exam dates and times from the Georgia government API and store them in MongoDB.
It also provides endpoints to retrieve the saved data.
- Pulls driving exam dates and times for various categories (theory, manual, and automatic) and cities in Georgia;
- Uses randomized User-Agents when sending HTTP requests;
- Periodically triggers data update every 10 minutes;
- Provides a frontend static file server;
- Logs events and errors using the
logrus
library.
/api/update-dates
- Fetches data from the API and updates the MongoDB collections./api/get-theory
- Retrieves theory exam dates and times./api/get-manual
- Retrieves manual driving exam dates and times./api/get-auto
- Retrieves automatic driving exam dates and times./api/last-exec-time
- Fetches the last execution timestamp./
- Serves frontend static files.
- Go language environment;
- MongoDB instance;
- Set the
MONGO_URI
environment variable to your MongoDB connection string.
- Clone the repository;
- Navigate to the project directory;
- Run the command
go run main.go
.
The application will start, and the logs will indicate that the application is listening on [http://localhost:8080].
logrus
: For logging events and errors;mongo-driver
: For connecting to and performing operations on MongoDB;- Standard Go libraries for HTTP server, JSON manipulation, and other utilities.
This project uses a hardcoded API endpoint.
Ensure you have the appropriate permissions or authorization to access the API before triggering the application. Also, avoid excessive requests to prevent potential rate-limiting or blacklisting.