CMC stands for Crypto Market Companion and uses the CoinMarketCap API to display cryptocurrency data.
A small full-stack cryptocurrency viewer built with FastAPI on the backend and React + Vite + Tailwind CSS + Ant Design on the frontend.
The application loads cryptocurrency data from the CoinMarketCap API and displays selected currency details in a card view.
Dark mode dashboard with cryptocurrency list, theme switcher, and detailed currency card.
- View a list of cryptocurrencies in the sidebar
- Click a currency to see detailed information
- Backend built with FastAPI
- Frontend built with React, Vite, Tailwind CSS, and Ant Design
- Run the full project with a single command
CMC/
├── backend/
│ ├── requirements.txt
│ └── src/
│ ├── config.py
│ ├── http_client.py
│ ├── init.py
│ ├── main.py
│ └── router.py
├── frontend/
│ ├── src/
│ ├── package.json
│ ├── vite.config.js
│ └── ...
├── .env.example
├── .gitignore
├── package.json
└── README.md
Before running the project, make sure you have installed:
- Python 3.10 or newer
- Node.js
- npm
Check installed versions:
python3 --version
node -v
npm -vgit clone <your-repository-url>
cd CMCCreate and activate a virtual environment.
python3 -m venv venv310
source venv310/bin/activatepython -m venv venv310
venv310\Scripts\Activate.ps1With the virtual environment activated, run:
pip install -r backend/requirements.txtFrom the project root, run:
cd frontend
npm install
cd ..To run this project, you need a CoinMarketCap API key.
You can register and get a free API key here:
https://coinmarketcap.com/api/
After registration, create a file named .env inside the backend folder:
backend/.env
Add your API key like this:
CMC_API_KEY=your_real_coinmarketcap_api_key_hereA template file is already included in the project:
.env.example
From the project root, run:
npm install
npm run devThis starts both services:
- Backend:
http://127.0.0.1:8000 - Frontend:
http://localhost:5173
Open the frontend in your browser:
http://localhost:5173
Optional backend checks:
http://127.0.0.1:8000/
http://127.0.0.1:8000/docs
/returns a simple API status message/docsopens FastAPI Swagger UI
- The frontend sends requests through the Vite proxy using
/api/... - Vite forwards these requests to the FastAPI backend
- The backend requests cryptocurrency data from the CoinMarketCap API
- The frontend displays the selected cryptocurrency in a card component
- React
- Vite
- Tailwind CSS
- Ant Design
- Axios
- FastAPI
- Uvicorn
- aiohttp
- async-lru
- pydantic-settings
- python-dotenv
Make sure you are in the project root and that the root package.json file exists.
Make sure:
- your virtual environment is activated
- backend dependencies are installed
- your
.envfile exists insidebackend
Check that:
- the backend is running
backend/.envexistsCMC_API_KEYis valid
Stop the process currently using the port or change the port settings.
Make sure frontend dependencies are installed and restart the Vite development server.
Do not commit your real .env file to GitHub.
Your real API key must stay only in:
backend/.env
The .env.example file should contain only a placeholder value.
