THREE years ago Joanne Rowling landed in Edinburgh with a baby under one arm and a dog-eared manuscript under the other. Apart from the proverbial battered suitcase, she owned nothing else.

''This book saved my sanity. Apart from my sister I knew nobody. I've never been more broke and the little I had saved went on baby gear. In the wake of my marriage, having worked all my life, I was suddenly an unemployed single parent in a grotty little flat. The manuscript was the only thing I had going for me.''

Rowling recounts those dark days as she sits in a sunlit cafe in Nicolson Street, and already they have an aura of long long ago. In the previous few days two American publishing houses had been bidding for the American rights to that manuscript, now her first book, Harry Potter and the Philosopher's Stone, published in Britain this week by Bloomsbury at #4.50. The bidding was well into six figures.

Dollars not pounds, says Rowling in that sort of wysiwyg (what you see is what you get) manner which also characterises her writing. OK, but this is still very big bucks indeed for a first book, a children's one at that, written by a lone mum for whom less than three months ago, the prospect of a #2500 grant from the Scottish Arts Council was manna from heaven.

In fact, once the SAC had seen the manuscript it offered her #8000, which is the highest grant ever given to a children's writer.

If this sounds like the stuff of fantasy, it is and it isn't. Joanne's own story is for real, even if just now it feels like a dream she is afraid to wake from. Harry Potter's story is a fantasy but one leavened with enough everyday life to give it an authentic feel.

She came up with the plot during a train journey in 1990. ''Trains have been quite important in my life. My parents met on a train.'' The hero, Harry, has been orphaned under mysterious circumstances which have left him with a lightning-shaped scar on his forehead. He's sent to live with his odious uncle and aunt and their fat, spoiled son. But a bizarre letter, delivered by an owl (well, aren't they always!?), sets him on the road - no, the railway track - that leads to Hogwarts School of Wizardry and Witchcraft, which Rowling has always imagined is in Scotland.

At Hogwarts he finds himself something of a celebrity and discovers that his parents had been very important in wizarding circles. There follows a series of adventures which are fantastic in both senses: smuggling a baby dragon; mastering Quidditch, a three-dimensional game played on broomsticks; tackling a giant troll, and

finally embarking on a desperate and dangerous search for the vital Philosopher's Stone.

Harry is completely believable and redolent of various Roald Dahl characters, especially Charlie Buckett and Matilda. The cinematic effects which brought the latter to life most successfully could do the same for Potter. Most of the characters are pure caricature but Rowling admits Harry's clever-clogs classmate, Hermione, is a self portrait. ''She's very like I was at 11 - on the surface a proper little smart ass but underneath quite

insecure.'' Recently Joanne was surprised to be asked how she felt about producing a fantasy when the Carnegie shortlist was full of sordid realism.

''I think kids need a bit of escap-ism, but I don't think Harry Potter is divorced from reality.'' I suggest that this essentially is a book about power and this delights her.

''Yes. Absolutely. Kids are so powerless, however happy they are. The idea that we could have a child who escapes from the confines of the adult world and goes somewhere where he has power, both literally and metaphorically, really appealed to me.

''It's a traditional theme: the idea of the foundling and the mysterious hidden destiny, but this concept of breaking out is a common fantasy for kids.''

The book is also about the abuse of power, most obviously in the ''dark'' wizard, whose name is too terrible to be uttered. But also in the character of Draco Malfoy, the school bully. With renewed concern about bullying in Scottish schools, Harry Potter would make an excellent text for project work for those aged nine to 13.

Part of the book's readability comes from its humorous descriptions and dialogue. The sympathetic headmaster, Dumbledore, has a scar on his left knee ''which is a perfect map of the London Underground''. The awful Uncle Vernon's face ''went from red to green faster than a set of traffic lights'' when Harry gets his first owlergramme. At Hogwarts, where everyone is crazy about Quidditch, a solitary West Ham supporter is ridiculed by a young wizard: ''Ron couldn't see what was exciting about a game with only one ball where no one was allowed to fly.''

Lindsey Fraser of Book Trust Scotland says she hasn't enjoyed a first novel so much since Brian Jacques and can't wait for the sequel, due out next year. ''It's far more than just comedy. It's a full-throttle adventure story with a timeless quality children will love,'' says Fraser. It will feature in the Trust's Now Read On promotion in Scottish libraries.

I tried out the book on my 11-year-old daughter Laura, a giddy extrovert, and 12-year-old Jill Allardice, a very bright but much shyer girl. Both put Harry Potter in the top five books they had ever read.

Jill said: ''The story gripped me from the first page and if my parents hadn't made me go to bed I would have read it in one go. It's like an imagination in overdrive.''

In fact if there is a downside to Rowling's story it is the distinct danger she will be called ''The New Roald Dahl'', which would be an albatross around her slender shoulders.

Joanne's first book was about a rabbit called Rabbit. ''I was about six and I haven't stopped scribbling since, but this is the first time I'd tried to get anything published.'' She received ''a soft rejection'' from Penguin. ''I had to send it to one publisher at a time because I couldn't afford the photocopying.''

Then the agent Christopher Little agreed to take her on and sold Harry Potter to Bloomsbury. ''They've been fantastic. They've edited it very sensitively and the few places they wanted me to prune it are the better for it.''

For a first novel it's remarkably seamless, as if written in a single torrent of creativity. The reality is the opposite. She came up with the idea of the Philosopher's Stone, with its power to restore and immortalise its owner, during her brief, ill-fated marriage in Portugal.

Back in Edinburgh she set about carving a book out of ''an incoherent mass of adventures'' using the stone as the central theme.

''I used to go round with Jessica in the buggy and when-ever she fell asleep I knew I had about an hour and a half, so I'd dash to the nearest cafe and write like fury.''

Now she has the money and all the time in the world to write, she feels daunted at the prospect. ''I'm so used to squeezing in my writing and I'm not sure I can cope with acres of time.'' She's even considering going back to teaching French, the part-time job which kept her afloat until the SAC grant.

Just now she's putting the finishing touches to the sequel. ''Don't ask me if they work. I'm too close to them.''

If Joanne is having trouble coming to terms with herself as an author, Jessica, now aged four, has no doubts. Recently the two of them were looking at a book about the jobs people do. ''And what do mummies do?'' inquired Joanne, anticipating a mundane answer about cooking and washing-up. ''Mummies,'' said Jessica without hesitation, ''Mummies write!''