Skip to content

saladuit/Crypto_Wallets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crypto_wallet_checker

Website preview

Coverage Status CI

Live Demo · Backend API

A demo full-stack app that mocks interactions with a crypto-wallet API/store for demonstration purposes.

Project Structure

  • backend/ — FastAPI app, DB layer, CRUD, models, routes, and tests.
  • frontend/ — React app.

Inside backend/:

  • crud/ — high-level DB operations used by routes/services.
  • db/ — SQLAlchemy DB definitions and helpers.
  • models/ — Pydantic/ORM models
  • routes/ — FastAPI route handlers.
  • services/ — business logic and external API wrapper(s).
  • app.py — FastAPI application and route registration.

Setup

  1. Create and activate a Python venv and install backend deps:
python3 -m venv backend/.venv
source backend/.venv/bin/activate
pip install -r backend/requirements.txt
  1. Start the backend:
uvicorn backend.app:app --reload --port 8000
  1. Start the frontend:
cd frontend
npm install
npm run dev

Usage

  • Visit http://localhost:8000/wallets to get to show stored wallets.
  • Visit http://localhost:8000/docs for interactive API docs.

Tests

  • Run tests from the project root:
pytest -q --cov --cov-branch --cov-report=html

Test setup notes backend/tests/conftest.py configures an in-memory SQLite database for tests using:

  • SQLALCHEMY_DATABASE_URL = "sqlite:///:memory:" with connect_args={"check_same_thread": False} and poolclass=StaticPool so the same in-memory DB is accessible across threads/connections.
  • The fixture creates the schema once for the test session (Base.metadata.create_all(bind=engine)), yields, then drops it at teardown.
  • The client fixture overrides the app's get_db dependency so route handlers in tests use the test session.

Deployment (Render)

  • Live: https://crypto-wallets-frontend.onrender.com/ (frontend) and https://crypto-wallets.onrender.com/ (backend).

  • Quick note: both services are hosted on Render's free tier. Free instances sleep after inactivity, so the first request after a sleep can take a long time (+/- 50 seconds) while the instance wakes. Because the frontend needs the backend, you may see failed requests until the API is awake.

About

Small demo project to demonstrate using FastAPI and React

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors