GithubHelp home page GithubHelp logo

solar-energy-system-backend's Introduction

Solar energy calculation system

Backend part of solar energy calculation system

Pre-installed requirements

  • Python >= 3.11
  • Poetry
  • Docker (If you don't want to install project's infrastructure direct on yours PC)
  • MongoDB
  • PostgreSQL

Development environment

Project infrastructure

  1. Set environment variables for development environment as shown in "Development environment settings" in example.env file
  2. Deploy project infrastructure with docker compose docker compose --file docker-compose.dev.yml up -d

Project environment for development

  1. Install python dependencies: poetry install
  2. If you do not use poetry, you can install dependencies from requirements.txt: pip install -r requirements.txt
  3. Create .env file with environment variables. You can find example in example.env file.
  4. Load environment variables from .env file export $(cat .env | xargs) (remove all comments in file before)
  5. Update database state by using tortoise ORM aerich migration tool: aerich upgrade
  6. Run the run.py script, which will start the uvicorn web server: poetry run python run.py or if you use Python without poetry: python run.py

Project environment for production

  1. Make sure that you have deployed infrastructure, namely:
  • MongoDB
  • PostgreSQL

You can deploy it with docker compose (see section Project infrastructure)

If you use infrastructure for project from docker-compose.dev.yml file then you need to set your DB_IP environment variable as name of the container for example: DB_IP=solar-energy-system-backend_solar_energy_system_pg_1 and the same for MongoDB IP: MONGO_IP=mongo

  1. Deploy docker container with web server: docker compose --file docker-compose.prod.yml up -d --build

solar-energy-system-backend's People

Contributors

levakuz avatar stepanetsanton avatar

Watchers

 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.