This is a NestJS-based API designed to manage portfolio projects. The API is built using modern web technologies such as GraphQL and TypeORM, and it is integrated with SQLite for the database. The goal is to provide a backend for managing project information, including name, description, images, and project links. The API is designed for portfolio websites, making it easier to manage projects dynamically.
- NestJS: A progressive Node.js framework for building efficient and scalable server-side applications.
- GraphQL: For handling queries and mutations, providing a flexible way to interact with the API.
- TypeORM: An ORM for TypeScript and JavaScript that allows you to work with databases.
- SQLite: A lightweight SQL database used for data storage.
- Apollo Server: Integrated with GraphQL to handle the server-side logic.
- TypeScript: A strongly typed programming language that builds on JavaScript.
@apollo/server
: ^4.11.0@nestjs/apollo
: ^12.2.0@nestjs/common
: ^10.0.0@nestjs/core
: ^10.0.0@nestjs/graphql
: ^12.2.0@nestjs/platform-express
: ^10.0.0@nestjs/typeorm
: ^10.0.2apollo-server-express
: ^3.13.0graphql
: ^16.9.0reflect-metadata
: ^0.2.0rxjs
: ^7.8.1sqlite3
: ^5.1.7typeorm
: ^0.3.20
@nestjs/cli
: ^10.0.0@nestjs/schematics
: ^10.0.0@nestjs/testing
: ^10.0.0@types/express
: ^4.17.17@types/graphql
: ^14.5.0@types/jest
: ^29.5.2@types/node
: ^22.5.1@types/supertest
: ^6.0.0@typescript-eslint/eslint-plugin
: ^8.0.0@typescript-eslint/parser
: ^8.0.0eslint
: ^8.42.0eslint-config-prettier
: ^9.0.0eslint-plugin-prettier
: ^5.0.0jest
: ^29.5.0prettier
: ^3.0.0source-map-support
: ^0.5.21supertest
: ^7.0.0ts-jest
: ^29.1.0ts-loader
: ^9.4.3ts-node
: ^10.9.1tsconfig-paths
: ^4.2.0typescript
: ^5.1.3
- Manage projects dynamically with GraphQL.
- Store project information, including images, descriptions, and links.
- Utilize SQLite for local data storage.
- Easily extendable to other databases via TypeORM.
- Node.js: Ensure you have Node.js installed. You can download it here.
- npm or yarn: Make sure you have either npm or yarn installed for package management.
-
Clone the repository:
git clone https://github.com/yourusername/portfolio-api.git cd portfolio-api
-
Install dependencies:
Using npm:
npm install
Using yarn:
yarn install
To run the API in development mode with hot-reload:
npm run start:dev
or using yarn:
yarn start:dev
To build and run the API in production:
npm run build
npm run start:prod
or using yarn:
yarn build
yarn start:prod
To run the unit tests:
npm run test
For end-to-end tests:
npm run test:e2e
To watch tests during development:
npm run test:watch
The API exposes several GraphQL endpoints for managing projects.
To explore the API via GraphQL Playground, after running the server, open:
http://localhost:3000/graphql
You can test queries and mutations such as adding new projects, fetching existing ones, and more.
The project follows a typical NestJS structure with modules, controllers, and services.
src/
├── app.module.ts # Main application module
├── main.ts # Application entry point
├── projects/ # Project-related modules, services, and entities
│ ├── project.entity.ts # Project entity (ORM)
│ ├── projects.module.ts # Project module
│ ├── projects.resolver.ts # GraphQL resolver
│ ├── projects.service.ts # Project service
└── ...
This project is licensed under UNLICENSED. See the LICENSE file for more details.
Feel free to contribute to this project by submitting issues or pull requests. If you have any questions, feel free to contact me!