Olake Server
Olake Server is a RESTful API service built with Gin that manages data sources, destinations, jobs, and users for data ingestion workflows.
Prerequisites
- Go 1.23 or later
- PostgreSQL 12 or later
- Git
Setup Instructions
1. Clone the Repository
```bash
git clone https://github.com/datazip-inc/olake-ui.git
```
Review and update the configuration in conf/app.conf as needed:
appname = olake-server
httpport = 8000
runmode = dev
postgresdb = postgres://postgres:testing@testing-postgres.postgres.database.azure.com:5432/olakedb
# Session configuration
sessionon = true
If session enabled, then manually run following command on your postgres db
CREATE TABLE session (
session_key VARCHAR(64) PRIMARY KEY,
session_data BYTEA, -- Critical for binary storage
session_expiry TIMESTAMP WITH TIME ZONE
);
3. Run the Application
go mod tidy
go run .
# or
make run
The server will start on port 8000 (or the port specified in your configuration).
4. Create a User
Create a user to login via frontend:
make create-user username=admin password=yourpassword email=admin@example.com
Project Structure
- conf/ - Configuration files
- internal/handlers/ - Request handlers for API endpoints
- internal/models/ - Data models and database schema
- routes/ - URL routing definitions
- utils/ - Utility functions and helpers
- main.go - Application entry point
API Endpoints
All API Endpoints: Postman
Authentication
- POST
/login - User login
- POST
/signup - User registration
- GET
/auth/check - Check authentication status
Sources
- GET
/sources - Get all sources
- POST
/sources - Create a new source
- PUT
/sources/:id - Update a source
- DELETE
/sources/:id - Delete a source
Destinations
- GET
/destinations - Get all destinations
- POST
/destinations - Create a new destination
- PUT
/destinations/:id - Update a destination
- DELETE
/destinations/:id - Delete a destination
Jobs
- GET
/jobs - Get all jobs
- POST
/jobs - Create a new job
- PUT
/jobs/:id - Update a job
- DELETE
/jobs/:id - Delete a job
Users
- GET
/users - Get all users
- POST
/users - Create a new user
- PUT
/users/:id - Update a user
- DELETE
/users/:id - Delete a user
Development
Running in Development Mode
The application runs in development mode by default, with ORM debugging enabled.
Deployment
For production deployment:
- Set
runmode = prod in conf/app.conf
- Configure a secure database connection
- Set up proper CORS settings in
internal/httpserver/server.go
- Enable authentication middleware