Nicd

Nicd

Codestats.net - made with Elixir + Phoenix

I hope this is ok to share in this section. :slight_smile:

I have made a coding statistics website with Elixir and Phoenix. The basic idea is that when you write code, you get experience points and then you level up (like in an RPG). You can see how much you have “experience” in different languages and on different machines you use. It’s open source and free to use. Currently only Atom editor and JetBrains IDEs are supported (the API is documented, though, if you want to add editor support!).

Here is the index page: https://codestats.net/ and as an example, here is my profile page: https://codestats.net/users/Nicd.

It is a pretty standard Phoenix website. I use ETS for caching some data locally (it runs on one node) and store per-user cached data using PostgreSQL’s JSON field. Both profile pages and the index page are live updated while you code using Phoenix channels, and Elm in the frontend (it looks roughly like this, though the index page UI has since changed a bit).

In the future I plan to add more different statistics and other fun features.

All the code is licensed under 3-clause BSD, you can find the sources for the site, Atom plugin and JetBrains plugin respectively here:

It’s my second ever production Phoenix site, and first ever Elm project, Atom plugin and JetBrains plugin, so the code will reflect that. I would appreciate any feedback so I can become better. :slight_smile:

First Post!

OvermindDL1

OvermindDL1

Heh, looks nice, although being able to log in with google and/or github (especially github) would be more logical given the site purpose? :slight_smile:

Github has a good API too, though slow it is.

EDIT: Also, how easy is it to game? Might be more accurate to parse over git commits instead for lines changed and so forth? Still gameable but not as easy?

Most Liked

Nicd

Nicd

So after about 1.5 years in production, Code::Stats has just passed the 1000 user mark and we’re working on improving it. :slight_smile:

Since the first post, we have added integrations for Sublime Text 3, Visual Studio Code, Visual Studio (still some bugs to iron out), and Zsh. We also have a plugin in the works for Vim - if you’d like to help test it, you can contact us on our Gitter, Matrix, or IRC channels.

On the website side we’re working on a 2.0 version that will have a complete UI rewrite with RE:DOM (in place of Elm) and CSS Grid. The backend is updated to Phoenix 1.3 and refactored into a context-ish style (still learning this). Currently I’m working on a new profile API using GraphQL via Absinthe.

Of course it’s still all free to use and open source. :slight_smile: The sources have moved to GitLab, so you can follow our progress here: CodeStats · GitLab

Nicd

Nicd

6 years on, Code::Stats is still there and being updated. I just pushed release 2.3.0 (and 2.3.1 to fix issues) that has “flow state” tracking that tries to measure how much time you spent in a coding flow, i.e. a very focused state.

The profile page was rewritten in Phoenix LiveView, so I don’t have to spend time writing APIs and duplicate code for the frontend live updates. It was a great feeling getting to delete all those JS files! Chart.js still remains for rendering a couple of more complex charts. You can see the new profile page here: Nicd – Code::Stats

This version also birthed one Hex package, to get colours of programming languages to display in the charts: LanguageColours - Get colours for programming languages

Everything is still (and will be!) open source, so feel free to check it out. But of course it has been evolving for 6 years now and I was a much worse Elixir programmer back then, so it’s a mish mash of different styles and different experiments… :slight_smile:

Nicd

Nicd

We now have Vim support! It has been tested by a couple of people but I’m not a Vim user so if you have issues, please report them to us. :slight_smile:

Where Next?

Popular in Discussions Top

AstonJ
Are there any Elixir or Erlang libraries that help with this? I’ve been thinking how streaming services like twitch have exploded recentl...
New
AlexMcConnell
The reason that Rails is as popular as it is is because it’s very easy for relatively inexperienced developers to get a lot of work done....
588 20142 166
New
rower687
Hi all, I’ve been reading a lot about the “let it crash” term and how supervising processes and the whole messaging passing make an elixi...
New
joeerl
I’m playing with Elixir - It’s fun. I think @rvirding does give Elixir courses these days. Re: files and database - when I given Erlang ...
New
MarioFlach
Hello, I want to share a project I’ve been working on for a while: https://github.com/almightycouch/gitgud Background Some time ago I ...
New
lucaong
Hello Elixir and Nerves community, I have been working for a while on an open-source embedded key-value database for Elixir, that I call...
230 14403 124
New
marciol
Please, let me know if this kind of discussion already took place in another topic . Hi all, how do you consider if is better to build ...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44778 311
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement