Development Setup Guide
This guide will help you set up your local development environment for the ChainMove platform.
Prerequisites
- Node.js 18.0.0 or later
- npm 9.0.0 or later (comes with Node.js)
- Git
- PostgreSQL 14+
- MetaMask browser extension (for Web3 functionality)
Getting Started
-
Clone the repository
git clone https://github.com/Obaijulu-gif/chain_move.git
cd chain_move -
Install dependencies
npm install
-
Set up environment variables Create a
.env.local
file in the root directory and add the following variables:DATABASE_URL="postgresql://user:password@localhost:5432/chainmove?schema=public"
NEXTAUTH_SECRET=your-secret-key
NEXTAUTH_URL=http://localhost:3000 -
Set up the database
npx prisma migrate dev --name init
npx prisma generate -
Start the development server
npm run dev
The application will be available at http://localhost:3000
Available Scripts
npm run dev
- Start development servernpm run build
- Build for productionnpm start
- Start production servernpm run lint
- Run ESLintnpm run test
- Run testsnpm run type-check
- Check TypeScript types
Development Workflow
-
Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name
-
Make your changes and commit them:
git add .
git commit -m "feat: add new feature" -
Push your changes and create a pull request
Testing
Run the test suite:
npm test
Debugging
- Use
console.log()
for quick debugging - For more advanced debugging, use the VS Code debugger configuration provided in
.vscode/launch.json
Code Style
- Follow the existing code style
- Use Prettier for code formatting
- Follow TypeScript best practices
- Write meaningful commit messages following Conventional Commits
Documentation
Update relevant documentation when making changes to:
- Component props and behavior
- API endpoints
- Environment variables
- Database schema