{"id":16387318,"url":"https://github.com/fhsinchy/deno-blog","last_synced_at":"2025-10-26T11:31:53.414Z","repository":{"id":54459816,"uuid":"266115411","full_name":"fhsinchy/deno-blog","owner":"fhsinchy","description":"An experimental blogging application developed with Docker, Deno, Oak and MySQL","archived":true,"fork":false,"pushed_at":"2021-03-09T16:16:10.000Z","size":74,"stargazers_count":47,"open_issues_count":0,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-28T09:11:48.292Z","etag":null,"topics":["deno","deno-blog","restful-api"],"latest_commit_sha":null,"homepage":"","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/fhsinchy.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}},"created_at":"2020-05-22T13:19:33.000Z","updated_at":"2024-09-05T03:57:02.000Z","dependencies_parsed_at":"2022-08-13T16:20:20.705Z","dependency_job_id":null,"html_url":"https://github.com/fhsinchy/deno-blog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhsinchy%2Fdeno-blog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhsinchy%2Fdeno-blog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhsinchy%2Fdeno-blog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhsinchy%2Fdeno-blog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fhsinchy","download_url":"https://codeload.github.com/fhsinchy/deno-blog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238319539,"owners_count":19452355,"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":["deno","deno-blog","restful-api"],"created_at":"2024-10-11T04:26:14.888Z","updated_at":"2025-10-26T11:31:48.127Z","avatar_url":"https://github.com/fhsinchy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deno Blog\n\nThis is an experimental blogging API developed with [Docker](https://www.docker.com/get-started), [Deno](https://deno.land/), [Oak](https://github.com/oakserver/oak) and [MySQL](https://www.mysql.com/).\n\n| :warning: WARNING |\n|:------------------|\n| The code from this API should not be deemed as ideal as all the functionalities are implemented in a very naive way. The goal was to test things out with this new runtime, not to build a production quality API. |\n\n## Development Task List\n\n- Dockerization :heavy_check_mark:\n- Blogs :heavy_check_mark:\n- Authentication :heavy_check_mark:\n- Documentation :heavy_check_mark:\n- [Development Tutorial](https://blog.farhan.info/develop-and-dockerize-a-blogging-api-with-deno-oak-and-mysql-1) :heavy_check_mark:\n\n## System Requirements\n\n- [Deno 1.0+](https://deno.land/)\n- [Docker](https://www.docker.com/get-started)\n\n## Libraries Used\n\n- [oak](https://deno.land/x/oak)\n- [deno_mysql](https://deno.land/x/mysql)\n- [bcrypt](https://deno.land/x/bcrypt)\n- [djwt](https://deno.land/x/djwt)\n- [slugify](https://deno.land/x/slugify)\n\n## Project Structure\n\n```bash\n.\n├── Dockerfile\n├── app.ts\n├── controllers\n│   ├── auth.ts\n│   └── blogs.ts\n├── db\n│   └── mysql.ts\n├── deps.ts\n├── docker-compose.yml\n├── docker-entrypoint-initdb.d\n│   ├── blogs.sql\n│   └── users.sql\n├── helpers\n│   └── between.ts\n├── middleware\n│   ├── authorize.ts\n│   ├── error.ts\n│   ├── logger.ts\n│   └── timer.ts\n├── models\n│   ├── Blog.ts\n│   └── User.ts\n└── routes\n    ├── auth.ts\n    ├── blogs.ts\n    └── home.ts\n```\n\nThere are eight directories in the project -\n\n- `api` contains `server.ts`, responsible for initiating the application instance. It also registers four universal middleware.\n- `controllers` directory contains logic for all the api endpoints. Logic for a certain endpoint is encapsulated inside relevantly named files.\n  - `auth.ts` contains logic regarding registration of users and generation of JWT tokens.\n  - `blogs.ts` contains logic regarding CRUD operations of blog posts.\n- `db` directory contains necessary code for connecting to the database.\n- `docker-entrypoint-initdb.d` contains sql files for initializing the database.\n- `helpers` contains small helper functions for reusability.\n- `middleware` directory contains middleware functions for reusability.\n  - `authorize.ts` handles validation of JWT tokens.\n  - `error.ts` handles all errors centrally.\n  - `logger.ts` logs all requests to the console.\n  - `timer.ts` logs request times to the console.\n- `models` contains classes containing functions for querying the database.\n- `routes` contains necessary code for registering the controller functions as middleware route endpoints.\n\nThere are four orphan files in the project root:\n\n- `Dockerfile` for building the api container.\n- `app.ts` is responsible for registering all endpoints to the main app instance and firing up the server.\n- `deps.ts` imports and exports all the necessary dependencies.\n- `docker-compose.yml` file for building and running multi-container application.\n\n## Instructions\n\nClone this repository anywhere you want. Open up terminal and use following command to build and run the application -\n\n```bash\ndocker-compose up --build\n```\n\nThere will be a wall of text but look for something like following -\n\n```bash\ndb_1   | 2020-06-08T17:27:05.115386Z 0 [Note] Event Scheduler: Loaded 0 events\ndb_1   | 2020-06-08T17:27:05.116258Z 0 [Note] mysqld: ready for connections.\ndb_1   | Version: '5.7.30'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)\n```\n\nThe application should be running on http://127.0.0.1:3000 address. A postman collection containing all the routes can be found inside `postman-collection` directory.\n\nYou can stop the application by pressing `control + c` combination. If you want to stop and delete all built images issue following command -\n\n```bash\ndocker-compose down\n```\n\nUse following command if you don't want the containers and images to be deleted -\n\n```bash\ndocker-compose stop\n```\n\nYou can restart the application with following command -\n\n```bash\ndocker-compose up\n```\n\nYou can learn more about docker-compose command line interface from [Compose command-line reference](https://docs.docker.com/compose/reference/)\n\n## Postman Collection\n\nThe `postman-collection/deno-blog.postman_collection.json` file can be imported inside [Postman](https://www.postman.com/) for testing out the endpoints.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffhsinchy%2Fdeno-blog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffhsinchy%2Fdeno-blog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffhsinchy%2Fdeno-blog/lists"}