{"id":17930985,"url":"https://github.com/olha-dev-fullstack/nest-cars-price-api","last_synced_at":"2026-05-08T13:37:11.568Z","repository":{"id":259488475,"uuid":"876658894","full_name":"olha-dev-fullstack/nest-cars-price-api","owner":"olha-dev-fullstack","description":"Simple NestJS REST used cars pricing API where users can authenticate, create reports about cars to sell and get price prediction","archived":false,"fork":false,"pushed_at":"2024-10-28T11:51:55.000Z","size":258,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-08T23:45:47.126Z","etag":null,"topics":["nestjs","sqlite","typeorm"],"latest_commit_sha":null,"homepage":"","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-22T10:49:25.000Z","updated_at":"2024-10-28T11:51:58.000Z","dependencies_parsed_at":"2024-10-25T23:50:27.393Z","dependency_job_id":"bf60f931-2ff6-423d-ad0f-737bb66de200","html_url":"https://github.com/olha-dev-fullstack/nest-cars-price-api","commit_stats":null,"previous_names":["olha-dev-fullstack/nest-cars-price-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olha-dev-fullstack%2Fnest-cars-price-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olha-dev-fullstack%2Fnest-cars-price-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olha-dev-fullstack%2Fnest-cars-price-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olha-dev-fullstack%2Fnest-cars-price-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-cars-price-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246982592,"owners_count":20864127,"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":["nestjs","sqlite","typeorm"],"created_at":"2024-10-28T21:18:55.399Z","updated_at":"2026-05-08T13:37:06.527Z","avatar_url":"https://github.com/olha-dev-fullstack.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cars price API\r\n\r\nThis is a simple REST used cars pricing API where users can authenticate, create reports about cars to sell and get price prediction. The project is built using NestJS, SQLite and TypeORM. Authorization and authentication works on sessions and cookies.\r\n\r\n## Features\r\n\r\n- **Reports Management**: Users can create and approve reports (approve only for users with admin permission).\r\n- **Authorization**: Is implemented using cookie session. After registration user receives token which is attached to cookie header for all following reports until user signs out\r\n- **User account management**: It is possible to create, update, delete and view user profile\r\n\r\n## Technologies\r\n\r\n- **NestJS**: A progressive Node.js framework for building efficient and scalable server-side applications.\r\n- **SQLite**: Simple and lightweight solution for local development to work with database.\r\n- **TypeORM**: An ORM used for database interaction and migrations.\r\n- **Jest**: Testing framework used for writing unit and integration tests.\r\n\r\n## How to run the project\r\n\r\n### 1. Clone the Repository\r\n\r\n```bash\r\ngit clone https://github.com/olha-dev-fullstack/nest-cars-price-api.git\r\ncd nest-cars-price-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- `dev.env` for developmet mode with next settings:\r\n\r\n```bash\r\nDB_NAME=db.sqlite\r\nCOOKIE_KEY=\u003cyour value\u003e\r\n```\r\n\r\n- `test.env` for running `e2e` tests:\r\n\r\n```bash\r\nDB_NAME=db.sqlite\r\nCOOKIE_KEY=\u003cyour value\u003e\r\n```\r\n\r\n- `production.env` (for production Postgres database is used):\r\n\r\n```bash\r\nDATABASE_URL=\u003curl to your database\u003e\r\nCOOKIE_KEY=\u003cyour value\u003e\r\n```\r\n\r\n### 3. Database Setup\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\n#### Authentication and Users\r\n\r\n- **POST** `/auth/signup`: User signup (created as admin by default)\r\n\r\n```json\r\n{\r\n  \"email\": \"test@test.com\",\r\n  \"password\": \"password\"\r\n}\r\n```\r\n\r\n- **GET** `/auth/:id`: Get authorized user profile (requires authentication)\r\n- **DELETE** `/auth/:id` Delete user\r\n- **PATCH** `/auth/:id` Update user (requires authentication)\r\n\r\n```json\r\n{\r\n  \"email\": \"test@test.com\",\r\n  \"password\": \"password\"\r\n}\r\n```\r\n\r\n- **POST** `/auth/signin`: User signin\r\n\r\n```json\r\n{\r\n  \"email\": \"test@test.com\",\r\n  \"password\": \"password\"\r\n}\r\n```\r\n\r\n- **GET** `/auth/me`: Get current user (requires auth)\r\n\r\n#### Reports\r\n\r\n- **POST** `/report`: Create a new report (requires authentication)\r\n\r\n```json\r\n{\r\n  \"make\": \"ford\",\r\n  \"model\": \"mustang\",\r\n  \"year\": 1982,\r\n  \"mileage\": 50000,\r\n  \"lng\": 45,\r\n  \"lat\": 45,\r\n  \"price\": 20000\r\n}\r\n```\r\n\r\n- **GET** `/report/:id`: Approve or disapprove report (admin only)\r\n\r\n```json\r\n{\r\n  \"approved\": true\r\n}\r\n```\r\n\r\n- **GET** `/report/?make=ford\u0026model=mustang\u0026lng=45\u0026lat=45\u0026mileage=20000\u0026year=1981`: Get estimated car price according to params\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folha-dev-fullstack%2Fnest-cars-price-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folha-dev-fullstack%2Fnest-cars-price-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folha-dev-fullstack%2Fnest-cars-price-api/lists"}