In this section, you'll fork the repository, clone it to your machine, and set up your development environment.
- Go to the repository on GitHub
- Click the Fork button in the top-right corner
- Select your GitHub account as the destination
- Wait for the fork to complete
You now have your own copy of the repository under your GitHub account.
- Open your terminal
- Run the following command (replace
YOUR-USERNAMEwith your GitHub username):
git clone https://github.com/YOUR-USERNAME/inter-workshop.git- Navigate into the project folder:
cd inter-workshop- Create a new branch using the format
lastname/pokedex-pull-request:
git checkout -b dela-cruz/pokedex-pull-request- Replace
dela-cruzwith your actual last name (use lowercase and hyphens for spaces)
| Your Name | Branch Name |
|---|---|
| Juan Dela Cruz | dela-cruz/pokedex-pull-request |
| Maria Santos | santos/pokedex-pull-request |
| John Smith | smith/pokedex-pull-request |
- Run the following command to install all packages:
npm install- Wait for the installation to complete
This reads package.json and installs all required packages into node_modules/.
Production Dependencies:
| Package | Purpose |
|---|---|
express |
Web framework for handling HTTP requests |
ejs |
Template engine for rendering HTML |
axios |
HTTP client for API requests |
dotenv |
Load environment variables from .env file |
Development Dependencies:
| Package | Purpose |
|---|---|
nodemon |
Auto-restart server on file changes |
jest |
Testing framework |
supertest |
HTTP testing library |
eslint |
Code linting (find errors/issues) |
prettier |
Code formatting |
- Copy the example environment file:
Mac/Linux:
cp .env.example .envWindows (Command Prompt):
copy .env.example .envWindows (PowerShell):
Copy-Item .env.example .env- The
.envfile now contains:
PORT=3000
NODE_ENV=development
POKEAPI_BASE_URL=https://pokeapi.co/api/v2
DEFAULT_PAGE_LIMIT=20
MAX_SEARCH_LIMIT=1000- Create the directories for your application code:
Mac/Linux:
mkdir -p src/config src/routes src/controllers src/services src/repositories src/views/partials public/cssWindows (Command Prompt):
mkdir src\config src\routes src\controllers src\services src\repositories src\views\partials public\cssWindows (PowerShell):
mkdir src/config, src/routes, src/controllers, src/services, src/repositories, src/views/partials, public/css- Verify your project structure looks like this:
inter-workshop/
├── .github/ # CI/CD workflow (pre-configured)
├── docs/ # Documentation
│ └── guide/ # This tutorial
├── public/ # Static assets (you created this)
│ └── css/
├── src/ # Your application code (you created this)
│ ├── config/
│ ├── controllers/
│ ├── repositories/
│ ├── routes/
│ ├── services/
│ └── views/
│ └── partials/
├── tests/ # Test files (pre-configured)
├── .env # Your environment variables
├── .env.example
├── .gitignore
├── .prettierrc
├── eslint.config.js
├── jest.config.js
├── package.json
└── package-lock.json
- Check Node.js is installed:
node --version- Check npm packages are installed:
npm list --depth=0- Check you're on your branch:
git branchYou should see your branch name highlighted (e.g., * dela-cruz/pokedex-pull-request).
The package.json is already configured with these scripts:
| Script | Command | Description |
|---|---|---|
start |
npm start |
Run the app in production |
dev |
npm run dev |
Run with auto-reload (development) |
test |
npm test |
Run tests with coverage report |
lint |
npm run lint |
Check code for errors |
lint:fix |
npm run lint:fix |
Auto-fix linting errors |
format |
npm run format |
Format code with Prettier |
format:check |
npm run format:check |
Check if code is formatted |
Note: You don't need to modify
package.json. Everything is already set up for you.
- Stage all your changes:
git add .- Commit with the conventional format:
git commit -m "chore: set up project structure and environment
Full Name: Juan Dela Cruz
Umindanao: juan.delacruz@email.com"- Replace the name and email with your own information
Your development environment is ready! In the next section, we'll learn about the architecture pattern we're using.