This study comprises 3 parts which are designed as an open-label, active-control study. In each year, the participants in the experimental arm receive app-assisted CBT-I. In the first year, participants with primary insomnia are recruited and assigned to the experimental arm or the active-control arm with matched age, gender and education status. The subject number in each arm is 20. Participants in each arm receive a 6-week standard CBT-I. In the experimental arm, the participants use electronic sleep diary and message reminder to record sleep pattern. In the active-control group, the participants use traditional paper-pencil sleep diary instead. In the second year, participants with primary insomnia are recruited and assigned to the experimental arm or the active-control arm with matched age, gender and education status. The subject number in each arm is 20. Participants in each arm receive a 6-week standard CBT-I. In the experimental arm, the participants use app with function of social persuasion to encourage each other. In the active-control group, no social persuasion is given beyond the treatment sessions. In the third year, participants with comorbid depressive disorder and insomnia are recruited and assigned to the experimental arm or the active-control arm with matched age, gender and education status. The subject number in each arm is 20. Participants in each arm receive a 6-week standard CBT-I. In the experimental arm, the participants use app module that provides a multi-media assisted Tai-Chi video to practice Tai-Chi. In the active-control group, a traditional Tai-CHi teaching digital video disc is provided to help the participants practice Tai-Chi.