server

command module
v0.0.0-...-81b95c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

README

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
```
2. Configure Application Settings (Auth only works when session enabled)

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:

  1. Set runmode = prod in conf/app.conf
  2. Configure a secure database connection
  3. Set up proper CORS settings in internal/httpserver/server.go
  4. Enable authentication middleware

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL