A modern Nuxt application with content management capabilities.
- Install dependencies:
npm install- Start development server:
npm run dev- Build for production:
npm run buildThis project is configured to deploy automatically to Timeweb shared hosting via GitHub Actions when you push to the main branch.
Push to GitHub → GitHub Actions builds → rsync to Timeweb → PM2 restart
Configure these secrets in your GitHub repository (Settings → Secrets and variables → Actions):
| Secret | Description | Example |
|---|---|---|
TIMEWEB_HOST |
Server hostname or IP | s123.timeweb.ru |
TIMEWEB_USER |
SSH username | u1234567 |
TIMEWEB_SSH_KEY |
Private SSH key (entire content) | -----BEGIN OPENSSH... |
TIMEWEB_PATH |
Deployment path on server | /home/u1234567/aoopt-web |
TIMEWEB_PM2_NAME |
PM2 process name | aoopt-web |
- SSH into your Timeweb server:
- Create the project directory and clone (first time only):
mkdir -p ~/aoopt-web
cd ~/aoopt-web- Create a
.envfile with environment variables:
cat > .env << 'EOF'
STUDIO_GITHUB_CLIENT_ID=your_github_oauth_client_id
STUDIO_GITHUB_CLIENT_SECRET=your_github_oauth_client_secret
# NUXT_APP_BASE_URL=/ # Uncomment if deploying to a sub-path
EOF- After the first GitHub Actions deploy, start PM2:
cd ~/aoopt-web
pm2 start .output/server/index.mjs --name "aoopt-web"
pm2 save
pm2 startup # Follow instructions to enable auto-start- Generate a new SSH key pair (on your local machine):
ssh-keygen -t ed25519 -f timeweb_deploy -C "github-actions-deploy"- Add the public key to Timeweb server:
ssh-copy-id -i timeweb_deploy.pub [email protected]- Copy the private key content and add it as
TIMEWEB_SSH_KEYsecret in GitHub.
If you need to deploy manually:
npm run build
rsync -avz --delete .output/ user@server:~/aoopt-web/.output/
ssh user@server "cd ~/aoopt-web && pm2 restart aoopt-web"This project uses nuxt-studio (alpha) to edit content/ in production and publish changes back to GitHub.
Nuxt Studio's OAuth callback route is:
__nuxt_studio/auth/github
For https://your-domain.ru, set your OAuth app callback to:
https://your-domain.ru/__nuxt_studio/auth/github
Then set these environment variables on your server (in .env):
STUDIO_GITHUB_CLIENT_IDSTUDIO_GITHUB_CLIENT_SECRET
If you see an error like:
[POST] "https://api.github.com/repos/<owner>/<repo>/git/blobs": 404
Checklist:
- Logged-in account: Make sure you're signed into Studio with a GitHub user that has write access to the target repo/branch.
- Org restrictions: If the repo is under a GitHub Organization with OAuth restrictions, grant the OAuth app access to that org.
- Session sanity check: Open
https://<your-site>/__nuxt_studio/auth/sessionto confirm which user is active.
app/- Application codepages/- Vue page components (auto-routed)components/- Reusable Vue componentscomposables/- Composable functions for shared logictypes/- TypeScript type definitions and interfaceslayouts/- Layout templates
content/- Markdown content filespublic/- Static assetsnuxt.config.ts- Nuxt configuration
- Nuxt 4.2.1
- Vue 3.5.25
- TypeScript
- @nuxt/content
- @nuxt/studio
- Tailwind CSS