Code Monkey home page Code Monkey logo

recurse-community-portfolio's Introduction

Recurse Center Community Portfolio

Discover all the things Recursers have built!

The Recurse Center Community Portfolio is a website dedicated to showcasing work done by attendees of the Recurse Center. The collection is inclusive, meaning that projects which are small or messy or incomplete are welcome, and it is author-driven, meaning that it respects authors' privacy and is uncurated.

Read more about the project goals and features.

Thank you to each of the contributors who have made this project better!

Getting Started

This project is written in Java 11, and you will need OpenJDK 11 installed.

IDE

I recommend the community edition of IntelliJ IDEA. Project definitions are included in the repo.

Building

This project uses gradle to manage dependencies and build scripts. It includes a copy of the gradle wrapper, which you can invoke directly:

$ ./gradlew build

The build task will both run the tests and build the project.

You can just run the tests with the test task:

$ ./gradlew test

Running

There are several environment variables the app needs. For convenience, these are consolidated in the file .env.template. Copy it to .env (which is ignored by git) with cp .env.template .env, and then edit it to add the following information.

To run the web app locally, you will need to configure a both an OAuth application and a personal access token in your Recurse Center app settings. Create an app with the redirect URI to http://127.0.0.1:8080/login/oauth2/code/recurse, then take the client ID and client secret and set the environment variables CLIENT_ID and CLIENT_SECRET. Create a personal access token and set the environment variable ACCESS_TOKEN.

The app requires a PostgreSQL database. Configure your PostgreSQL server to allow TCP/IP connections, create a user with a password, and then create a database. Put the database URL and credentials in the JDBC_DATABASE variables in your .env file.

Populate the database by running the API sync:

$ source .env
$ ./gradlew bootRun --args="apiSync"

Then, execute the bootRun task to start the web server:

$ source .env
$ ./gradlew bootRun

The server should now be accessible at http://127.0.0.1:8080/.

Deploying

Heroku

This app can be deployed to Heroku.

First, create an application:

$ heroku apps:create

Create an OAuth application and a personal access token in your Recurse Center app settings. Set the OAuth callback URL to be https://your-application-name.herokuapp.com/login/oauth2/code/recurse. Configure your Heroku app with the credentials:

$ heroku config:set \
    ACCESS_TOKEN=your_access_token
    CLIENT_ID=your_client_id \
    CLIENT_SECRET=your_client_secret

Install the Heroku PostgreSQL add-on:

$ heroku addons:create heroku-postgresql:hobby-dev

(Heroku automatically configures the JDBC_DATABASE_URL, JDBC_DATABASE_USERNAME, and JDBC_DATABASE_PASSWORD environment variables when it detects a Java application.)

Creating the application on the command line should automatically configure a new git remote. Push the code to Heroku:

$ git push heroku master

Then, populate the database:

$ heroku run 'java $JAVA_OPTS -jar build/libs/*.jar apiSync'

Your Heroku instance should be ready to use!

Licensed under the AGPL, version 3

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.