hackfsu.com
v5Welcome to the HackFSU Webapp & API repository.
We don't recommend using Docker for webapp development. We do recommend Yarn.
Install the dependencies by typing yarn
and then launch the Express app with yarn dev
. This will use nodemon
to automatically relaunch the app when you change things.
Our setup uses the Pug templating language in lieu of HTML, and Sass instead of CSS. Express automatically complies these at runtime. The Pug files are in webapp/views
and the Sass is in webapp/public/sass
.
We use Bulma for its Sass styles, which are imported and inherited by our own.
Important note: For the navbar, instead of following the recommended approach for the fixed navbar header padding, we use a custom navbar spacer in the base Pug template, inside the content
block. Therefore, to keep the spacer, you must use block append content
, and to disregard the spacer, use block content
.
We have two kinds of Javascript in the webapp. The first are small scripts, some of which are inline, for UI things.
We also use Webpack to handle the registration logic. If you want to edit the registration JS, use webpack --watch --config webpack.dev.js
to pack up the files.
Also check out the Docker instructions in the next section.
Setup Guides for PyCharm. We recommend PyCharm not only as a powerful Python IDE, but also as a robust Docker Deployment UI.
JetBrains, the producers of PyCharm and Webstorm, offer free student licenses which are automatically approved with a .edu
email. Create an account and apply for a student license before proceeding, as most of the features used in this guide rely on the Professional editions of the software.
Be sure to install the Professional editions of the software.
.docker/README.md
).docker-compose.yml
(see Docker Compose Configs above).docker-compose.yml
file.The first time the API launches, you need to apply the database migrations. First, launch into the bash terminal using the API's migration file.
docker-compose -f api/migrate.yml run api bash
Once in the terminal, you need to apply the migrations.
python manage.py migrate
If you change the models at all, you'll need to make migrations and then apply them
python manage.py makemigrations
python manage.py migrate
The core of the system requires a hackathon
object to function. In order to set this up, you need to:
Create a superuser using an email address as the username.
docker-compose run api python manage.py createsuperuser
Then, log in at <hostname>/login
. Then navigate to <hostname>/admin/django
, and click on the hackathon
class. Create a hackathon object and check the current
checkbox.
HackFSU 4 hosted the website as static files served by Django. These files were built using Node.js + Gulp.
The HackFSU API Dockerfile extends hackfsu/api-base
image. We include the Dockerfile in the api
folder as api-base.dockerfile. However, an hackfsu/api-base
image is also hosted on the Docker Hub.
All the legacy site comes prebuilt in base, and the Dockerfile file included in API is what actually gets used to build the modern API.
There are many advantages to Docker, including automatic dependency installation, a simple deployment strategy, and increased security via sandboxed components.
We use Docker for deploying our apps on our servers. We also use it during development for our databases and the API.
git clone https://github.com/hackfsu/hackfsu_com
Also see .docs/Docker.md
for details on what to install and how to configure your Docker hosts.
docker-compose.yml
is the default configuration for all components of our suite. If you want for ease of development, you can copy/edit/extend the Compose configuration to meet your needs.
You can find documentation on how to edit the Docker Compose file here.
If you choose the use a docker-compose.yml
file you can use docker-compose [command]
, otherwise you will need docker-compose -f <.docker/compose_file> [command]
.