Skip to content

mdshohelrana/django-react-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GUI of Production data of solar panel and charging recommendations for Tesla

This repository hosts the complete source code for solar panel and charging recommendations for Tesla, encompassing both backend and frontend components.

Backend Setup

Overview

The backend code is developed using Python 3.11 and is intended to serve as the server-side for the Tesla project.

Prerequisites

  • Python 3.11
  • Docker (for Docker-specific commands, optional)

Setup Instructions

Creating a Virtual Environment

  • Windows:

    python -m venv myenv
    myenv\Scripts\activate
  • macOS and Linux:

    python -m venv myenv
    source myenv/bin/activate
  • Installing Dependencies:

    python -m venv myenv
    cd server
    pip install -r requirements.txt
  • Running the Application:

    python manage.py runserver

Deactivating the Virtual Environment

  • Windows:

    python -m venv myenv
    myenv\Scripts\activate
  • macOS and Linux:

    python -m venv myenv
    source myenv/bin/activate

Frontend Setup

Overview

The frontend is designed for the web development part of the Tesla project using modern JavaScript frameworks and libraries.

  • Installing Dependencies:

    cd client
    yarn install
  • Start the Development Server:

yarn dev  # or yarn dev, pnpm dev, bun dev
Open http://localhost:3006 with your browser to see the result.
  • Docker and Database Configuration:
  • Docker Commands:
  • Pull the latest code from the main branch.
  • Start the application and services:
docker-compose up --build
  • Application Access:
Application URL: http://localhost:3006/
Admin Panel URL: http://localhost:8000/admin/
  • Connect to PgAdmin:
URL: http://localhost:5050/

Credentials:
Email: admin@admin.com
Password: admin

Database User: shohelrana

Useful Docker Commands

docker-compose exec backend python manage.py generate_fake_data
docker-compose exec backend python manage.py createsuperuser
docker-compose exec db psql -U shohelrana -d solar

# To clear Docker completely
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker rmi $(docker images -q) -f
docker volume rm $(docker volume ls -q)

# Alternatively, to clean up
docker system prune
docker system prune -a --volumes