Giter Site home page Giter Site logo

goangit / clojure-web-application Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dzaporozhets/clojure-web-application

0.0 0.0 0.0 127 KB

Sample web application built with Clojure. Easy start for people new to Clojure.

Home Page: https://gitlab.com/dzaporozhets/clojure-web-application

License: MIT License

JavaScript 0.27% Clojure 98.35% CSS 0.75% Dockerfile 0.49% Procfile 0.14%

clojure-web-application's Introduction

Sample web application built with Clojure

pipeline status

The goal of this project is to make a blank web application with authentication and tests. It can be used as an template for starting a new project on Clojure or for learning Clojure.

Merge requests to this project are welcome!

Index

Screenshot

Just in case you are curious how it looks when started

Screen_Shot_2017-08-06_at_6.20.18_PM

Prerequisites

  1. [Leiningen][https://github.com/technomancy/leiningen] 2.0.0 or above installed.
  2. PostgreSQL

Features

  • Registration
  • Login
  • Profile page with ability to update the password and remove the account
  • PostgreSQL database with migrations
  • Layout with Bootstrap CSS and jQuery
  • Send email confirmation on signup (optional)
  • Avatar upload

TODO

  • add remember me checkbox for authentication
  • add forget password feature

Running

Create the database:

createdb sample

To start a web server for the application, run:

lein ring server

Now visit http://localhost:3000/ to see the app running.

Run as container

The repository contains the Dockerfile. You can build and run the app with Docker. App will be running on port 5000 by default. Database is not included. So make sure to pass a DATABASE_URL to the container.

Running on Heroku

Clone the repository and cd into it. Then execute next commands:

heroku create
heroku addons:create heroku-postgresql:hobby-dev
git push heroku main
heroku open

The last command should open the application in your browser.

Database

Application reads the DATABASE_URL environment variable for the database connection. If none provided, it will use the default value from src/sample/db.clj.

Migrations

Migrations are run automatically when you start the app or tests. If you need to manually run migrations, you can use next command:

lein migratus migrate

Tests

To run tests you need to setup a test database

# create a separate database for tests
createdb sample-test

# run tests
DATABASE_URL=postgresql://localhost:5432/sample-test lein test

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.