A full-stack cryptocurrency project built with React (frontend) and Python Flask (backend).
Before you begin, ensure you have the following installed:
- Node.js (v16 or higher)
- Python 3.12
- Poetry (Python package manager)
- Redis server (for session management)
my-crypto-bank/
├── frontend/ # React application
│ ├── src/ # React source files
│ ├── public/ # Static files
│ └── package.json # Frontend dependencies
└── backend/ # Flask API server
├── controllers/ # Route handlers
├── models/ # Database models
├── main.py # Application entry point
├── config.py # Configuration settings
└── pyproject.toml # Backend dependencies
- Navigate to the backend directory:
cd backend
- Install dependencies using Poetry:
poetry install
- Create a
.env
file in the backend directory with the following variables:
SECRET_KEY=your_secret_key_here
JWT_SECRET_KEY=your_jwt_secret_key_here
FLASK_APP=main.py
FLASK_ENV=development
REDIS_URL=redis://localhost:6379
- Initialize the database:
poetry run python main.py init
- Start the Flask server:
poetry run python main.py run
The backend includes several CLI commands for management:
python main.py run [--debug] [--port PORT]
- Start the serverpython main.py init
- Initialize the databasepython main.py wipe
- Wipe the databasepython main.py --help
- Show help message
- Navigate to the frontend directory:
cd frontend
- Install dependencies:
npm install
- Start the development server:
npm start
The React application will start at http://localhost:3000
The backend provides several API endpoints:
/auth/*
- Authentication routes/crypto/*
- Cryptocurrency-related operations/transaction/*
- Transaction management/account/*
- Account management
- React 17
- React Router DOM v6
- Axios for API requests
- Chart.js for data visualization
- Moment.js for date handling
- Flask with async support
- Flask-SQLAlchemy for database management
- Flask-JWT-Extended for authentication
- Redis for session management
- Flask-CORS for handling cross-origin requests
- Flask-Mail for email functionality
- Flask-Marshmallow for serialization
- CLI interface for database management
- JWT authentication
- Session management with Redis
- CORS support
- Email functionality
- Database ORM with SQLAlchemy
- Modern React with hooks
- Chart visualization
- Responsive design
- Route protection
- API integration
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
-
Redis Connection:
- Ensure Redis server is running locally
- Check Redis connection URL in
.env
-
Database Issues:
- Run
python main.py init
to initialize the database - Use
python main.py wipe
to reset if needed
- Run
-
Frontend API Connection:
- Verify backend is running on correct port
- Check CORS settings if experiencing connection issues