{"id":16971579,"url":"https://github.com/thomastjdev/nim_webframework","last_synced_at":"2025-03-21T20:16:21.788Z","repository":{"id":87657540,"uuid":"162888003","full_name":"ThomasTJdev/nim_webframework","owner":"ThomasTJdev","description":"Framework for creating websites with Nim","archived":false,"fork":false,"pushed_at":"2018-12-24T13:51:12.000Z","size":95,"stargazers_count":6,"open_issues_count":3,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-26T14:48:37.969Z","etag":null,"topics":["framework","nim","nim-lang","webframework","website","website-builder"],"latest_commit_sha":null,"homepage":null,"language":"Nim","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/ThomasTJdev.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}},"created_at":"2018-12-23T12:16:29.000Z","updated_at":"2022-04-21T05:40:56.000Z","dependencies_parsed_at":"2023-03-13T18:40:18.457Z","dependency_job_id":null,"html_url":"https://github.com/ThomasTJdev/nim_webframework","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/ThomasTJdev%2Fnim_webframework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasTJdev%2Fnim_webframework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasTJdev%2Fnim_webframework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasTJdev%2Fnim_webframework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThomasTJdev","download_url":"https://codeload.github.com/ThomasTJdev/nim_webframework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244860611,"owners_count":20522466,"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":["framework","nim","nim-lang","webframework","website","website-builder"],"created_at":"2024-10-14T00:52:46.468Z","updated_at":"2025-03-21T20:16:21.698Z","avatar_url":"https://github.com/ThomasTJdev.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nim Webframework\n\nThis library provides a quick webpage setup. The main purpose is to provide a website frame with administration of users.\n\n# First run\n\n## Step 1\nRename **config/config_default.cfg** to **config/config.cfg** and insert your details and compile:\n\n```nim\nnim c -d:ssl websiteframework.nim\n```\n\n## Step 2\nYou need to create a database, append the arg \"**createdb**\". The library is prepared for Postgres - if you prefer SQLite, replace the import of `db_postgres` with `db_sqlite`.\n\n```nim\n./websiteframework createdb\n```\n\n## Step 3\nTo create an Admin account, append the arg \"**createadmin**\". Type your details and login.\n\n```nim\n./websiteframework createadmin\n```\n\n## Step 4\nNavigate to `127.0.0.1:5000/login` and login.\n\n```nim\n./websiteframework\n```\n\n# User administration\n\n## Modules\nThe framework comes with the following user administration:\n1. View all users\n2. Add user\n3. Edit user\n4. Delete user\n5. Reset password\n\n## User roles\nThere are 4 main user roles, 2 alternative and 1 system administrator:\n1. Admin\n2. Moderator\n3. User\n4. Viewer\n5. EmailUnconfirmed\n6. Deactivated\n7. AdminSys *(only for maintenance)*\n\n# Company structure\nThe framework is prepared for multiple different companies using the simultaneously but compartmentalized. The is done with the table `person_access`. When a user get access to a company, a row is added to this table.\n\nTherefore a user can have access to multiple companies using the same email address. If the user has access to more than 1 company, the user needs to choose the company to access on login.\n\nIf there's only going to be 1 company accessing the platform, you don't have to mind the above.\n\n\n## Add and edit companies\nIt is only the `AdminSys` who can edit and see all companies.\n\nNavigate to `/adminsys/company/all` to manage the companies.\n\n\n# Personalize\n\n## General\n\nTo add pages you have to add a template (tmpl/\\*.tmpl) and define a route (routes/\\*.nim).\n\nLet's create a new About page.\n\n### New route\n\nOpen `resources/routes/routes_general.nim` and insert:\n```nim\n  get \"/about\":\n    createTFD()\n    if not c.loggedIn:\n      resp genMain(c, genFormLogin(c, redirectPath=c.req.path), \"Log in\")\n    else:\n      resp genMain(c, genAbout(c), \"About\")\n```\n\n### Create HTML\n\nAdd a new file: `resources/tmpl/about.tmpl` and insert:\n```nim\n#? stdtmpl | standard\n#\n#proc genAbout(c: var TData): string =\n# result = \"\"\n\u003ch1\u003eAbout me\u003c/h1\u003e\n\u003cp\u003eHello world\u003c/p\u003e\n#end proc\n```\n\n### Config sidebar\n\nOpen `resources/tmpl/sidebar.tmpl` and insert a new link:\n```HTML\n\u003cli\u003e\n  \u003ca href=\"/about\"\u003eAbout\u003c/a\u003e\n\u003c/li\u003e\n```\n\n### Let's test it\n\n```nim\nnim c -r -d:ssl websiteframework.nim\n\n#Navigate to `127.0.0.1:5000/about`\n```\n\n# Screenshot\n![logo](/public/images/screenshots/screen1.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomastjdev%2Fnim_webframework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomastjdev%2Fnim_webframework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomastjdev%2Fnim_webframework/lists"}