• Stars
    star
    727
  • Rank 62,092 (Top 2 %)
  • Language
    HTML
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Hackathon starter project for Flask applications

Introduction

This is a hackathon boilerplate for new Flask web applications created by Major League Hacking. It is for hackers looking to get started quickly on a new hackathon project using the Flask microframework.

Installation Guide

This project requires the following tools:

  • Python - The programming language used by Flask.
  • PostgreSQL - A relational database system.
  • Virtualenv - A tool for creating isolated Python environments.

To get started, install Python and Postgres on your local computer if you don't have them already. A simple way for Mac OS X users to install Postgres is using Postgres.app. You can optionally use another database system instead of Postgres, like SQLite.

Getting Started

Step 1. Clone the code into a fresh folder

$ git clone https://github.com/MLH/mlh-hackathon-flask-starter.git
$ cd mlh-hackathon-flask-starter

Step 2. Create a Virtual Environment and install Dependencies.

Create a new Virtual Environment for the project and activate it. If you don't have the virtualenv command yet, you can find installation instructions here. Learn more about Virtual Environments.

$ virtualenv venv
$ source venv/bin/activate

Next, we need to install the project dependencies, which are listed in requirements.txt.

(venv) $ pip install -r requirements.txt

Step 3: Create an app on GitHub

Head over to GitHub OAuth apps and create a new OAuth app. Name it what you like but you'll need to specify a callback URL, which should be something like:

http://localhost:5000/auth/callback/github

The default port for Flask apps is 5000, but you may need to update this if your setup uses a different port or if you're hosting your app somewhere besides your local machine.

Step 4: Setup your database

You need to be able to connect to a database either on your own computer (locally) or through a hosted database. You can install Postgres locally and connect to it to provide the database for your app.

You will need to know the connection URL for your application which we will call DATABASE_URL in your environment variables. Learn more about the connection URL format. Here is an example:

postgresql://localhost:5432/mlh-hackathon-starter-flask

Step 5: Update environment variables and run the Server.

Create a new file named .env by duplicating .env.example. Update the new file with the GitHub credentials. It should look similar to this:

# .env file
DATABASE_URL="[INSERT_DATABASE_URL]"
GITHUB_CLIENT_ID="[INSERT_CLIENT_ID]"
GITHUB_CLIENT_SECRET="[INSERT_CLIENT_SECRET]"

You replace the GitHub credentials here and update the database URL. Learn more about the required Environment Variables here.

Now we're ready to start our server which is as simple as:

(venv) $ flask run

Open http://localhost:5000 to view it in your browser.

The app will automatically reload if you make changes to the code. You will see the build errors and warnings in the console.

What's Included?

  • Flask - A microframework for Python web applications
  • Flask Blueprints - A Flask extension for making modular applications
  • Flask-SQLAlchemy - A Flask extension that adds ORM support for your data models.
  • Werkzeug - A Flask framework that implements WSGI for handling requests.
  • Bootstrap 4 - An open source design system for HTML, CSS, and JS.
  • Jinja2 - A templating language for Python, used by Flask.

Code of Conduct

We enforce a Code of Conduct for all maintainers and contributors of this Guide. Read more in CONDUCT.md.

License

The Hackathon Starter Kit is open source software licensed as MIT.

More Repositories

1

mlh-hackathon-nodejs-starter

Hackathon starter project for Node.js applications
HTML
699
star
2

mlh-hackathon-organizer-guide

MLH Hackathon Organizer Guide
CSS
316
star
3

mlh-localhost-github

This repo contains the source code for the MLH Localhost workshop, How to Collaborate on Code Projects with GitHub.
JavaScript
137
star
4

mlh-policies

The MLH Policies (under version control)
99
star
5

mlh-localhost-build-and-deploy-aws-starter

JavaScript
76
star
6

mlh-hackathon-boilerplate

Boilerplate code for any new MLH Member Hackathon.
HTML
74
star
7

mlh-hackathon-blockstack-starter

Blockstack Hacker Starter Kit
JavaScript
37
star
8

mlh-no-light

No Light - one of the many fun mini-events we run.
Ruby
33
star
9

mlh-hackathon-rules

These are standard competition rules used at MLH Member Hackathons.
32
star
10

mlh-localhost-internet-computer-dfinity-starter

JavaScript
25
star
11

my-mlh-website-example

An example website using MyMLH, our official single sign on solution.
HTML
20
star
12

mlh-localhost-icon-blockchain-casino-starter

Starter code for the ICON Blockchain Localhost workshop
Python
20
star
13

mlh-localhost-icon-blockchain-casino

Python
18
star
14

mlh-localhost-gitkraken-code

CSS
18
star
15

mlh-localhost-google

JavaScript
18
star
16

mlh-localhost-digital-ocean-starter

JavaScript
17
star
17

mlh-localhost-intro-to-docker

Sample code for MLH Localhost: Intro to Docker
Dockerfile
17
star
18

GitHub-Education-Hackathon-Grant-Fund-2023

This repository is meant to host post-event GitHub Grant reporting
16
star
19

clarifai-food-nutrition-demo

An app that demonstrates using Clarifai's food model to identify your meal and get nutritional info.
JavaScript
15
star
20

oracle-ghw-ai-ml-week-challenges

15
star
21

mlh-flyer-generator

Automatically generate flyers for Local Hack Day.
Python
15
star
22

copilot-starter

A basic Flask web app to demonstrate the functionality of GitHub Copilot.
Python
11
star
23

pong-game-horizen

JavaScript
11
star
24

mlh-hackathon-snap-kit-starter

JavaScript
10
star
25

my-mlh-flask-example

An example Flask application using MyMLH, our official single sign on solution.
Python
8
star
26

mlh-localhost-adacore

Sample application for MLH Localhost: Bug-free programming with SPARK Ada
Ada
6
star
27

sinatra-boilerplate

A Boilerplate for new Sinatra applications at Major League Hacking (MLH).
Ruby
6
star
28

mlh-site-boilerplate

Boilerplate code for internal MLH mini-sites. Written in Jekyll & Gulp.
CSS
6
star
29

omniauth-mlh

OmniAuth strategy for MyMLH V3.
Ruby
6
star
30

Solana-GHW-Web3-Challenges

Solana GHW Web3 Challenges
6
star
31

mlh-localhost-hacking-with-alexa

Sample code for MLH Localhost: Hacking with Amazon Alexa
JavaScript
5
star
32

Auth0-GHW-Cloud-Week-Challenges

5
star
33

Pieces-GHW-AI-ML-Week-Challenges

5
star
34

mlh-localhost-emojifier-code

This repo contains the starter code for the workshop Intro to the MEAN Stack Powered by Blackrock
TypeScript
5
star
35

Oracle-GHW-Data-Week-Challenges

5
star
36

mlh-localhost-build-first-website

CSS
4
star
37

mlh-localhost-shopify-graphql

Source Code for Intro to GraphQL Powered By Shopify Localhost Module
JavaScript
4
star
38

mlh-localhost-hardware-hacking-101

Arduino
3
star
39

mlh-localhost-quorum-network

Shell
3
star
40

mlh-localhost-video-hacker

This repository holds the code for the MLH Localhost Module VideoHacker: Index and Analyze Videos with Microsoft Azure
JavaScript
3
star
41

mlh-localhost-cockroachdb

Sample application for MLH Localhost: Building Scalable Apps with CockroachDB
JavaScript
2
star
42

Oracle-GHW-API-Week-Challenges

Oracle GHW:API Week Challenges
2
star
43

python-ai-three

Python
2
star
44

localhost-python-abstraction

Python
2
star
45

mlh-hackathon-transposit-starter

mlh-hackathon-transposit-starter
HTML
2
star
46

mlh-localhost-twilio-app

MLHMemes project using Twilio's API!
JavaScript
2
star
47

python-ai-one

This contains the starter code for the MLH Localhost Module Intro to Python Skills for AI Part One
Python
2
star
48

mlh-hackathon-nodejs-mongodb-starter

HTML
2
star
49

mlh-localhost-slack-app

This repo contains the code for the Build Apps for Slack MLH Localhost module.
JavaScript
2
star
50

recruitee-node

JavaScript
1
star
51

mlh-localhost-cockroachdb-ve

JavaScript
1
star
52

python-ai-two

This contains the starter code for the MLH Localhost Workshop Intro to Python Skills for AI Part Two
HTML
1
star
53

localhackday-hubot

This is a Hubot instance that will run in the Local Hack Day slack. Feel free to make PRs!
CoffeeScript
1
star
54

mlh-localhost-azure-bot

CSS
1
star
55

Twilio-GHW-Security-Week

1
star
56

mlh-docker-labs-fork

PHP
1
star
57

Defang-Landing-Page

HTML
1
star
58

blackrock-challenge-03-public

The public repository for BlackRock CTF Challenge #3. https://challenges.mlh.io/challenges/3
1
star
59

localhost-gitkraken

This repository contains the starter code for the MLH Localhost workshop, How to Collaborate with GitKraken.
CSS
1
star