This guide provides detailed instructions for setting up a local development environment for the Devoby waste management application.
Before you begin, ensure you have the following installed on your system:
- Node.js: Version 18.x or later
- npm or yarn: For package management
- Git: For version control
```bash git clone https://github.com/yourusername/devoby.git cd devoby ```
```bash
npm install
yarn install ```
Create a .env.local file in the root directory with the following variables:
```
FIREBASE_API_KEY=your_firebase_api_key FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain FIREBASE_PROJECT_ID=your_firebase_project_id FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket FIREBASE_MESSAGING_SENDER_ID=your_firebase_messaging_sender_id FIREBASE_APP_ID=your_firebase_app_id
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_google_maps_api_key
MTN_MOBILE_MONEY_API_KEY=your_mtn_api_key ORANGE_MONEY_API_KEY=your_orange_api_key ```
-
Firebase Configuration:
- Create a project in the Firebase Console
- Go to Project Settings > General > Your Apps
- Register a web app and copy the configuration values
-
Google Maps API Key:
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable the Maps JavaScript API, Geocoding API, and Directions API
- Create an API key and copy it
```bash
npm run dev
yarn dev ```
The application will be available at http://localhost:3000.
- Open your browser and navigate to http://localhost:3000
- Test the authentication flow by signing up or logging in
- Explore the dashboard and test the waste collection request flow
- Test the collector discovery and booking process
```bash
npm run lint
npm run format ```
To create a production build locally:
```bash
npm run build npm start
yarn build yarn start ```
Symptom: Maps not loading or Firebase authentication failing
Solution:
- Verify that your API keys are correctly set in the
.env.localfile - Ensure that the APIs are enabled in the Google Cloud Console
- Check that your Firebase project has the Authentication service enabled
Symptom: Error message about port 3000 being in use
Solution:
- Kill the process using port 3000:
npx kill-port 3000 - Or start the server on a different port:
npm run dev -- -p 3001
Symptom: Unexpected errors during installation or startup
Solution:
- Verify your Node.js version:
node -v - Use nvm to install the correct version:
nvm install 18andnvm use 18
Symptom: Module not found errors
Solution:
- Delete the
node_modulesfolder and reinstall dependencies - Ensure you're using the correct package manager (npm or yarn) consistently
After setting up your local development environment, you might want to:
- Customize the application theme (see Theming Guide)
- Implement additional features
- Set up continuous integration for testing
- Deploy to a production environment (see Vercel Deployment Guide or Docker Deployment Guide)