Samir70 / maths-elo

A place to revise maths while getting a rating for your ability
https://samir70.github.io/maths-elo/
1 stars 0 forks source link

Push Branch From IndieWeb Hacking #1

Open richdouglasevans opened 4 years ago

richdouglasevans commented 4 years ago

Hi Samir,

Can you push the branch that you were working on during the IndieWebCamp? I'd like to hack around with it 'cos it looks interesting.

Cheers!

Samir70 commented 4 years ago

Hi, Rich. Sorry, I've just seen this. Do you mean the bit where I was saving content? I have pushed a branch where I add node. But I'm actually thinking of doing the backend in a seperate repo: https://github.com/Samir70/maths-elo-api (half-term now, so I might actually get a chance to make some progress!) At the moment you only see success in the network tab of the browser developer tools.

Samir70 commented 4 years ago

I've added an sqlite database to the api repo, it can be read and updated. I will drop the stuff I did in Oxford (it was really just practise to get access to a backend that could write to disk). Having a database was always the goal.

richdouglasevans commented 4 years ago

Awesome, nice one Samir.

I'll fork this. If there's a specific bit of it that you want contributions for then raise an issue. (And if you're cool hacking alone that's fine too.)

Samir70 commented 4 years ago

I have copied the UI from here to the api repo -- I'll continue to work on the UI there.

I have managed to host it on Heroku: https://math-elo-api.herokuapp.com/ and it connects to the backend, I can see the database update: https://math-elo-api.herokuapp.com/qratings/all but I need to host the database elsewhere. Heroku uses dynos with an "ephemeral filesystem". The changes don't persist.

One of the things we discussed in Oxford is getting my own website. I would like one place where I can have my server, database and even unrelated projects.

richdouglasevans commented 4 years ago

🎉 Nice!

I just had a play and answered some questions. I haven't done multiplication by hand for years: I thought it'd be cheating to use the calculator.

I really dig the "micro" focus: I have a similar vibe going for learning Sanskrit. Really small "micro-materials" with just a single focus.

One of the things we discussed in Oxford is getting my own website. I would like one place where I can have my server, database and even unrelated projects.

There are lashings of domain names around "elo" and "math" and "science" available in the range £10-20 annually.

I can help with that if you like. (Doesn't have to be via Google Domains if you don't wanna use Google stuff.)

I need to host the database elsewhere.

You could continue to use Heroku with their Postgres offering. It's free level limits the amount of data and DB connections, but it's likely sufficient for this app's development needs. (It looks like there's one table with a few columns.)

The code changes to use this as opposed to sqlite are relatively minor and you could continue to use sqlite locally while developing. I can help with that if you like.

It'd also be good to make the app responsive: the answer box looks like it disappears when I look at the app on my phone. I can also help with that. (Not trying to be pushy here: I just like the thrust of what you're doing here.)

What do you call a line [that] cuts across a circle, but not necessarily through the centre?

Whew. Uh 😰 No, you got me 😊 Time to go back to the classroom.

Samir70 commented 4 years ago

I have switched to postgresql. The app uses the heroku database in development as well as production. Not ideal, because I don't want every test I do to affect the 'real' database. So I will chanage that. Especially since it needs a .env file that git ignores. So people who clone the repo won't be able to get it working that way.

But the working version is on heroku. I'll know if the data persists tomorrow.

I will still look into hosting. SQLite was easier! But it's the past as far as this project is concerned.

Samir70 commented 4 years ago

I have set up the node app so it uses sqlite in develoopment, and heroku's postgresql in production.

richdouglasevans commented 4 years ago

Nice one Samir! 🎉 That makes for a much easier local development experience 👍

Samir70 commented 4 years ago

I will start getting to work on the things you listed above. I will make issues on the other other repo though, since that is the main one. The typo you highlighted I will make as a beginner issue. I'm going to a meet up on Saturday in London. There might be someone there who would like to be talked through using github to contribute to someone else's repo.