Skip to content

NaviTheCoderboi/vivid

Repository files navigation

Vivid

Library Logo

Vivid → A toy web framework made by me for learning purpose.

Code style: black GitHub last commit GitHub stars

Installation

To install Vivid library, open a command line then write things those are below

python -m pip install git+https://github.com/NaviTheCoderboi/vivid.git

If the top command isn't working, try this one

python3 -m pip install git+https://github.com/NaviTheCoderboi/vivid.git

Start quickly by creating project

To create a Vivid project you need to open a command line and type below command

python -m vivid init ...

Note

Don't forget to replace ... with your project name

walkthrough

You can load data on server using this server, make a .py file named same as template file in /server directory. you need to export a load function which returns a response, below is given an example load function

for example index.py

from vivid.app import Response

async def load():
    return Response(200,[], { "name": "John" })

Note

You have to use jinja3.x syntax for templating, Here's jinja docs for more information.

Example template

Here is an example template index.html

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
		<link rel="stylesheet" href="../styles/index.css" />
	</head>
	<body>
		<h1>Hello {{ name }}</h1>
		<script src="../scripts/index.js"></script>
	</body>
</html>

contributing

Everyone is free to fork and contribute to this project, hope this framework becomes a success!

Made with ♥ by NaviTheCoderboi

About

A toy webframework made by me for learning purpose

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages