Do you recommend magic or melee for a souls beginner?
I usually play as a mage or archer in open world or CRPGs and don't pay much attention to resource management or min/max.
Not easy to answer.
I went with Astrologer first, which is basically the "Mage" of this game (at least when it comes to 'starting' class, that is, because later on any "class" can technically use any weapon types as long as enough points are allocated into the required attributes, by around Level 50 or so any starting melee-style class can have a "change of mind" and have enough points to start using a Staff with enough Intelligence; but imo that's counter-intuitive, I prefer to focus on what I started with and keep it that way for the remainder of the game).
At first, going Astrologer for me made most fights Vs regular enemies a lot more manageable than it was with my first character (who was a Hero class, which is focusing on Strength and melee, almost like a glass cannon melee). However, overall, it mostly depends on the actual type of enemy you're fighting (be it regular, mini-boss, or main boss). The type of attacks (range of attacks, animation speed of attacks, and their patterns) will ultimately determine if this or that particular enemy you're fighting happens to be an "Easy" (or easier) prey because you're attacking from range for being a Mage (or an Archer would also apply).
If you're Astrologer from the start, you can easily kill the first couple of human guards and soldiers on the roads and at the first few military encampments you'll get to. Most of them would want to go melee at you and swing their sword, or shield-bash you. Some of them do have crossbows and start from a distance, but if you close the gap enough they switch to their sword instead. So, in cases like this you'll have the 'First Hit' advantage (or more than just one hit actually).
But here's where things get potentially messy...
If enemies (at least early on in the first zone, Limgrave) are mostly melee-based, it doesn't mean that you won't have issues for being an Astrologer. That's because you WILL inevitably have to fight back, or defend yourself somehow once enemies DO get in melee range with you. You won't have infinite FP ("Mana") to cast your long range magic attacks forever. At some point you WILL have to switch to your sword or whatever else you're using as a "backup" melee weapon. Ideally you'll also want a Shield, because you're very physically frail at the start (almost all classes start like that anyway, honestly, everything hits like a truck at the beginning). As an Astrologer, for example again, you might have more Intelligence (DPS for Magic attacks) and Mind (the FP / Mana stat), but you'll lack in Vigor (HP) and Endurance (Stamina, which by the way is used to cast Magic attacks too, not just dodging around, so all classes need a decent amount of Endurance regardless of playstyles; you don't want to run out of Stamina too often).
The same principles apply to mini or main bosses. You might find SOME specific bosses "easier" than you thought because you were Ranged, sure. It does happen. But SOME specific other bosses (especially if they have a Shield and take a LOT less damage from frontal magic attacks) will practically laugh at your meager Magic attempts at them and proceed to cut your face in two in a matter of seconds. I've had my fare share of "Heh... this was much easier than I thought it would be", and "JESUS CHRIST ALMIGHTY WTF I just got 2-shoted to hell!!!" moments. It just depends who (or what) you're fighting really. There's no sort of 'universal' situations in this game where Ranged would always be inherently better than melee or vice versa. The opposite is true for builds that focus on Melee gameplay as well, they - too - will experience their fights against frail enemies that they'd kill in a few swings, but will also come across the occasional nemesis enemy types that give them problems exactly because they happen to be Melee instead of Range.
But... in general I'd say after experiencing the first 12 to 15 hours of the game two times with two completely different builds (Hero first, then Astrologer) that going with a Ranged build - for the beginning of the game at least, up to a certain point - does make most early encounters more forgiving and more manageable. With the only "issue" of running out of Stamina often early on, so at least keep an eye on your Stamina regularly during fights and memorize the number of attacks you can do before running out, and memorize how many dodges in a row you can perform as well, it's important enough. If you just spend and spend and spend blindly without thinking about it you'll run out of it very often and hit a lot of roadblocks during fights. You need to do a little bit of micro management with your Stats, available Stamina (and Vigor) and see how long you normally last in a fight and if it's a long-lasting fight, how long can you afford fighting until you run out of FP (Mana) and FP Potions as well (which is another thing you need to keep in mind, which is the Allocation of the number of HP Potions Vs FP Potions you want to bring with you; which you can change all the time at Sites of Grace for free, which is a Godsend for everyone).