{"id":22276225,"url":"https://github.com/xscriptorcode/api-only-project","last_synced_at":"2025-03-25T17:27:17.668Z","repository":{"id":261342636,"uuid":"884014878","full_name":"xscriptorcode/api-only-project","owner":"xscriptorcode","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-06T09:23:33.000Z","size":236,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T15:29:12.479Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://api-only-project.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xscriptorcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-11-06T01:27:51.000Z","updated_at":"2024-11-06T09:24:31.000Z","dependencies_parsed_at":"2024-11-06T03:37:32.312Z","dependency_job_id":null,"html_url":"https://github.com/xscriptorcode/api-only-project","commit_stats":null,"previous_names":["xscriptorcode/api-only-project"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xscriptorcode%2Fapi-only-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xscriptorcode%2Fapi-only-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xscriptorcode%2Fapi-only-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xscriptorcode%2Fapi-only-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xscriptorcode","download_url":"https://codeload.github.com/xscriptorcode/api-only-project/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245509732,"owners_count":20627043,"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":[],"created_at":"2024-12-03T14:14:10.994Z","updated_at":"2025-03-25T17:27:17.644Z","avatar_url":"https://github.com/xscriptorcode.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API-Only Project\n\nThis project is an API-only setup built with Next.js and deployed on Vercel. It includes a subscription endpoint (`/api/newsletter`) that handles email subscriptions by receiving and validating email addresses. This project is designed for a standalone API deployment to work in tandem with a frontend hosted on a separate platform (e.g., Hostinger).\n\n## Project Structure\n\nThe main components of the project include:\n\napi-only-project/ \n├── app/ \n│ └── api/ \n│ └── newsletter/ \n│ └── route.ts \n├── prisma/ \n│ └── schema.prisma \n├── package.json \n├── next.config.js \n└── .env.example\n\n\n- **`app/api/newsletter/route.ts`**: Handles the API endpoint for email subscriptions (`POST /api/newsletter`).\n- **`prisma/schema.prisma`**: Defines the Prisma database schema.\n- **`.env.example`**: Example environment file listing necessary environment variables.\n\n## Getting Started\n\n### Prerequisites\n\n- **Node.js** and **npm** installed on your system.\n- **Git** for version control.\n- A **database** compatible with Prisma (e.g., MySQL, PostgreSQL).\n\n### Installation\n\n1. Clone the repository:\n\n    ```bash\n   git clone https://github.com/your-username/api-only-project.git\n   cd api-only-project\n\n2. Install dependencies:\n    ```bash\n    npm install\n\n\n3. set up environment variables:\nCreate a .env file based on .env.example and add your DATABASE_URL and other required variables.\n\n4. Run Prisma migrations and generate the Prisma client:\n\n    ```bash\n    npx prisma migrate deploy\n    npx prisma generate\n\nStart the development server:\n\n**npm** run **dev**\n\n\nDeployment\nThis API is designed to be deployed on Vercel. Follow these steps:\n\nPush your code to GitHub.\nConnect your GitHub repository to Vercel.\nSet up environment variables in Vercel.\nDeploy the project and obtain your public URL.\nLicense\nThis project is licensed under the MIT License - see the LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxscriptorcode%2Fapi-only-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxscriptorcode%2Fapi-only-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxscriptorcode%2Fapi-only-project/lists"}