Git Product home page Git Product logo

clojure-crud's Introduction

clojure-crud

A simple crud application in clojure built as a part of the London Clojure Dojo at uSwitch

Dependencies

  1. ring
  2. compojure
  3. org.clojure/java.jdbc
  4. org.postgresql/postgresql

Setup

The application tries to connect to a postgres db as defined in: src/clojure_crud/core.clj As of now, all it does is, fetch all rows from a table called "person" and display it at root route.

In order for this to work, create a table called "person" in the db and insert a couple records in it. For example:

CREATE TABLE person (first_name: TEXT, last_name: TEXT);
INSERT INTO person(first_name, last_name) values('john', 'doe');

Run

Start the web server using the following command:

lein ring server

and it should open up a browser window for localhost:3000 where records from the "person" table should be visible

Further work

  1. Refactor the code
  2. Fix the hardcoded SQL query
  3. Add functionality to Create, Update and Delete

Resources

  1. Clojure: Getting started
  2. Ring
  3. Compojure
  4. Lein Ring
  5. Leiningen
  6. Postgres image from Dockerhub
  7. clojure/java.jdbc

clojure-crud's People

Contributors

ausmarton avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.