A modern full-stack application for displaying data through interactive charts and dashboards.
This monorepo contains:
- Backend: FastAPI server (
/backend
) - Provides REST API endpoints for data - Frontend: Next.js application (
/frontend
) - Interactive dashboard with Tremor charts
- Python 3.9+
- Node.js 18+
- pnpm (recommended) or npm
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
The API will be available at http://localhost:8000
- API docs:
http://localhost:8000/docs
- Alternative docs:
http://localhost:8000/redoc
cd frontend
pnpm install
pnpm dev
The frontend will be available at http://localhost:3000
- RESTful API with FastAPI
- CORS enabled for frontend integration
- Swagger/OpenAPI documentation
- Sample data endpoints for charts
- Structured data models with Pydantic
- Modern Next.js 14 with TypeScript
- Tremor UI components for charts and dashboards
- Responsive design with Tailwind CSS
- Real-time data fetching from API
- Interactive chart components
- FastAPI - Modern Python web framework
- Pydantic - Data validation and serialization
- Uvicorn - ASGI server
- Next.js 14 - React framework
- TypeScript - Type safety
- Tremor - Chart and dashboard components
- Tailwind CSS - Styling
- Radix UI - Accessible primitives
cpgrams-trends/
├── backend/ # FastAPI server
│ ├── app/
│ │ ├── main.py # FastAPI application
│ │ ├── models/ # Pydantic models
│ │ ├── routers/ # API route handlers
│ │ └── services/ # Business logic
│ ├── requirements.txt # Python dependencies
│ └── README.md # Backend documentation
├── frontend/ # Next.js application
│ ├── src/
│ │ ├── app/ # App router pages
│ │ ├── components/ # React components
│ │ ├── lib/ # Utilities and configurations
│ │ └── types/ # TypeScript definitions
│ ├── package.json # Node.js dependencies
│ └── README.md # Frontend documentation
└── README.md # This file
For development, you'll need to run both services:
-
Terminal 1 - Backend:
cd backend && source venv/bin/activate && uvicorn app.main:app --reload
-
Terminal 2 - Frontend:
cd frontend && pnpm dev
The backend provides the following endpoints:
GET /api/health
- Health checkGET /api/charts/sales
- Sales data for chartsGET /api/charts/performance
- Performance metricsGET /api/charts/analytics
- Analytics dashboard data
Using Tremor components, the frontend supports:
- Area Charts
- Bar Charts
- Line Charts
- Donut Charts
- KPI Cards
- Data Tables
- Sparklines
- Fork the repository
- Create a feature branch
- Make your changes
- Test both backend and frontend
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.