Jimbru
A lightweight analytics server with FastAPI and deta.sh Base as DB. A glorified hit-counter of sorts π
Install / Use
/learn @athul/JimbruREADME
IMPORTANT: There seems to be an error in deploying this, planning for a rewrite of the whole.
Jimbru
Jimbru is an Privacy Oriented web analytics Server which is built with FastAPI and Deta Base as DB.
Jimbru is heavily inspired by Shynet which is also an Analytics server built with Django.
Not for Production Level use. It's hacky to the core. I made it for a Personal Use and doesn't have any fancy features.
Features
- Lightweight
- Privacy Oriented
- Easily Deployable (on deta.sh)
- 6 lines of JS code gets the current URL, referrer and load time.
- Charts with Frappe Charts π
- Jinja2 Templating and Tailwind CSS for Frontend
- Cookie based Authentication
- User OS and device from
user-agentheader - user location and network from user ip header
Not Included Features
- Caching
- Bounce rate
- Session Time
- Unique Hits
Demo

Deploying
Before deploying you need to get some Credentials
Prep Work
-
Signup for an account in https://deta.sh
-
Create a new Project
-
Get the Project Key and save it in the
.envfile as below -
Install the Deta cli. This is for deploying to Deta.
-
Create a
.envfile inside theapp/routesdirectory with the following keysTITLE=<title of the site> DOMAIN=<domain of the deployed server> PKEY=<Deta Project Key> PNAME=<Deta Base DB Name> SECRET_JWT=<Secret for JWT. Get than withβ import os; print(os.urandom(24).hex())> USERNAME=<username for authenticating> PASSWORD=<password for authenticating>
The
PNAMEcan be anything.
- Fork/Clone this Repository
- You can run the code locally by installing the dependencies inside the
appdirectory and runninguvicorn main:app --reloadinside theappdirectory. - Inside the
appdirectory you can create a new Micro with$ deta new. This will create a new Micro. You will get the domian from the output of the command. Save that domain in theDOMAINkey in the.envfile, without a trailing/. - Run
$ deta update -e routes/.envto update the environment variables in the micro. - Run
$ deta deployinside the app directory and the code will be deployed. - Profit
Usage
Add a <script> tag for the site
<script src="https://<DOMAIN>/a.js" type="text/javascript"></script>
TODO
- [ ] Caching
- [ ] Better Auth
- [ ] Session Time
LICENSE
MIT
