Coder Social home page Coder Social logo

arbeuerman / climateconnect Goto Github PK

View Code? Open in Web Editor NEW

This project forked from climateconnect/climateconnect

0.0 0.0 0.0 13.47 MB

Global climate action web-platform

Home Page: https://climateconnect.earth/

License: GNU Affero General Public License v3.0

JavaScript 68.70% Python 31.30%

climateconnect's Introduction

Climate Connect

The code for https://climateconnect.earth.

Pre-steps

  1. Create a local Postgres database with your own username and password. You will connect to this for your local backend project.
  2. Create 32 char random secret key for your local setup. Run openssl rand -base64 32. Copy the value you will be using this to add as SECRET_KEY for django settings.

Getting Started Locally

We are using Python/Django for backend and Next.js for frontend.

  1. Create a python virtual environment python3 -m venv climateconnect_env
  2. Run following commands to start virtual environment
       cd climateconnect_env
       source bin/activate
    
  3. Clone GitHub repository git clone <URL>

Run docker compose

Currently, we use docker to run Redis server locally.

If you do not have docker installed locally, follow the official steps: https://docs.docker.com/get-docker/

  1. Go to backend directory cd backend
  2. Run docker-compose up. This will start Redis server on docker

Backend

Once you clone the repository start backend server.

  1. Go to backend directory cd backend
  2. Run pip install -r requirements.txt to install all backend libararies.
  3. Create .backend_env to include backend environment variables. You can find upto date sample env variables in backend/local-env-setup.md file.
  4. Run python manage.py migrate to run django migrations. Note: This command is used for when you first start or whenever you are adding or updating database models.
  5. Run server using python manage.py runserver.
  6. If you want to run tests suite use this command: python manage.py test. If you want to run a specific test file or test class run this command: python manage.py test <file_path> or <file_path + class_name>

Frontend

  1. cd frontend
  2. Run yarn install to download all npm packages
  3. Add .env file for frontend environment variables. You can find which env variables you have to set in /frontend/next.config.js/
  4. Run yarn dev to start developing

To Deploy

Frontend

Option 1: GitHub Actions

  1. Use GitHub actions to push to a server. A deploy file can be found in .github/workflows

Option 2: Manually

  1. cd frontend
  2. yarn --production
  3. yarn build
  4. node server.js OR next start

Backend

  1. Make sure your ENVIRONMENT env variable is set to production
  2. Follow steps 1-5 of the "Getting started locally - backend" (above in this file)

climateconnect's People

Contributors

positiveimpact avatar evanhahn avatar ddhanesha avatar reecelangerock avatar susanchesnut avatar dependabot[bot] avatar willnjl avatar akshatashan avatar piperchester 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.