{"id":20675901,"url":"https://github.com/olha-dev-fullstack/nest-blog-api","last_synced_at":"2026-04-03T23:37:40.873Z","repository":{"id":260138349,"uuid":"879753452","full_name":"olha-dev-fullstack/nest-blog-api","owner":"olha-dev-fullstack","description":"NestJS Blog backend app for users to create posts, add tags and different properties to them","archived":false,"fork":false,"pushed_at":"2024-11-08T15:45:09.000Z","size":1773,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T18:52:33.357Z","etag":null,"topics":["aws-cloudfront","aws-ec2","aws-s3","compodoc","docker","google-auth","jest","mailtrap","mongodb","mongoose","nestjs","pm2","postgresql","swagger","typeorm"],"latest_commit_sha":null,"homepage":"http://ec2-63-176-53-21.eu-central-1.compute.amazonaws.com/api#/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olha-dev-fullstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-28T13:45:53.000Z","updated_at":"2024-11-08T15:45:12.000Z","dependencies_parsed_at":"2025-01-17T14:50:58.147Z","dependency_job_id":"e81821a0-8ebc-4f88-95c8-5aa42303f879","html_url":"https://github.com/olha-dev-fullstack/nest-blog-api","commit_stats":null,"previous_names":["olha-dev-fullstack/nest-blog-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/olha-dev-fullstack/nest-blog-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olha-dev-fullstack%2Fnest-blog-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olha-dev-fullstack%2Fnest-blog-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olha-dev-fullstack%2Fnest-blog-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olha-dev-fullstack%2Fnest-blog-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olha-dev-fullstack","download_url":"https://codeload.github.com/olha-dev-fullstack/nest-blog-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olha-dev-fullstack%2Fnest-blog-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263832458,"owners_count":23517348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-cloudfront","aws-ec2","aws-s3","compodoc","docker","google-auth","jest","mailtrap","mongodb","mongoose","nestjs","pm2","postgresql","swagger","typeorm"],"created_at":"2024-11-16T21:11:05.201Z","updated_at":"2025-12-30T20:06:40.884Z","avatar_url":"https://github.com/olha-dev-fullstack.png","language":"TypeScript","readme":"# Blog API\r\nThis is a blog backend API where users can authenticate, create posts with different meta options, create tags and add them to posts. Also it is possible to upload image files to the server (images will be saved to S3 bucket on Amazon). The project is built using NestJS, PostgeSQL, TypeORM. Alternatively there is a simplified version which uses MongoDB and Mongoose (available on separate branch). Authorization and authentication is implemented with JWT. It is also possible to authenticate using Google.\r\n\r\n## Features\r\n- **Posts Management**: Authorized users can create, update and delete posts. Also it is possible to fetch paginated posts in some dates range.\r\n- **Users Authentication**: After signing in user receives access and refresh tokens.\r\n- **User Account Management**: It is possible to create and update single user account and also create multiple users with one request.\r\n- **Meta Options**: Meta options is a special property which can be attached to the post. Meta options can be separately created.\r\n- **Tags**: Tags are also one of posts properties and should be created before adding to post.\r\n- **Upload images**: There is a possibility to upload image files to the server. As a response user receives a cloudfront url attached to the apploaded image.\r\n\r\n## Technologies\r\n### Development\r\n- **NestJS**: A progressive Node.js framework for building efficient and scalable server-side applications.\r\n- **PostgreSQL**: An open-source relational database known for its robustness, extensibility, and compliance with SQL standards.\r\n- **TypeORM**: An Object-Relational Mapping (ORM) library for TypeScript and JavaScript, supporting multiple databases.\r\n- **Docker**: A platform for developing, shipping, and running applications in isolated containers. Used for running database on local machine.\r\n- **Google Auth**: An authentication service by Google that allows secure user login with Google accounts.\r\n\r\n### Mail sending\r\n- **Mailtrap**: SMTP provider for sending welcome emails to newly created users\r\n\r\n### Files storage\r\n- **AWS S3**: A scalable storage service by Amazon Web Services for storing and retrieving any amount of data. Used for storing files.\r\n- **AWS CloudFront**: A content delivery network (CDN) by AWS that distributes content globally with low latency.\r\n\r\n### Alternative database\r\n- **MongoDB**: A NoSQL database known for its flexibility and scalability, storing data in JSON-like documents.\r\n- **Mongoose**: An Object Data Modeling (ODM) library for MongoDB and Node.js, providing schema-based data validation.\r\n\r\n### Deployment\r\n- **PM2**: A process manager for Node.js applications that simplifies deployment and management. Used for running deployed application on Amazon.\r\n- **AWS EC2**: A service by Amazon Web Services providing resizable compute capacity in the cloud.\r\n\r\n### Testing and documentation\r\n- **Jest**: A JavaScript testing framework for unit and integration testing with a focus on simplicity.\r\n- **Swagger**: A toolset for designing, building, documenting, and consuming RESTful APIs.\r\n- **Compodoc**: A documentation tool that generates static documentation from code.\r\n\r\n\r\n## How to run the project localy\r\n\r\n### 1. Clone the Repository\r\n\r\n```bash\r\ngit clone https://github.com/olha-dev-fullstack/nest-blog-api.git\r\ncd nest-blog-api\r\n```\r\n\r\n### 2. Install Dependencies\r\n\r\n```bash\r\nnpm install\r\n```\r\n\r\n### 3. Create `.env` files:\r\n\r\n- `.env.development` for developmet mode with next structure:\r\n\r\n```bash\r\nDB_HOST=localhost\r\nDB_PORT=5432\r\nDB_USER=\r\nDB_PASSWORD=\r\nDB_NAME=\r\nDB_SYNC=false\r\nDB_AUTOLOAD=true\r\n\r\n// randomly generated keys\r\nAPI_VERSION=\r\nPROFILE_API_KEY=\r\n\r\nJWT_SECRET=\r\nJWT_TOKEN_AUDIENCE=localhost:3000\r\nJWT_TOKEN_ISSUER=localhost:3000\r\nJWT_ACCESS_TOKEN_TTL=3600\r\nJWT_REFRESH_TOKEN_TTL=86400\r\n\r\nGOOGLE_CLIENT_ID=\r\nGOOGLE_CLIENT_SECRET=\r\n\r\nAWS_PUBLIC_BUCKET_NAME=\r\nAWS_REGION=\r\nAWS_CLOUDFRONT_URL=\r\nAWS_ACCESS_KEY_ID=\r\nAWS_SECRET_ACCESS_KEY=\r\n\r\n// Mailtrap credentials\r\nMAIL_HOST=\r\nSMTP_USERNAME=\r\nSMTP_PASSWORD=\r\n\r\nMONGO_DB_USERNAME=\r\nMONGO_DB_PASSWORD=\r\nMONGO_DB_NAME=\r\nMONGO_DB_CONNECTION_STRING=\r\n```\r\n\r\n- `.env.test` should be similatr to `env.development` to execute tests:\r\n\r\n- in production `.env` file will be used so it can be generated similarly to development one.\r\n\r\n### 3. Database Setup\r\nCreate `typeorm-cli.config.ts` file (you can use ``typeorm-cli.sample.config.ts` as an example) and set valid database_name\r\n\r\nRun migrations to create local database:\r\n\r\n```bash\r\nnpm run migration:run\r\n```\r\n\r\n### 5. Start the Server\r\n\r\nRun the NestJS server:\r\n\r\n- watch mode\r\n\r\n```bash\r\nnpm run start:dev\r\n```\r\n\r\n- dev mode\r\n\r\n```bash\r\nnpm run start\r\n```\r\n\r\n- production mode\r\n\r\n```bash\r\nnpm run start:prod\r\n```\r\n\r\nThe API will be available at `http://localhost:3000`.\r\n\r\n## API Endpoints\r\n\r\nSwagger documentation: http://ec2-63-176-53-21.eu-central-1.compute.amazonaws.com/api#/\r\n\r\n\r\n## Running Tests\r\n\r\nTo run unit tests, use:\r\n\r\n```bash\r\nnpm run test\r\n```\r\n\r\nTo run End-to-End tests, use:\r\n\r\n```bash\r\nnpm run test:e2e\r\n```\r\n\r\n## Generate documentation\r\n```bash\r\nnpm run doc\r\n```\r\nIt would be accessible on the port `3001`.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folha-dev-fullstack%2Fnest-blog-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folha-dev-fullstack%2Fnest-blog-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folha-dev-fullstack%2Fnest-blog-api/lists"}