🚀 Crypto Price Tracker - Setup Guide
This guide explains how to set up and run the Crypto Price Tracker on a different computer after cloning it from GitHub.
📌 1️⃣ Clone the Repository
To use this project on a different computer, first clone the repository:
git clone https://github.com/ertnbrk/crypto-tracker.git
cd crypto-tracker
📌 2️⃣ Set Up & Run Next.js Web App
- Navigate to the Next.js web application:
cd web-app
- Install the required dependencies:
npm install
- Start the development server:
npm run dev
- Open the web app in your browser:
http://localhost:3000
📌 3️⃣ Set Up & Run Docusaurus Documentation
- Navigate to the documentation folder:
cd ../docs
- Install the required dependencies:
npm install
- Start the documentation server:
npm run start
- Open the documentation in your browser:
http://localhost:3001
📌 4️⃣ Troubleshooting (Common Issues & Solutions)
🔹 Issue: Missing Dependencies
Error: Module not found
Solution: Run:
npm install
to install the required packages.
🔹 Issue: API Data Not Fetching
Error: No data is displayed after running the app.
Solution:
- Check your internet connection.
- Verify that CoinGecko API is online by testing this link in your browser:
https://api.coingecko.com/api/v3/ping
🔹 Issue: Port Already in Use
Error: Address already in use (Port 3000 or 3001 is occupied).
Solution: Start the servers on different ports:
PORT=4000 npm run dev
PORT=4001 npm run start
Then open:
- Web app:
http://localhost:4000
- Docs:
http://localhost:4001
📌 5️⃣ Running the Project in Production Mode
If you want to run the project in production mode, use the following commands:
Next.js Production Build
cd web-app
npm run build
npm start
This will start the optimized Next.js application.
Docusaurus Production Build
cd ../docs
npm run build
npm run serve
This will generate the documentation static files and serve them.
📌 6️⃣ Deployment Instructions
Deploying the Next.js App to Vercel
If you want to deploy the web app online, use Vercel:
vercel --prod
Or manually deploy using the Vercel Dashboard.
Deploying the Docusaurus Documentation to GitHub Pages
- Build the static documentation:
cd docs
npm run build
- Deploy it to GitHub Pages:
npm run serve
Now, your documentation will be accessible online.
📌 7️⃣ Project Folder Structure
Ensure your project is structured correctly:
/crypto-tracker
│
├── /web-app # Next.js app (Crypto Tracker)
│ ├── /src
│ ├── /pages
│ ├── /utils
│ ├── package.json
│ ├── next.config.js
│ ├── README.md
│
├── /docs # Docusaurus documentation
│ ├── /docs
│ │ ├── how-to-run.md
│ │ ├── api-details.md
│ │ ├── state-management.md
│ │ ├── challenges.md
│ ├── sidebars.js
│ ├── docusaurus.config.js
│ ├── README.md
│
├── .gitignore
├── README.md