Before there were nerds, before there was a Silicon Valley, there were Heathkits, which let tens of thousands of ambitious amateurs and aspiring engineers build their own radios, televisions and other electronic equipment.

But this month, after 45 years in the business, the Heath Company is closing out the last of its kits to concentrate on faster-selling home-improvement products and educational materials. Heath's kit sales have steadily declined since 1981, victims of reduced leisure time, declining prices that make it cheaper to buy fancy radios and electronic equipment than to build them, and the seduction of technically oriented consumers by personal computers.

If the end of Heathkits is on one level simply a sound business decision, on another it is also the passing of an American institution that fostered learning-by-doing in its finest form. As one-hour film processing displaces the home darkroom, and inscrutable fuel-injection systems stymie the sidewalk auto mechanic, so goes do-it-yourself electronics. Lost Art of Soldering

No more will fathers teach sons how to solder at the kitchen table. (Heathkit builders were more than 95 percent male.) No more will boys pass the Heath catalogue around like contraband during science class. And no more will proud Heathkit owners announce "I built that," when switching on the stereo.

Heath's phasing out its kits "leaves the amateur, like me, no place to turn," said former Senator Barry Goldwater, who used to fly to Heath's headquarters in Benton Harbor, Mich., twice a year in his private plane to buy kits.

"It's just that people today are getting terribly lazy, and they don't like to do anything they can pay someone else to do," said Mr. Goldwater, 83 years old, who has managed to wire up more than 100 Heathkits. "I think the current generation is certainly missing out."

It was not uncommon for Heathkit loyalists to exceed the 100 mark, and many say the amplifiers and other gear they assembled decades ago are still in daily use. Longtime Heath customers say they are saddened by the company's withdrawal from the kit business, and some are hoarding kits for their children or grandchildren to build.

Heath had a dozen or more competitors in its heyday, the mid-1960's, but it is the last large company to leave the kit business. Electronic do-it-yourselfers must now work from scratch, or from plans in magazines like Audio Amateur and Speaker Builder, a much more daunting process than assembling Heathkits, which were designed for people with at least a primary- school reading level and a good soldering gun.

William E. Johnson, Heath's president, said that the kit business had run head on into the "instant-gratification society," and that young people do not have the same interest in electronics as a hobby that their parents had. The company also found it increasingly difficult to offer kits of parts at prices competitive with assembled products of comparable quality from overseas. Heathkits used to cost about 30 percent less than assembled components.

Integrated circuits, where one chip takes the place of many separate components, have not only reduced the value added in the assembly process, but have also reduced the satisfaction to be had, Mr. Johnson said. "In the old days, you could look at a schematic and see a resistor here and a choke there," he said. "Now when you drop in one IC, you've dropped in 432 components, and the customer has no idea what is going on in there."

The average Heath customer had at least one college degree, but the kits were designed to be buildable by anyone with opposable thumbs. One did not need to know the difference between a resistor and a capacitor, only how to follow the step-by-step instructions and make a clean solder joint.

Nevertheless, Heathkits provided a hands-on introduction to electronics that could not be found in textbooks. By making the technology non-intimidating, Heath made it accessible to thousands of potential engineers. Hands-On Learning

"We all cut our teeth on Heathkits," said Lee Felsenstein, 46, who designed two early personal computers on permanent display at the Smithsonian and who was moderator of the Homebrew Computer Club, a seminal Silicon Valley hobbyists group, now defunct, from which sprang Apple Computer and other companies. He can still remember his first Heathkit: a vacuum tube voltmeter. "I learned how to read a schematic by looking at a Heathkit manual," he said.

"I didn't learn about electronics in school," said Mr. Felsenstein, who now works as a consultant in Berkeley, Calif. "An awful lot of us didn't. You learned by getting your hands in the technology." Heathkits let "you find out if you had the right stuff, as it were," he added.

But most of the people who built Heathkits were not electronics engineers, or even engineer-wannabes, a tribute to the quality of the company's instruction manuals. While a large Heathkit, like one for a color television or stereo amplifier, might have thousands of parts, they were added one at a time. In itself, each step was simple, marked with a pencil check in the manual to make sure nothing was left out. 'We Won't Let You Fail'