{"id":30952366,"url":"https://github.com/mugisha-pascal/flutter-offline-app-api","last_synced_at":"2026-05-03T11:37:17.500Z","repository":{"id":309088543,"uuid":"1032815688","full_name":"MUGISHA-Pascal/Flutter-Offline-App-API","owner":"MUGISHA-Pascal","description":" API with PostgreSQL and JWT authentication for Flutter offline-capable task management applications, featuring Docker containerization and Drizzle.","archived":false,"fork":false,"pushed_at":"2026-04-20T13:20:02.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-20T15:32:16.188Z","etag":null,"topics":["docker","drizzle","express"],"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/MUGISHA-Pascal.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}},"created_at":"2025-08-05T21:48:10.000Z","updated_at":"2026-04-20T13:20:07.000Z","dependencies_parsed_at":"2025-08-09T20:25:41.455Z","dependency_job_id":null,"html_url":"https://github.com/MUGISHA-Pascal/Flutter-Offline-App-API","commit_stats":null,"previous_names":["mugisha-pascal/flutter-offline-app-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MUGISHA-Pascal/Flutter-Offline-App-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MUGISHA-Pascal%2FFlutter-Offline-App-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MUGISHA-Pascal%2FFlutter-Offline-App-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MUGISHA-Pascal%2FFlutter-Offline-App-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MUGISHA-Pascal%2FFlutter-Offline-App-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MUGISHA-Pascal","download_url":"https://codeload.github.com/MUGISHA-Pascal/Flutter-Offline-App-API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MUGISHA-Pascal%2FFlutter-Offline-App-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32567797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: 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":["docker","drizzle","express"],"created_at":"2025-09-11T07:42:05.469Z","updated_at":"2026-05-03T11:37:17.483Z","avatar_url":"https://github.com/MUGISHA-Pascal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flutter Offline App Backend\n\nA Node.js/TypeScript backend API server designed to support a Flutter offline-capable task management application. This backend provides authentication services and task management functionality with PostgreSQL database integration.\n\n## Features\n\n- **User Authentication**: Sign up, login, and token validation\n- **Task Management**: Create, read, delete, and sync tasks\n- **Offline Support**: Task synchronization capabilities for offline-first Flutter apps\n- **JWT Authentication**: Secure token-based authentication\n- **PostgreSQL Database**: Robust data persistence with Drizzle ORM\n- **Docker Support**: Containerized deployment with Docker Compose\n- **TypeScript**: Full type safety and modern JavaScript features\n\n## Tech Stack\n\n- **Runtime**: Node.js with TypeScript\n- **Framework**: Express.js\n- **Database**: PostgreSQL\n- **ORM**: Drizzle ORM\n- **Authentication**: JWT with bcryptjs\n- **Containerization**: Docker \u0026 Docker Compose\n- **Development**: Nodemon for hot reloading\n\n## Prerequisites\n\n- Node.js (v18 or higher)\n- Docker and Docker Compose\n- PostgreSQL (if running locally without Docker)\n\n## Quick Start\n\n### Using Docker (Recommended)\n\n1. Clone the repository:\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd Flutter-Offline-App-Backend\n   ```\n\n2. Start the application with Docker Compose:\n   ```bash\n   docker-compose up --build\n   ```\n\n3. The API will be available at `http://localhost:8000`\n\n### Local Development\n\n1. Install dependencies:\n   ```bash\n   npm install\n   ```\n\n2. Set up environment variables (create a `.env` file):\n   ```\n   DATABASE_URL=postgresql://postgres:postgres@localhost:5433/task_manager\n   PORT=8000\n   ```\n\n3. Start the PostgreSQL database:\n   ```bash\n   docker-compose up db\n   ```\n\n4. Run the development server:\n   ```bash\n   npm run dev\n   ```\n\n## API Endpoints\n\n### Authentication\n\n#### POST `/auth/signup`\nCreate a new user account.\n\n**Request Body:**\n```json\n{\n  \"name\": \"John Doe\",\n  \"email\": \"john@example.com\",\n  \"password\": \"securepassword\"\n}\n```\n\n**Response:**\n```json\n{\n  \"id\": \"user_id\",\n  \"name\": \"John Doe\",\n  \"email\": \"john@example.com\"\n}\n```\n\n#### POST `/auth/login`\nAuthenticate user and receive JWT token.\n\n**Request Body:**\n```json\n{\n  \"email\": \"john@example.com\",\n  \"password\": \"securepassword\"\n}\n```\n\n**Response:**\n```json\n{\n  \"token\": \"jwt_token_here\",\n  \"id\": \"user_id\",\n  \"name\": \"John Doe\",\n  \"email\": \"john@example.com\"\n}\n```\n\n#### POST `/auth/tokenIsValid`\nValidate JWT token.\n\n**Headers:**\n```\nx-auth-token: jwt_token_here\n```\n\n**Response:**\n```json\ntrue\n```\n\n### Tasks\n\nAll task endpoints require authentication via the `x-auth-token` header.\n\n#### POST `/tasks`\nCreate a new task.\n\n**Headers:**\n```\nx-auth-token: jwt_token_here\n```\n\n**Request Body:**\n```json\n{\n  \"title\": \"Complete project\",\n  \"description\": \"Finish the Flutter app backend\",\n  \"dueAt\": \"2024-01-15T10:00:00Z\",\n  \"priority\": \"high\"\n}\n```\n\n#### GET `/tasks`\nGet all tasks for the authenticated user.\n\n**Headers:**\n```\nx-auth-token: jwt_token_here\n```\n\n**Response:**\n```json\n[\n  {\n    \"id\": \"task_id\",\n    \"title\": \"Complete project\",\n    \"description\": \"Finish the Flutter app backend\",\n    \"dueAt\": \"2024-01-15T10:00:00Z\",\n    \"priority\": \"high\",\n    \"uid\": \"user_id\",\n    \"createdAt\": \"2024-01-01T00:00:00Z\",\n    \"updatedAt\": \"2024-01-01T00:00:00Z\"\n  }\n]\n```\n\n#### DELETE `/tasks`\nDelete a task.\n\n**Headers:**\n```\nx-auth-token: jwt_token_here\n```\n\n**Request Body:**\n```json\n{\n  \"taskId\": \"task_id_to_delete\"\n}\n```\n\n#### POST `/tasks/sync`\nSync multiple tasks (useful for offline-first apps).\n\n**Headers:**\n```\nx-auth-token: jwt_token_here\n```\n\n**Request Body:**\n```json\n[\n  {\n    \"title\": \"Task 1\",\n    \"description\": \"Description 1\",\n    \"dueAt\": \"2024-01-15T10:00:00Z\",\n    \"priority\": \"medium\",\n    \"createdAt\": \"2024-01-01T00:00:00Z\",\n    \"updatedAt\": \"2024-01-01T00:00:00Z\"\n  }\n]\n```\n\n## Database Schema\n\nThe application uses PostgreSQL with the following main tables:\n\n- **users**: User accounts with authentication data\n- **tasks**: Task management with user relationships\n\n## Development\n\n### Project Structure\n\n```\nsrc/\n├── app.ts              # Main application entry point\n├── routes/             # API route handlers\n│   ├── auth.ts         # Authentication endpoints\n│   └── tasks.ts        # Task management endpoints\n├── middleware/         # Express middleware\n│   └── auth.ts         # JWT authentication middleware\n├── db/                 # Database configuration\n│   ├── schema.ts       # Database schema definitions\n│   ├── drizzle-client.ts # Database connection\n│   └── drizzle.config.ts # Drizzle ORM configuration\n```\n\n### Available Scripts\n\n- `npm run dev`: Start development server with hot reload\n- `npm test`: Run tests (not implemented yet)\n\n### Environment Variables\n\n- `DATABASE_URL`: PostgreSQL connection string\n- `PORT`: Server port (default: 8000)\n\n## Deployment\n\nThe application is containerized and can be deployed using Docker Compose:\n\n```bash\ndocker-compose up -d\n```\n\nFor production deployment, consider:\n- Using environment variables for sensitive data\n- Setting up proper SSL/TLS certificates\n- Configuring database backups\n- Implementing rate limiting\n- Adding monitoring and logging\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## License\n\nThis project is licensed under the ISC License. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmugisha-pascal%2Fflutter-offline-app-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmugisha-pascal%2Fflutter-offline-app-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmugisha-pascal%2Fflutter-offline-app-api/lists"}