This repository hosts the complete source code for solar panel and charging recommendations for Tesla, encompassing both backend and frontend components.
The backend code is developed using Python 3.11 and is intended to serve as the server-side for the Tesla project.
- Python 3.11
- Docker (for Docker-specific commands, optional)
-
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
-
Windows:
python -m venv myenv myenv\Scripts\activate
-
macOS and Linux:
python -m venv myenv source myenv/bin/activate
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
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