This project is a web-based dashboard that displays various types of charts using data from a Django backend and a Next.js frontend.
- Interactive dashboard with multiple chart types:
- Candlestick Chart
- Line Chart
- Bar Chart
- Pie Chart
- Dropdown menu to select different chart types
- RESTful API backend providing data for charts
- Client-Side Rendering (CSR) for dynamic data fetching and rendering
- Django
- Django Rest Framework
- django-cors-headers
- Next.js 13 (App Router)
- React
- Recharts for charting
- Client-Side Rendering (CSR) approach
- The frontend uses Client-Side Rendering (CSR) instead of Server-Side Rendering (SSR).
- Data is fetched dynamically on the client side using React hooks (useState and useEffect).
- This approach allows for real-time updates and interactive chart selection without page reloads.
-
Navigate to the backend directory:
cd backend
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- Windows:
venv\Scripts\activate
- macOS/Linux:
source venv/bin/activate
- Windows:
-
Install required packages:
pip install django djangorestframework django-cors-headers
-
Run migrations:
python manage.py migrate
-
Start the Django server:
python manage.py runserver 8888
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
- Ensure both backend and frontend servers are running.
- Open a web browser and go to
http://localhost:3000
(or the port specified by Next.js). - Use the dropdown menu to switch between different chart types.
- The charts will load dynamically on the client side as you select different options.
- Candlestick Data:
http://localhost:8080/api/candlestick-data/
- Line Chart Data:
http://localhost:8080/api/line-chart-data/
- Bar Chart Data:
http://localhost:8080/api/bar-chart-data/
- Pie Chart Data:
http://localhost:8080/api/pie-chart-data/
[Include guidelines for contributing to your project]
[Specify the license under which your project is released]