Skip to content

dictu-lang/Web-Framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wanbli

For a more up-to-date version please see Wanbli

Dictu Web Framework

This is a proof of concept web framework heavily inspired from https://expressjs.com/.

Note: This is NOT production ready.

Features

This project is currently setup to have 4 routes. /, /login, /logout and /home.

  • / - GET
    • This route is the login page for the system, it has an incredibly basic login form located in static/views/index.html.
  • /login - POST
    • This is the route that handles logging a user in. Users are logged in by their session containing a "logged_in" flag, if this is false or not present, they will not be logged in.
  • /logout - GET
    • This sets the "logged_in" session flag to false.
  • /home - GET
    • This is a protected route that can only be accessed when the "logged_in" flag is present within the users session.

Technical details

The users session is stored within HTTP Only a cookie within the users browser and because of this, they must be signed. They are signed with HMAC-SHA256 and verified on every request to ensure there has been no tampering.

Users themselves are stored within a SQLite database (more in the next section) in a very basic username | password table setup. The users password are hashed using bcrypt.

Running

To get up and running we must first create the SQLite database and seed a user, to do so run setup.du

$ dictu setup.du

This will ask you where the SQLite database should be stored, for this project enter users.db along with a username and password of your choice.

Afterwards start the server

$ dictu run.du

Alternative

To see a more "verbose" framework where you would setup defined controllers along with their routes in a more organised manner see the verbose-routing branch.

About

Initial proof of concept webserver written in Dictu

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages