Giter Site home page Giter Site logo

edcable / saveourfaves-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mikeyk/saveourfaves-server

0.0 1.0 0.0 29 KB

The backend to saveourfaves.org; open-sourced in case there are folks who want to spin up something similar for their own communities

Home Page: https://saveourfaves.org

License: MIT License

Python 97.75% Dockerfile 2.25%

saveourfaves-server's Introduction

This is the backend for SaveOurFaves.org.

It's a fairly straightforward Django app with Postgres/PostGIS backing it for the 'nearby' queries. You'll also need the React frontend. It also uses nginx as the load balancer and file server for the static files/React app.

To get this up and running:

  • Install Docker on your machine
  • Either generate certificates using letsencrypt and put the results of /etc/letsencrypt in a directory above this one called certificates (eg ../certificates/letsencrypt/ or edit nginx/nginx.conf to remove the HTTPS/letsencrypt references
  • Generate an htpasswd formatted file and place it in ../certificates/nginx_auth (this is used to password-protect the Django admin site; there’s also Django’s standard auth there, but this adds another optional layer.
  • From the root folder, run docker-compose up -d to bring up nginx and Django
  • From the db folder, run docker-compose up -d to bring up Postgres
  • You’ll want to edit the nginx/nginx.conf file to match the hostname you’re trying to deploy to. To quickly test if this is all working on your local machine, you can add an /etc/hosts line to temporarily point your browser to the locally running nginx instance:
    • eg 127.0.0.1 saveourfaves.org

At this point you should have a running Django instance on localhost:8000. You should then create at least one Area object (for example, in the Bay Area, that represents SF vs East Bay vs South Bay), a few Neighborhood objects inside each Area, and then add some Places to each Neighborhood. Once you’ve done all of that, you can run:

# log into the Docker container running Django
docker exec -it <name of Django container> /bin/bash
cd /usr/local/site
python scripts/dump_neighborhoods.py Neighborhoods.js
python scripts/dump_places.py Places.js

At that point, you can copy the Neighborhoods.js and Places.js files into the saveourfaves-frontend repository; use them to overwrite the ones in src/CityData/. You’ll also want to update src/CityData/Areas.js with information about your areas.

saveourfaves-server's People

Contributors

mikeyk avatar

Watchers

James Cloos 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.