This project is a Crypto wallet for sending and recieving USDC and SOL payments using Circle Api developer controlled wallet
This project consists of two main parts: a React frontend application and a Node.js backend application. Each part is contained within its respective folder.
Ensure you have the following installed on your system:
- Node.js (v18 or later)
- npm (v8 or later)
- yarn (optional, but recommended for managing dependencies)
-
Navigate to the Node.js folder:
cd CircleWalletApi
-
Install the dependencies:
npm install
-
Create an
.env
file:In the root of the Node.js folder, create an
.env
file and add the necessary environment variables. Here is an example of what your.env
file might look like:GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET MONGODB_URI SESSION_SECRET='y3830974u39o09u3j9i2k0' CLIENT_URL=http://localhost:5000 CLIENT_URL_UI=http://localhost:5173 CIRCLE_KEY= ENTITY_SECRET= ```
- Getting the secrets
As for GOOGLE_CLIENT_ID
and GOOGLE_CLIENT_SECRET
, you will have to create a new app in the Google Cloud Console and create credentials for Google Auth 2.0, and also you will have to set googles callback url to
http://localhost:5000/auth/google/callback
As for CIRCLE_KEY
, you will have to create an api key at circle.com and as for ENTITY_SECRET
, you will have to generate it natively or at circle.com's documentation website and use it to generate an Entity Secret Ciphertext which will be registered at circle.com's configurator. see their docs for more info
and as for MONGODB_URI
, you will have to register a mongodb atlas account and get a database connection uri
The other secrets are already predefined above
-
Run the backend server:
node app
This will start the Node.js server on the port 5000.
-
Navigate to the React folder:
cd walletUI
-
Install the dependencies:
npm install
If you prefer using yarn:
yarn install
-
Run the frontend application:
npm run dev
Or, if you used yarn:
yarn start
This will start the React development server, typically on
http://localhost:5173
.
-
Ensure both the Node.js backend and the React frontend are running.
-
Open your browser and navigate to
http://localhost:5173
to access the React application.
The React application should now be able to communicate with the Node.js backend. If any issues arise, check the console output for both the frontend and backend for error messages and resolve them accordingly.
- Make sure your environment variables are correctly set in the
.env
file for the Node.js application. - If you encounter any issues with dependencies, try deleting the
node_modules
folder and thepackage-lock.json
file (oryarn.lock
if using yarn) in both folders, then reinstalling the dependencies. - For production deployment, consider using tools like Docker, PM2, or hosting services like Heroku, AWS, or Vercel.
Happy coding!