🚀
ShipClojure
  • README
  • Development
    • Getting Started
    • REPL Workflow
    • AI Development with ShipClojure
    • Getting Updates
    • Formatting code
    • ShipClojure Guiding Principles
  • Backend
    • Migrations
    • Secrets
    • Routing
    • ShipClojure Blog
    • Email
  • Frontend
    • UIx + re-frame
    • HTTP Requests with Re-frame
    • Frontend Navigation with Re-frame
    • Toast Notifications
    • Icons
  • Server Side Rendering
    • Static/Landing pages
  • Auth
    • How Auth works
    • Oauth2 providers
  • Deployment
    • Deployment
  • Decisions
    • 001 - Cookie Sessions
    • 002 - Single Page Application Architecture
    • 003 - Re-frame instead of Refx
    • 003 - Move from cookie sessions to JWT Access + refresh tokens
Powered by GitBook
On this page
  • Prerequisites
  • Initial Setup
  • Development Workflow
  • Quick Start with Babashka
  • Using the REPL
  • Frontend only development
  • Testing
  • Building for Production
  • Next Steps
  1. Development

Getting Started

PreviousREADMENextREPL Workflow

Last updated 21 days ago

Welcome to ShipClojure! This guide will help you get your development environment set up and running quickly.

Prerequisites

  1. Install for managing development environment tools

  2. Clone the ShipClojure repository and set up your own repository

    # Clone the repository
    git clone git@github.com:shipclojure/shipclojure.git
    cd shipclojure
    
    # Set up for future updates
    git remote rename origin upstream
    git remote add origin <your_repository_git_address>

    See for more details on how to manage ShipClojure updates.

Initial Setup

  1. Set up the development environment using mise:

    # mise will install the right versions of tools defined in .mise.toml
    mise install
  2. Install npm dependencies:

    npm install
  3. Set up development secrets:

    cp saas-secrets.example.edn resources/.dev-secrets.edn

    Make sure to update the values in .dev-secrets.edn with your development credentials, especially the database connection. See for more details.

Development Workflow

ShipClojure offers multiple ways to run the development environment:

Quick Start with Babashka

The easiest way to get started is using Babashka scripts:

# Start both frontend and backend servers
bb dev

This will start the Shadow-CLJS development server (for the frontend) and the Clojure backend server.

Using the REPL

Frontend only development

NOTE: This workflow is not recommended. The frontend html is served from a template on the backend, that include only the necessary data and many pages are protected so won't be accessible without the backend running. This is very much a convenience hack and should be used sparingly.

bb frontend-dev

Testing

To run the tests:

# Run Clojure tests
clj -X:test-clj

# Run ClojureScript tests
clj -M:test-cljs

Building for Production

To create a production build:

  1. Create .prod-secrets.edn:

cp saas-secrets.example.edn resources/.prod-secrets.edn
  1. Update secret values to production ones

  2. Run bb release

bb release

This will build optimized frontend assets and prepare the application for deployment.

Next Steps

NOTE: Changes on the backend server won't be reflected until the server is restarted. See for a more interactive workflow.

For a more interactive development experience, check out the documentation.

Explore the to learn more about the architecture and components

Check out the to understand the available UI building blocks

Learn about the

mise
Getting Updates
secrets management
REPL Workflow
REPL Workflow
documentation
UI Components
authentication system