GitHub Repositories
This section lists my public GitHub repositories. It includes personal experiments, continuous learning projects and open-source work that reflects my technical growth.
This section lists my public GitHub repositories. It includes personal experiments, continuous learning projects and open-source work that reflects my technical growth.
Languages
Topics
A RESTful API built with Node.js, Express, and TypeScript to track your video game collection and backlog. Features clean layered architecture, Swagger documentation, and Joi validation.
Languages
Topics
A RESTful API for tracking your video game collection and backlog, built with Node.js, Express, and TypeScript.
Based on this awesome repository by Marcio Zabeu. Created with love (and knowledge).
backlog, playing, completed| Technology | Purpose |
|---|---|
| Node.js | Runtime environment |
| Express 5 | Web framework |
| TypeScript | Type-safe JavaScript |
| Sequelize | ORM for database operations |
| PostgreSQL | Relational database |
| Joi | Request validation |
| Swagger | API documentation |
| Docker | Database containerization |
game-tracker-api/
├── postgresql/
│ └── compose.yaml # Docker Compose for PostgreSQL
├── src/
│ ├── app.ts # Express application setup
│ ├── server.ts # Server entry point
│ ├── config/
│ │ ├── database.ts # Sequelize database configuration
│ │ ├── env.ts # Environment variables
│ │ └── swagger.ts # Swagger documentation setup
│ ├── controllers/
│ │ └── game/ # Game controller (request handling)
│ ├── docs/
│ │ └── game.docs.yaml # OpenAPI/Swagger documentation
│ ├── helpers/
│ │ └── apiError.ts # Custom API error handler
│ ├── middlewares/
│ │ ├── error.ts # Global error middleware
│ │ ├── logger.ts # Request logger middleware
│ │ └── validation/ # Validation middlewares (body, param, query)
│ ├── repositories/
│ │ └── game/ # Game data access layer
│ ├── routes/
│ │ └── game/ # Game routes definition
│ ├── schemas/
│ │ └── game/ # Joi validation schemas
│ ├── services/
│ │ └── game/ # Business logic layer
│ └── types/
│ └── game/ # TypeScript type definitions
├── package.json
├── tsconfig.json
└── README.md
git clone https://github.com/your-username/game-tracker-api.git
cd game-tracker-api
npm install
cd postgresql
docker compose up -d
This will start a PostgreSQL container with:
game_tracker_dbadminadmin1235432Create a .env file in the root directory:
PORT=3000
NODE_ENV=development
# Database
DB_HOST=localhost
DB_PORT=5432
DB_NAME=game_tracker_db
DB_USERNAME=admin
DB_PASSWORD=admin123
npm run dev
The server will start on http://localhost:3000 with hot-reload enabled.
Open your browser and navigate to: http://localhost:3000/api-docs
| Method | Endpoint | Description |
|---|---|---|
GET | /games | Get all games |
POST | /games | Add a new game |
DELETE | /games/:id | Delete a game by ID |
GET | /games/search | Search games with filters |
PATCH | /games/:id/status | Update game status |
POST /games
Content-Type: application/json
{
"title": "Super Mario World",
"year": 1990,
"platform": "SNES",
"genre": ["Platformer", "Adventure"],
"status": "backlog"
}
GET /games/search?platform=SNES&status=playing
PATCH /games/:id/status
Content-Type: application/json
{
"status": "completed"
}
| Status | Description |
|---|---|
backlog | Games you own but haven't started |
playing | Games you're currently playing |
completed | Games you've finished |
NESSNESMega DriveGameboyPS1N64| Variable | Description | Default |
|-|-||
| PORT | Server port | 3000 |
| NODE_ENV | Environment mode | local |
| DB_HOST | PostgreSQL host | localhost |
| DB_PORT | PostgreSQL port | 5432 |
| DB_NAME | Database name | - |
| DB_USERNAME | Database user | - |
| DB_PASSWORD | Database password | - |
Interactive API documentation is available via Swagger UI at /api-docs when running in development mode.
You can also access the raw OpenAPI specification at /docs.json.
The project follows a layered architecture pattern:
┌─────────────────────────────────────────────────────┐
│ Routes │
│ (Define endpoints & middlewares) │
└─────────────────────┬───────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ Controllers │
│ (Handle HTTP requests/responses) │
└─────────────────────┬───────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ Services │
│ (Business logic & validation) │
└─────────────────────┬───────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ Repositories │
│ (Data access layer) │
└─────────────────────────────────────────────────────┘
GET /games/:id)PUT /games/:id)Leonardo Silvatti