{"id":35011048,"url":"https://github.com/urah001/micro-station","last_synced_at":"2026-05-06T14:31:43.519Z","repository":{"id":317686769,"uuid":"1068420834","full_name":"urah001/micro-station","owner":"urah001","description":"A Micro service ecommerce app that was created for mobile devices using react-native","archived":false,"fork":false,"pushed_at":"2025-10-06T21:29:01.000Z","size":10098,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T22:28:06.818Z","etag":null,"topics":["android","commerce","ecommerce","microservice","react-native","reactnative"],"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/urah001.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-02T11:05:32.000Z","updated_at":"2025-10-06T21:29:05.000Z","dependencies_parsed_at":"2025-10-06T22:28:07.440Z","dependency_job_id":null,"html_url":"https://github.com/urah001/micro-station","commit_stats":null,"previous_names":["urah001/mirco-station","urah001/micro-station"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/urah001/micro-station","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urah001%2Fmicro-station","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urah001%2Fmicro-station/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urah001%2Fmicro-station/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urah001%2Fmicro-station/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urah001","download_url":"https://codeload.github.com/urah001/micro-station/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urah001%2Fmicro-station/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32698098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["android","commerce","ecommerce","microservice","react-native","reactnative"],"created_at":"2025-12-27T04:58:43.044Z","updated_at":"2026-05-06T14:31:43.513Z","avatar_url":"https://github.com/urah001.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"github repo : https://github.com/urah001/micro-station\n\n# Micro-Station\n\nThis project is a simple e-commerce API built with **Node.js**, **Express.js**, **Prisma ORM**, and **PostgreSQL**.\nIt was developed as part of an assessment to demonstrate backend API creation, database interaction, and user management.\nThe frontend (built with React Native) and backend were developed separately due to time constraints.\n\n---\n\n## Technology Stack Used\n\n- **React Native** – for building the mobile application interface\n- **Node.js** – Used for building the backend server.\n- **Express.js** – Used for setting up routes and handling requests.\n- **Prisma ORM** – Used to connect and interact with the PostgreSQL database.\n- **PostgreSQL** – The main database used for storing user and product information.\n- **dotenv** – For managing environment variables securely.\n- **Nodemon** – To automatically restart the server during development.\n\n---\n\n## Setup and Run Instructions\n\nFollow the steps below to set up and run the backend project:\n\n### Step 1: Clone the repository\n\n```bash\ngit clone https://github.com/urah001/micro-station.git\ncd micro-station\n```\n\n### Step 2: Install dependencies\n\n```bash\nnpm install\n```\n\n### Step 3: Set up environment variables\n\nCreate a `.env` file in the project root and add the following details:\n\n```\nDATABASE_URL=\"postgresql://USER:PASSWORD@localhost:5432/micro_station\"\nPORT=5000\n```\n\nReplace `USER` and `PASSWORD` with your PostgreSQL details.\n\n### Step 4: Initialize the database\n\nRun the Prisma commands below:\n\n```bash\nnpx prisma migrate dev --name init\nnpx prisma generate\n```\n\n### Step 5: Start the server\n\n```bash\nnode src/server.js\n```\n\nOnce the server starts successfully, it will be available at:\n\n```\nhttp://localhost:5000\n```\n\n---\n\n## API Endpoints\n\nThe backend exposes several API endpoints to handle authentication and product management.\n\n### Authentication Routes\n\n#### Register a new user\n\n**POST** `/api/auth/register`\n\nExample request:\n\n```bash\ncurl -X POST http://localhost:5000/api/auth/register \\\n-H \"Content-Type: application/json\" \\\n-d '{\"username\": \"testuser\", \"email\": \"test@example.com\", \"password\": \"password123\"}'\n```\n\nExample response:\n\n```json\n{\n  \"message\": \"User registered successfully\",\n  \"user\": {\n    \"id\": 1,\n    \"username\": \"testuser\",\n    \"email\": \"test@example.com\"\n  }\n}\n```\n\n---\n\n#### Login a user\n\n**POST** `/api/auth/login`\n\nExample request:\n\n```bash\ncurl -X POST http://localhost:5000/api/auth/login \\\n-H \"Content-Type: application/json\" \\\n-d '{\"email\": \"test@example.com\", \"password\": \"password123\"}'\n```\n\nExample response:\n\n```json\n{\n  \"message\": \"Login successful\",\n  \"user\": {\n    \"id\": 1,\n    \"username\": \"testuser\",\n    \"email\": \"test@example.com\"\n  }\n}\n```\n\n---\n\n### Product Routes\n\n#### Get all products\n\n**GET** `/api/products`\n\nExample request:\n\n```bash\ncurl http://localhost:5000/api/products\n```\n\nExample response:\n\n```json\n[\n  {\n    \"id\": 1,\n    \"name\": \"Wireless Headphones\",\n    \"price\": 5000\n  },\n  {\n    \"id\": 2,\n    \"name\": \"Smart Watch\",\n    \"price\": 8000\n  }\n]\n```\n\n---\n\n#### Add a new product\n\n**POST** `/api/products`\n\nExample request:\n\n```bash\ncurl -X POST http://localhost:5000/api/products \\\n-H \"Content-Type: application/json\" \\\n-d '{\"name\": \"Laptop\", \"price\": 150000}'\n```\n\nExample response:\n\n```json\n{\n  \"message\": \"Product created successfully\",\n  \"product\": {\n    \"id\": 3,\n    \"name\": \"Laptop\",\n    \"price\": 150000\n  }\n}\n```\n\n---\n\n## Known Limitations\n\n- The frontend (React Native) and backend (Node.js) were not connected due to limited time.\n- The project was completed within one week.\n- An admin page was not created.\n- Some advanced validation and authentication features were not fully implemented.\n\n---\n\n## Summary\n\nThe Micro-Station project demonstrates the use of Express.js with Prisma ORM for creating a backend API connected to a PostgreSQL database.\nIt supports basic user registration, login, and product management features, with room for future improvements such as admin controls, frontend integration, and authentication tokens.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furah001%2Fmicro-station","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furah001%2Fmicro-station","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furah001%2Fmicro-station/lists"}