Nicd

Nicd

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:

Showing Posts 1 to 10

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?

Nicd

Nicd OP

Thanks! :slight_smile: That is true, but it’s not high on my priority list currently. Registering is very easy as you only need a username and password, but I admit many people would like to use some other site’s accounts too. I will add an issue about it but I cannot say when I can take up on it.

Very easy! Just send a request to the API with a million points. It’s not easy to make it cheater proof so I have adopted the stance that if you want to mess up your own statistics, it’s your own shame. Of course that will mess up the index page in its current version, but if that happens I will figure out something different to show there.

If you really wanted to cheat, creating lots of git commits wouldn’t be an issue either. Using git commits would have a downside though, you would maybe only get feedback at the end of the day. And then maybe you add some big file in the commit with thousands of lines that you didn’t write and you get lots of meaningless points. On the other hand all those changes and iterations that didn’t end up in the commit wouldn’t be counted. Maybe not all code even ends up in a repository. That’s why it’s integrated with the editor.

Thanks for the suggestions!

OvermindDL1

OvermindDL1

I had the same site idea a long while back but could not figure out an easy way to fix those points I brought up too. ^.^

Oxyrus

Oxyrus

Seems like a nice project, I wouldn’t be able to think about something similar, it’s pretty interesting. I’d like to see a plugin for ST3 and Emacs :slight_smile:

Cheers.

Red

Red

Just curious, how many active users do you have?

Nicd

Nicd OP

At the moment, 220.

AstonJ

AstonJ

Nice one! Looks neat :023:

If you get a minute, please do a write-up on you Elm-Elixir experience - there is certainly a lot of love for Elm in the Elixir community :slight_smile:

Nicd

Nicd OP

Elm was… interesting. I have never used Haskell or another ML and Elixir was my first functional language. So it took me a while to really grok the Elm syntax and what was happening. I still have only a faint idea about some of the things but most of it is clear now.

It lived up to its reputation in that when my frontend apps finally compiled, they really did work as expected. I didn’t really get to enjoy any productivity boosts from that though, since doing anything was very very slow (but it was my first try ever). I liked the builtin virtual DOM library, but I was kind of disappointed that it’s not possible to have Elm parse the existing DOM and change that (have to render the whole thing from scratch).

All in all it was a fun learning experience and I look forward to seeing how it develops.

Nicd

Nicd OP

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 OP

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? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 92995 915
New
AstonJ
The obligatory hello world thread! Who are you and where are you from? :stuck_out_tongue:
4616 55835 594
New
caslu
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
New
arcanemachine
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
matt-savvy
Is there a word for the ~> symbol used in Version strings? Do you also just call it a Squiggle Arrow™ ?!
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
aseigo
ICal is a library for interacting with iCalendar data. It parses iCalendars into typed Elixir structs via ICal.from_ics, and can prepare ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews