Here are some questions that should be asked when designing any web-mapping app. The questions are inter-related, in that the answers to either will affect the others.
- What is the purpose of the map/application?
- Who is the intended audience?
- What capabilities need to be included in the application, e.g.
- can users edit features;
- is a buffer tool needed;
- is a zoom slider sufficient or does the audience expect/require zoom boxes?
- What browsers/platforms need to be supported? (note that this isn't as relevant to your question, since you've specified the JS API)
- What basemaps and feature data will be shown?
- Where will the data come from and are the data services available to the environment where the application will be hosted (e.g. intranet vs. public internet)?
Here are some other questions specific to a JS API.
- Is the web-map going to be part of an application that is built in a different JS framework, e.g. jQuery or EXT JS? If so, what extra work will be needed, or considerations will need to be made?
- Will it be suitable to call the API from ESRI's servers, or should it be served locally from the application's servers?
Your question is vague so it's hard to know where to start or when to stop but here are some things I wish I did when I started my project.
- Decide if OpenLayers is a better choice
- Get a good understanding of dojo
- Build unit tests from the beginning
- Create an automated build process
- Avoid the temptation of putting everything in one js file
- Locate the JSAPI examples and become familiar with them
- Download JSAPI locally and beautify it...it's still a nightmare but it helps