{"id":19848663,"url":"https://github.com/polterguy/anarq","last_synced_at":"2025-07-22T03:36:41.346Z","repository":{"id":53591247,"uuid":"273673304","full_name":"polterguy/anarq","owner":"polterguy","description":"An Open Source alternative to Facebook, Reddit and Disqus","archived":false,"fork":false,"pushed_at":"2021-04-15T14:19:11.000Z","size":627,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T23:02:44.160Z","etag":null,"topics":["api","http"],"latest_commit_sha":null,"homepage":"https://ainiro.io","language":"HTML","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/polterguy.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}},"created_at":"2020-06-20T08:59:41.000Z","updated_at":"2024-01-08T21:15:46.000Z","dependencies_parsed_at":"2022-09-10T07:52:08.639Z","dependency_job_id":null,"html_url":"https://github.com/polterguy/anarq","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/polterguy/anarq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polterguy%2Fanarq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polterguy%2Fanarq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polterguy%2Fanarq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polterguy%2Fanarq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polterguy","download_url":"https://codeload.github.com/polterguy/anarq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polterguy%2Fanarq/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266420844,"owners_count":23926004,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api","http"],"created_at":"2024-11-12T13:17:56.015Z","updated_at":"2025-07-22T03:36:41.320Z","avatar_url":"https://github.com/polterguy.png","language":"HTML","readme":"\n# AnarQ - An Open Source Social Media Platform\n\nAnarQ is an Open Source social media platform that you can install on your local server,\nproviding you with feeds, posts, profiles, the ability to moderate posts, etc. Its most basic functionality\nis that of serving as a forum HTTP backend web API, but it goes way beyond the capabilities of a plain\nforum, by including social gaming elements, such as likes, profiles, voting, etc. It's arguably in such a regard\nmore a social media platform, than a traditional forum, competing with social media platforms such\nas Reddit, Facebook and Twitter.\n\nIts name is a play upon the two Greek words _\"an\"_ and _\"archy\"_ implying _\"no leaders\"_ or _\"no hierarchy\"_,\nadding the Q in its name implies U. It is Open Source, but you will need a license\nof [Magic](https://github.com/polterguy/magic) to run it.\n\n## Implementation details\n\nThe system is implemented in Hyperlambda, on top of .Net 5, and uses MySQL or MariaDB as its backing\ndatabase. The system is a 100% pure HTML Web API, allowing you to implement any client technology you see fit\non top of it.\n\n## Configuring\n\nIn order to configure AnarQ you'll need to configure an SMTP server, since the systems frequently sends emails\nto its registered users, to among other things have users verify their email address during registrations, etc.\nTo see how to configure this, visit the link below\n\n* [magic.lambda.mail](https://github.com/polterguy/magic.lambda.mail)\n\nIn addition AnarQ requires its own configuration settings. You can find an example below.\n\n```\n  \"anarq\": {\n    \"frontend\": {\n      \"url\": \"https://anarq.org\"\n    },\n    \"cooldown-minues\": 5\n  },\n```\n\nPaste in the above into your configuration file, just above the `magic` parts, and modify it as needed.\nModify the actual frontend `url` according to where you have your frontend running. The `cooldown-minutes`\npart above is the number of minutes users must wait between each OP post they submit to the site. If it\nis -1, users can post as frequently as they wish.\n\nThe system also contains a whole range of email templates, intended for you to edit and modify as you\nsee fit, according to your specific needs. These can be found in the folder _\"/anarq/data/emails/\"_.\n\nYou can see a complete example configuration file below.\n\n```json\n{\n  \"anarq\": {\n    \"frontend\": {\n      \"url\": \"https://anarq.org\"\n    },\n    \"cooldown-minues\": 15\n  },\n  \"magic\": {\n    \"smtp\": {\n      \"host\": \"smtp.sendgrid.net\",\n      \"port\": 465,\n      \"secure\": true,\n      \"username\": \"apikey\",\n      \"password\": \"SG.dsf345asddfguh345.dsfouhg435ysSDFtrDFGsdf\",\n      \"from\": {\n        \"name\": \"John Doe\",\n        \"address\": \"john@doe.com\"\n      }\n    },\n    \"paypal\": {\n      \"clientId\": \"AYXmWWv-OKV_RFjcksDoK4nJ0djwlhCmXp0h9staoD4U9dsY0oKfw8PBPH9TJ68s0SHjqGzWJNOT0inv\",\n      \"allowDonations\": \"true\"\n    },\n    \"databases\": {\n      \"mysql\": {\n        \"generic\": \"Server=db;Database={database};Uid=root;Pwd=ThisIsNotAGoodPassword;SslMode=Preferred;Old Guids=true;\"\n      },\n      \"mssql\": {\n        \"generic\": \"Server=localhost\\\\SQLEXPRESS;Database={database};Trusted_Connection=True;\"\n      },\n      \"default\": \"mysql\"\n    },\n    \"auth\": {\n      \"secret\": \"asdfoih234gefhdudfu345o3i4uhfsduofdshou345togyguSDFGDSAHsadfoug435\",\n      \"https-only\": false,\n      \"valid-minutes\": 120,\n      \"registration\": {\n        \"allow\": true,\n        \"confirm-email\": null\n      }\n    },\n    \"io\": {\n      \"root-folder\": \"~/files/\"\n    },\n    \"endpoint\": {\n      \"root-folder\": \"~/files/\"\n    },\n    \"license\": \"TRIAL-VERSION\"\n  }\n}\n```\n\nThe things you'll need to change in the above configuration file is as follows.\n\n* __magic/auth/secret__ - You'll need a new JWT auth secret\n* __magic/paypal/clientId__ - You'll need to provide your own PayPal ClientID here\n* __magic/smtp/password__ - If you're using SendGrid to send emails you can use your own API key password here\n* __anarq/frontend/url__ - You'll need to provide the domain for where you intend to install AnarQ here\n\nHowever, if you change the above parts, you can use the above appSettings.json file as is as you\nconfigure Magic. This allows you to use the Docker images for Magic, making installation of the\nbackend extremely simple.\n\nAlso you'll need a [licence of Magic](https://servergardens.com/buy/) before 47 hours, or the\nbackend will stop working.\n\nYou can see a complete Angular HTTP service layer below, if you want to use AnarQ to learn Angular. This\nfile wraps ever single HTTP endpoint and the AnarQ backend, and you are free to use it as you see fit.\n\n* [Angular HTTP service layer](https://github.com/polterguy/anarq.frontend/blob/master/src/app/services/anarq.service.ts)\n\n## Profile\n\nThis section contains everything related to authentication, registration, and public retrieval of profiles\nfor registered users in the system.\n\n### GET magic/modules/anarq/profile/authenticate\n\nThis endpoint allows you to authenticate a user with a username/password combination, provided as URL\nencoded QUERY parameters. Below is an example.\n\n```\nhttps://your-api-domain.com/magic/modules/anarq/profile/authenticate?username=foo4\u0026password=bar\n```\n\nThe above will return a JWT token back to the caller, without an expiration date, or more specifically an\nexpiration date 5 years into the future. This allows you to store the token in your client's persistent storage,\nsuch as for instance `localStorage` in your browser, and use the token to authorize future requests towards\nyour backend. Each consecutive request on behalf of the user needs to associate this token in the HTTP `Authorization`\nheader as a _\"Bearer\"_ token. Below is an example\n\n```\nAuthorization: Bearer eyJhbGciOixyz.eyJ1bmlxyz.GAP-Aluxyz\n```\n\nThe token returned will not expire before 5 years into the future, allowing you to create clients where you\ndon't store usernames and passwords, but rather simply store the token once as the user logs in, for never\nagain to ask the user for a password again, before 5 years down the road of course.\n\nThis endpoint does not require the user to be authenticated.\n\n### POST magic/modules/anarq/profile/register\n\nThis endpoint registers a new user in the system. It takes the following payload.\n\n```json\n{\n  \"username\": \"username_on_site\",\n  \"password\": \"password_on_site\",\n  \"email\": \"john@doe.com\",\n  \"full_name\": \"John Doe\",\n  \"email-type\": \"web|client\"\n}\n```\n\nIf the username or email address is already registered on the site, the endpoint will return failure,\nexplaining you more or less exactly what went wrong.\n\nNotice, the exact flow of the registration process depends upon what client type you choose to use\nin the optional `email-type` in the payload you choose to create as you invoke endpoint. This field\ncan have two different values.\n\n* web\n* client\n\nThe default value for `email-type` if omitted is `web`.\n\n#### Web frontends\n\nThe value of `web` implies you have a web based HTML frontend somewhere, to where you can lead users,\nsomehow resolving to a URL that will invoke the `confirm-email` endpoint as\nthe user visits it, being able to retrieve the secret from a QUERY parameter named `secret`. Typically a\nlink generated this way will look like the following.\n\n```\nhttps://your-frontend-domain.com/confirm-email?email=john%40doe.com\u0026secret=345fbacd678e3eed11f\n```\n\nOnce the user visits the above link in your frontend, you'll need to extract both the `email` and the `secret`\nQUERY parameters, and transmit these to the `confirm-email` endpoint, to have the user verify his or her email\naddress.\n\nThe system will attempt to send an email to the registered email address, using configuration settings found\nfrom your configuration file, allowing the user to confirm his email address. If you wish to edit this\ntemplate email, you can find it in _\"/anarq/data/emails/confirm-email.web.txt\"_. In order to send a valid email,\nyou need to configure your appSettings.json file having a value of anarq/frontend/url pointing to your\nfrontend's root URL page, and you'll need to have a frontend URL being `/confirm-email`, accepting\nthe following query parameters.\n\n* email\n* secret\n\nThe secret needs to be supplied to the `profile/confirm-email` endpoint later before the user can post, comment or\nlike posts/comments in the system.\n\nThis endpoint does not require the user to be authenticated.\n\n#### Client frontends\n\nIf you don't have a web based HTML capable frontend, due to maybe creating only an iOS or Android client -\nThen sending the user a hyperlink he clicks to confirm his email is obviously not a choice. Hence, you can\ntherefor use the `client` type of email sent during registrations, which simply sends the user the generated\nsecret, allowing him to copy and paste it into your app/client, for then to submit it to your backend somehow,\nby invoking the `profile/confirm-email` endpoint from within your client app.\n\n### GET magic/modules/anarq/profile/username-available\n\nThis endpoint returns true if the specified username is available. An example invocation can be found below.\n\n```\nhttps://your-api-domain.com/magic/modules/anarq/profile/username-available?username=foo3\n```\n\nIf the username is registered from before, the above will result in the following result.\n\n```json\n{\n  \"result\": false,\n  \"message\": \"Username already registered\"\n}\n```\n\nIf the username is available, the above `result` field will have a value of `true`.\n\nThis endpoint does not require the user to be authenticated. The idea is to invoke this endpoint\nas the user types his or her username, to check if the username is available or not, before\nclicking the _\"Register\"_ button.\n\n### GET magic/modules/anarq/profile/email-available\n\nThis endpoint works exactly as the above username-available endpoint, except it of course\nexpects an `email` query parameter, and checks to see if the specified email address is registered\nfrom before. If the email address is already registered from before, it will return something resembling\nthe following.\n\n```json\n{\n  \"result\": false,\n  \"message\": \"Email address already registered\"\n}\n```\n\nIf the email address is available, the above `result` field will have a value of `true`.\n\nThis endpoint does not require the user to be authenticated.\n\n### POST magic/modules/anarq/profile/confirm-email\n\nThis endpoints confirms a previously registered email address in the system, allowing the\nregistered user to prove he owns the email address specified as he or she registered at the site.\nAn example payload can be found below.\n\n```json\n{\n  \"email\": \"john@doe.com\",\n  \"secret\": \"SOME_SECRET_HASH_VALUE_HERE\"\n}\n```\n\nThe `secret` above needs to be the secret generated automatically by the system as the user registered\non the site, and is the SHA256 value of the combination of the user's email address, and the JWT auth\nsecret in your appSettings.json configuration file.\n\nThis endpoint does not require the user to be authenticated.\n\n### GET magic/modules/anarq/profile/me\n\nThis endpoint returns information about the currently authenticated user, and can be used\nto retrieve meta data about the currently logged in user, such as his username, email, full name, roles,\netc. This endpoint requires the user to be authenticated, and only returns information about the currently\nauthenticated user. Kind of similar to `whoami` on a Linux system.\n\n### PUT magic/modules/anarq/profile/paypal-id\n\nStores the user's PayPal Client id, allowing user to get PayPal donations for his writing.\nExample payload below.\n\n```\n{\n  \"payPalId\": \"PayPal Client ID goes here ...\"\n}\n```\n\n### PUT magic/modules/anarq/profile/email-notifications\n\nStores the user's email notifications settings. Implying whether or not AnarQ should\nsend the user an email when something of interest occurs that the user should be notified about.\nExample payload below.\n\n```\n{\n  \"notifications\": true\n}\n```\n\n## Posts\n\nThis section contains everything related to retrieving OP posts from the backend, in addition to\nthe feeds, and some of the _\"gaming parts\"_ of the system.\n\nNotice, posts cannot contain HTML, but assuming your client can handle it, Markdown is perfectly\nsafe. The backend will validate content submitted as the user tries to create or update a post, and\nif it contains illegal HTML characters, it will reject the insert/update, to avoid compromising other\nusers by tricking them into downloading malicious JavaScript snippets, or HTML snippets that might\ncontain malware of some sort.\n\n### GET magic/modules/anarq/posts/feed\n\nReturns the most popular items according to the specified query parameters supplied. Popular\nhere meaning items having the most likes. The endpoint takes 5 QUERY parameters, all of which are\noptional, and can be ommitted. Below is a list of parameters the endpoint can handle.\n\n* limit - Maximum number of posts to return. If specified this must be in between the range of 0-100. The default value if omitted is 25.\n* offset - Offset from where to start retrieving items. Combined with the above limit argument, this allows you to page items as you see fit.\n* topic - Name of topic to return items from within. See sub section topic for an explanation of this.\n* username - User that posted the OP.\n* minutes - Number of minutes to filter by. Notice, can be multiplied with e.g. 86,400 to filter according to days, weeks, etc.\n\nThis is the main _\"feed\"_ endpoint, returning the most popular posts, according to what posts had the most upvotes. It allows you\nto filter posts only submitted by a specific user, or posts submitted within a specific topic. The `minutes` filter allows you\nto only return posts that were posted during the last n minutes, resulting in that old posts _\"drops off\"_ the feed over time,\nregardless of how many upvotes they have. Which allows you to create feeds with most popular posts over the last 24 hours, 72 hours, etc\nas you see fit.\n\nThe endpoint will return something resembling the following.\n\n```json\n[\n  {\n    \"id\": 3,\n    \"topic\": \"news\",\n    \"created\": \"2021-03-09T08:50:17.000Z\",\n    \"user\": \"john\",\n    \"visibility\": \"protected\",\n    \"excerpt\": \"Covid19 proven to be an international media hoax\",\n    \"licks\": 54\n  },\n  {\n    \"id\": 1,\n    \"topic\": \"general\",\n    \"created\": \"2021-03-09T08:21:46.000Z\",\n    \"user\": \"peter\",\n    \"visibility\": \"public\",\n    \"excerpt\": \"Socially distancing you increases fatality rates for later mutations\",\n    \"licks\": 37\n  },\n]\n```\n\nNotice, the endpoint does _not_ return the actual contents of the posts, only an excerpt including its first 50 characters. If you want to retrieve\nthe entire content of a post, you'll have to use the GET `posts/post` invocation instead.\n\n### GET magic/modules/anarq/posts/post\n\nThis endpoint returns a single post, including its entire content, and number of likes it currently has.\nIt takes one single QUERY parameter being the `id` of the post to return. Invoking it with the following\nURL ...\n\n```\nhttps://your-api-domain.com/magic/modules/anarq/posts/post?id=3\n```\n\n... might return something resembling the following.\n\n```json\n{\n  \"id\": 3,\n  \"topic\": \"news\",\n  \"created\": \"2021-03-09T08:50:17.000Z\",\n  \"user\": \"root\",\n  \"visibility\": \"protected\",\n  \"content\": \"This is ANOTHER news OP posting\",\n  \"likes\": 1\n}\n```\n\nNotice, only authenticated users having confirmed their email address can retrieve posts that\nhas _\"protected\"_ as their `visibility` setting. Posts that have been moderated will only be returned\nto users belonging to one of the following roles.\n\n* root\n* admin\n* moderator\n\nAll other users can only see posts that are either _\"public\"_ or \"_protected\"_. Protected implies\nonly visible for registered users at the site, having confirmed their email address. In addition,\nthere is a status value for deleted posts being _\"deleted\"_.\n\n### POST magic/modules/anarq/posts/post\n\nThis endpoint creates a new OP post, and requires the user to be authenticated, and having confirmed\nhis email address. It takes the following payload.\n\n```json\n{\n  \"visibility\": \"public\",\n  \"topic\": \"news\",\n  \"content\": \"Actual content of your post. Can contain Markdown but NOT HTML\",\n  \"hyperlink\": \"https://foo.bar.com\"\n}\n```\n\nThe `visibility` parts above must be one of the pre-defined visibility settings that exists in the system,\ntypically one of the following values.\n\n* public\n* protected\n\nPublic posts are visible to anyone, including users just passing by as visitors, not being authenticated. Protected posts\nare only for users that have registered on the site, and having confirmed their email address. The endpoint will return\nthe ID of the item created, allowing you to for instance instantly navigate to the item, or somehow show it to the user\nas it is created.\n\n### PUT magic/modules/anarq/posts/post\n\nThis endpoint updates an existing post, but can only be invoked by the user that originally created the post, and\nexists such that users can edit their existing posts, after having saved them. An example payload can be found below.\n\n```json\n{\n  \"id\": 67777,\n  \"content\": \"This is the new updated content of the post, and will overwrite existing content\",\n  \"visibility\": \"public\",\n  \"topic\": \"news\",\n  \"hyperlink\": \"https://foo.bar.com\"\n}\n```\n\nA user can change both the content of the post, and the visibility of the post using this endpoint.\n\n### DELETE magic/modules/anarq/posts/post\n\nDeletes a previously created OP post. Notice, endpoint can only be invoked by the user that originally created\nthe OP post. And the post is not actually deleted, but only flagged as deleted, making it publicly invisible on\nthe site for everyone except root accounts, admin accounts, and moderator accounts.\n\n### GET magic/modules/anarq/posts/posts-count\n\nThis endpoint returns the number of OP posts in the system. If invoked by an authenticated user having confirmed\nhis or her email address, the endpoint will return count of both public and protected posts given the specified\nfiltering conditions. If invoked by a visitor not authenticated, it will only return count of public posts.\nIf invoked by a moderator, admin or root account, it will return count of _all_ posts, including moderated posts.\n\nThe endpoint takes the following optional filtering conditions.\n\n* topic - Only show posts from within the specified topic\n* user - Only show posts created by the specified user\n\n### GET magic/modules/anarq/posts/posts\n\nThis endpoint works similarly to the above `posts/feed` endpoint, except it will not sort by popularity, but\nrather when the post was created. This allows you to retrieve all posts in the system, and page through them as\nyou see fit, sorted by when the posts were created.\n\nNotice, the endpoint will only return public posts unless invoked by an authenticated user having confirmed\nhis or her email address, at which point the endpoint will also return protected posts. If invoked by a\nmoderator, admin, or root account, the endpoint will return also moderated posts. Arguments for the endpoint\nare as follows, all arguments are optional.\n\n* topic\n* username\n* limit\n* offset\n\n## Comments\n\nThis section contains everything related to comments. Comments are stored as materialised paths, allowing you\nto build tree structures of comments in your frontend, to show comments as children of other comments, according\nto how they are created. This can be accomplished by using the _\"parent\"_ field, and/or the _\"path\"_ field\nreturned by the endpoints used to retrieve comments.\n\nNotice, comments cannot contain HTML, but assuming your client can handle it, Markdown is perfectly\nsafe. The backend will validate content submitted as the user tries to create or update a comment, and\nif it contains illegal HTML characters, it will reject the insert/update, to avoid compromising other\nusers by tricking them into downloading malicious JavaScript snippets, or HTML snippets that might\ncontain malware of some sort.\n\n### POST magic/modules/anarq/comments/comment\n\nThis endpoint allows you to post a comment to either an OP posting, or another comment. Its payload is\nas follows.\n\n```json\n{\n  \"parent\": 67777,\n  \"content\": \"Actual content of comment. Can include Markdown but not HTML.\",\n  \"visibility\": \"public\"\n}\n```\n\nThe visibility of comments are similar to the visibility of OP posts, implying unless you've authenticated\nat the site, and confirmed your email address, only public posts will be visible for you.\nThe `parent` above is the ID of the OP posting or another comment.\n\n### PUT magic/modules/anarq/comments/comment\n\nThis endpoint allows a user to edit his existing comment, either changing its visibility, and/or changing\nits content. It can only be invoked by the user creating the comment. An example payload can be found below.\n\n```json\n{\n  \"id\": 67777,\n  \"content\": \"Some new comment here. May include Markdown but not HTML.\",\n  \"visibility\": \"public\"\n}\n```\n\nThe endpoint works similarly to the POST equivalent above, except of course instead of taking a `parent` it\nrequires an `id` to a previously created comment, and the comment _must_ have been created by the same\nauthenticated user trying to update it.\n\n### DELETE magic/modules/anarq/comments/comment\n\nThis endpoint works similarly to the above PUt equivalent, but instead of changing its visibility, and/or content,\nit marks the comment as deleted. The endpoint can only be invoked by the user originally having created the\ncomment. The endpoint requires a single QUERY parameter, being the `id` of the post the caller wants to delete.\n\n### GET magic/modules/anarq/comments/comments\n\nThis endpoint returns comments belonging to a parent OP. It can take the following arguments.\n\n* parent - Parent OP post\n* limit - Maximum comments to return\n* offset - Offset of where to start returning comments\n\nIt will return something resembling the following.\n\n```json\n[\n  {\n    \"id\":70,\n    \"created\":\"2021-03-25T08:09:28.000Z\",\n    \"user\":\"thomas\",\n    \"path\":\"/000000067/000000070\",\n    \"parent\":67,\n    \"content\":\"sefpih dfsgoih dfgoih dfg\",\n    \"visibility\":\"public\",\n    \"licks\":0\n  }\n]\n```\n\n### GET magic/modules/anarq/comments/comments-count\n\nThis endpoint returns the number of comments matching the specified arguments. Legal\narguments are as follows.\n\n* topic - Topic to filter within\n* username - Username to filter within\n\n## Licks\n\nThis section contains endpoints for liking posts and comments, allowing\nusers to like, and/or unlike existing posts, comments, etc.\n\n### POST magic/modules/anarq/licks/lick\n\nCreates a like for an OP posting or a comment. The like will automatically be asssociated with the currently\nauthenticated user. It requires the `id` to which post or comment you want to associate the like with.\nEach comment and post can only be likes by each user at most once. Below is an example payload.\n\n```json\n{\n  \"id\": 67777\n}\n```\n\n### DELETE magic/modules/anarq/licks/lick\n\nDeletes a previously created like for either an OP post or a comment. The endpoint can only be invoked by a\nuser having previously liked a comment or an OP post. The endpoint requires one single QUERY parameter\nbeing `id`, which is the ID for the comment, and/or post the user previously liked.\n\n### GET magic/modules/anarq/licks/likers\n\nReturns all usernames for all users that liked a specific comment or an OP posting as an array of strings.\n\n## Topics\n\nThis section contains everything related to managing and administrating topics in the system.\n\n### POST magic/modules/anarq/topics/topic\n\nThis will create a new topic in your site, and takes a payload resembling the following.\n\n```json\n{\n  \"name\": \"topic_name\",\n  \"description\": \"This is the descriptive text explaining what your topic is about\"\n}\n```\n\nName being the primary key for your topic.\n\n### PUT magic/modules/anarq/topics/topic\n\nThis will update the description of an existing topic. Notice, you cannot update the name after creating your topic,\nonly its description. It requires a payload resembling the following.\n\n```json\n{\n  \"name\": \"foo\",\n  \"description\": \"This is the NEW descriptive text explaining what your topic is about\"\n}\n```\n\n### DELETE magic/modules/anarq/topics/topic\n\nThis will delete an existing topic in the system. Notice, the topic cannot have any posts, or the\ndeletion will fail. It takes one single parameter, being the name of the topic.\n\n### GET magic/modules/anarq/topics/topics\n\nReturns all topics that exists in the system, together with how many posts topic has, and when the\nlast activity within the topic was. Notice, this endpoint is cached, but there's another endpoint\nthat is not cached.\n\n### GET magic/modules/anarq/topics/topics-no-cache\n\nReturns all topics that exists in the system, together with how many posts topic has, and when the\nlast activity within the topic was. Notice, this endpoint is not cached.\n\n## Admin\n\nThis section contains parts needed to administrate your backend, such as moderating posts or comments,\nblocking users, etc.\n\n### DELETE magic/modules/anarq/admin/comment\n\nThis endpoint allows you to hard delete a comment. Notice, the endpoint can only be invoked by a root or an\nadmin account, and _physically deletes_ the comment from your database. As an alternative, you might consider\nsimply invoking the `moderate` endpoint, which only marks the post or comment as moderated instead of physically\ndeleting it from your database. The endpoint takes one QUERY parameter named `id`, being the id of the comment\nyou want to delete.\n\n**Warning** - Deleting a comment will also recursively _delete all descendant comments_ beneath the comment you're\ncurrently deleting, while moderating a comment will keep all descendant comments.\n\n### DELETE magic/modules/anarq/admin/post\n\nThis endpoint will perform a _hard delete_ of an OP post from your database, and requires one QUERY parameter named `id`.\nThe endpoint can only be invoked by an administrator.\n\n### DELETE magic/modules/anarq/admin/moderate-comment\n\nThis endpoint will moderate a comment, making it invisible on the site, but keep the actual data in your database,\nonly performing a _\"soft delete\"_. The endpoint requires one QUERY parameter named `id`, being the ID to the\ncomment you wish to moderate.\n\n### DELETE magic/modules/anarq/admin/moderate-post\n\nThis endpoint will moderate an OP post, making it invisible on the site, but keep the actual data in your database,\nonly performing a _\"soft delete\"_. The endpoint requires one QUERY parameter named `id`, being the ID to the\ncomment you wish to moderate.\n\n### DELETE magic/modules/anarq/admin/un-moderate-comment\n\nThis endpoint will un-moderate a comment, making it visible on the site. The endpoint requires one QUERY\nparameter named `id`, being the ID to the comment you wish to moderate.\n\n### DELETE magic/modules/anarq/admin/un-moderate-post\n\nThis endpoint will un-moderate an OP post, making it visible on the site. The endpoint requires one QUERY\nparameter named `id`, being the ID to the comment you wish to moderate.\n\n### DELETE magic/modules/anarq/admin/block-user\n\nThis endpoint will completely block a user from being able to interact with the backend. It requires\none QUERY parameter being the username of the user you want to block. Endpoint can only be invoked\nby an admin of the site.\n\n### DELETE magic/modules/anarq/admin/un-block-user\n\nThis endpoint will remove a block on a user from the backend. It requires\none QUERY parameter being the username of the user you want to un-block. Endpoint can only be invoked\nby an admin of the site.\n\n\n\n## User\n\nThis section allows you to admininstrate your users, and retreieve meta information associated\nwith users.\n\n### GET magic/modules/anarq/users/user\n\nThis endpoint returns profile information for the specified `username` QUERY parameter. The returned\nresponse might resemble the following.\n\n```json\n{\n  \"comments\": 5,\n  \"created\": \"2021-03-09T14:14:30.000Z\",\n  \"full_name\": \"Thomas Hansen\",\n  \"karma\": 7,\n  \"licks\": 14,\n  \"locked\": false,\n  \"posts\": 21,\n  \"roles\": [\n    \"guest\",\n    \"root\"\n  ]\n}\n```\n\n### GET magic/modules/anarq/users/users\n\nThis endpoint lists all users matching the specified QUERY parameters. Parameters you can use are as follows.\n\n* limit\n* offset\n\n### GET magic/modules/anarq/users/users-count\n\nReturns the number of registered users in the system.\n\n## Misc\n\nThese are miscelaneous endpoints, for things not specific to any of the above sections.\n\n### GET magic/modules/anarq/misc/donations\n\nReturns true if donations have been turned on for site in general.\n\n### POST magic/modules/anarq/misc/log-donation\n\nLogs a donation in the backend. Requires 3 QUERY parameters.\n\n* user - User that received the donation\n* donator - Email address of person donating\n* amount - Amount that was donated\n\n### GET magic/modules/anarq/misc/paypal-configuration\n\nReturns site wide PayPal configuration. Notice, this is *sitewide* configuration, and\nnot for individual users. It will return the PayPal ClientID associated with the site.\n\n### GET magic/modules/anarq/misc/tnc\n\nReturns Terms and Conditions for the site. This is a Markdown document you can find within\nthe folder structure of AnarQ module in the backend.\n\n## License\n\nAnarQ is licensed under the terms of the MIT license, but you will need a license of Magic to run it.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolterguy%2Fanarq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolterguy%2Fanarq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolterguy%2Fanarq/lists"}