{"id":15106984,"url":"https://github.com/edwinmambo/storefront-backend","last_synced_at":"2026-01-18T22:33:54.367Z","repository":{"id":99309049,"uuid":"593015577","full_name":"edwinmambo/storefront-backend","owner":"edwinmambo","description":"A storefront backend api that connects to the database for communication with the frontend","archived":false,"fork":false,"pushed_at":"2023-03-27T17:05:32.000Z","size":168,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T09:42:59.281Z","etag":null,"topics":["api","backend","bcrypt","database","express","jasmine","jwt","nodejs","postgresql","udacity"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edwinmambo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-25T02:39:57.000Z","updated_at":"2023-01-31T09:03:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"a8f6496a-183e-4477-a2fc-7b27d17cc886","html_url":"https://github.com/edwinmambo/storefront-backend","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"774b3aeb071fbd5baa22cf9accb25ca6ac4e7d62"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edwinmambo%2Fstorefront-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edwinmambo%2Fstorefront-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edwinmambo%2Fstorefront-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edwinmambo%2Fstorefront-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edwinmambo","download_url":"https://codeload.github.com/edwinmambo/storefront-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345703,"owners_count":20924098,"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":["api","backend","bcrypt","database","express","jasmine","jwt","nodejs","postgresql","udacity"],"created_at":"2024-09-25T21:03:41.859Z","updated_at":"2026-01-18T22:33:54.361Z","avatar_url":"https://github.com/edwinmambo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Storefront Backend Project\n\n## Introduction\n\nThis repo contains a storefront backend api that connects to the database for communication with the frontend. The API needs are stated in `REQUIREMENTS.md`\n\n## Required Technologies\n\nThis application makes use of the following libraries:\n\n- Postgres for the database\n- Node/Express for the application logic\n- dotenv from npm for managing environment variables\n- db-migrate from npm for migrations\n- jsonwebtoken from npm for working with JWTs\n- jasmine from npm for testing\n\n## Setup\n\n1. ### Get the project locally\n\n   Clone the project here on github\n\n   ```bash\n   git clone https://github.com/edwinmambo/storefront-backend.git\n   ```\n\n2. ### Satisfy the following prerequisites\n\n   - Have docker installed\n\n   ```bash\n   #check if docker and docker compose are installed\n   docker version\n   docker compose version\n   ```\n\n   - I use `yarn` as the package manager\n   - create an `.env` in file with the following variables:\n\n   ```text\n   POSTGRES_HOST\n   POSTGRES_DB\n   POSTGRES_TEST_DB\n   POSTGRES_USER\n   POSTGRES_PASSWORD\n   ENV\n   BCRYPT_PASSWORD\n   SALT_ROUNDS\n   TOKEN_SECRET\n   ```\n\n   The default values I use are the following:\n\n   - host: 127.0.0.1\n   - db: full_stack_dev\n   - test db: full_stack_dev_test\n   - user: full_stack_user\n   - password: password123\n   - env: dev\n\n   **NOTE:** bcrypt password, salt rounds and token secret are of your own choosing.\n\n3. ### Install the dependencies\n\n   ```bash\n   npm install --global yarn\n   yarn\n   ```\n\n4. ### Set up db\n\n   For both the dev and test environments:\n\n   Run the container from `docker-compose.yml`\n\n   ```bash\n   # runs on port 5432\n   docker compose up\n   ```\n\n   Connect to the container and run the following to setup the database (_Use values in your `.env` file_):\n\n   **Create a user**\n\n   ```bash(psql)\n   CREATE USER full_stack_user WITH PASSWORD 'Password123';\n   ```\n\n   **Create Databases**\n\n   ```bash(psql)\n   CREATE DATABASE full_stack_dev;\n   CREATE DATABASE full_stack_dev_test;\n   ```\n\n   **Grant all privileges on both databases to user**\n\n   ```bash(psql)\n   GRANT ALL PRIVILEGES ON DATABASE full_stack_dev TO full_stack_user;\n   GRANT ALL PRIVILEGES ON DATABASE full_stack_dev_test TO full_stack_user;\n   ```\n\n5. ### Run the api\n\n   ```bash\n   # In a separate terminal\n   yarn watch\n   ```\n\n6. ### Testing\n\n   ```bash\n   yarn test\n   ```\n\n## Usage\n\nThe server will run on `localhost:3000/` or `0.0.0.0:3000` where the api will be under the specific endpoint as in `REQUIREMENTS.md`\n\n## Examples\n\nProducts: \u0026nbsp; `http:localhost:3000/products`\n\nUsers: \u0026emsp; `http:localhost:3000/users`\n\nOrders: \u0026emsp; `http:localhost:3000/orders`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedwinmambo%2Fstorefront-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedwinmambo%2Fstorefront-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedwinmambo%2Fstorefront-backend/lists"}