|
| 1 | +# Quick Start Guide |
| 2 | + |
| 3 | +## First Time Setup |
| 4 | + |
| 5 | +### 1. Generate Secrets |
| 6 | + |
| 7 | +Before running the CMS for the first time, you need to generate secure secrets. Run this command from the `cms` directory: |
| 8 | + |
| 9 | +```bash |
| 10 | +node -e "console.log('APP_KEYS=' + Array(4).fill(0).map(() => require('crypto').randomBytes(16).toString('base64')).join(','))" |
| 11 | +node -e "console.log('API_TOKEN_SALT=' + require('crypto').randomBytes(16).toString('base64'))" |
| 12 | +node -e "console.log('ADMIN_JWT_SECRET=' + require('crypto').randomBytes(16).toString('base64'))" |
| 13 | +node -e "console.log('TRANSFER_TOKEN_SALT=' + require('crypto').randomBytes(16).toString('base64'))" |
| 14 | +node -e "console.log('JWT_SECRET=' + require('crypto').randomBytes(16).toString('base64'))" |
| 15 | +``` |
| 16 | + |
| 17 | +Copy the output and replace the values in your `.env` file. |
| 18 | + |
| 19 | +### 2. Install Dependencies |
| 20 | + |
| 21 | +```bash |
| 22 | +npm install |
| 23 | +``` |
| 24 | + |
| 25 | +### 3. Start the CMS |
| 26 | + |
| 27 | +```bash |
| 28 | +npm run develop |
| 29 | +``` |
| 30 | + |
| 31 | +### 4. Create Admin User |
| 32 | + |
| 33 | +On first run, navigate to http://localhost:1337/admin and create your admin account. |
| 34 | + |
| 35 | +## Creating Your First Press Item |
| 36 | + |
| 37 | +1. Log in to the admin panel at http://localhost:1337/admin |
| 38 | +2. Click on "Press Items" in the left sidebar |
| 39 | +3. Click "Create new entry" |
| 40 | +4. Fill in the required fields: |
| 41 | + - **Title**: The headline |
| 42 | + - **Description**: A short excerpt (1-2 sentences) |
| 43 | + - **Publish Date**: When the item was published |
| 44 | + - **Slug**: Auto-generated from title, but can be customized |
| 45 | +5. Optional fields: |
| 46 | + - **Publication**: Name of the publication (e.g., "TechCrunch") |
| 47 | + - **Publication Logo**: URL to publication's logo |
| 48 | + - **External URL**: Link to the external article |
| 49 | + - **Content**: Full article content (rich text) |
| 50 | + - **Featured**: Check to highlight this item |
| 51 | + - **Category**: Choose press-release, media-mention, or announcement |
| 52 | +6. Click "Save" to create a draft |
| 53 | +7. Click "Publish" to make it live |
| 54 | + |
| 55 | +Once published, an MDX file will be automatically created in `../src/content/press/` and will appear on the `/developers/press` page. |
| 56 | + |
| 57 | +## Viewing Your Content |
| 58 | + |
| 59 | +1. Make sure the Astro dev server is running: |
| 60 | + ```bash |
| 61 | + cd .. # Go back to root |
| 62 | + bun run start |
| 63 | + ``` |
| 64 | + |
| 65 | +2. Visit http://localhost:1103/developers/press to see your press items |
| 66 | + |
| 67 | +## Editing Content |
| 68 | + |
| 69 | +1. Find the press item in the Strapi admin |
| 70 | +2. Make your changes |
| 71 | +3. Click "Save" and "Publish" |
| 72 | +4. The MDX file will be automatically updated |
| 73 | + |
| 74 | +## Unpublishing Content |
| 75 | + |
| 76 | +1. Find the press item in the Strapi admin |
| 77 | +2. Click the "Unpublish" button |
| 78 | +3. The MDX file will be automatically deleted |
| 79 | + |
| 80 | +## Tips |
| 81 | + |
| 82 | +- **Drafts**: Save items as drafts to work on them before publishing |
| 83 | +- **Featured Items**: Use sparingly - featured items appear in a prominent card grid |
| 84 | +- **External Links**: If you provide an External URL, the press item will link to that instead of showing local content |
| 85 | +- **Publication Logos**: For best display, use square logos with transparent backgrounds |
| 86 | +- **Rich Text**: The content field supports formatting, links, headings, etc. |
| 87 | + |
| 88 | +## Troubleshooting |
| 89 | + |
| 90 | +### Port Already in Use |
| 91 | + |
| 92 | +If port 1337 is already in use, you can change it in `.env`: |
| 93 | + |
| 94 | +``` |
| 95 | +PORT=1338 |
| 96 | +``` |
| 97 | + |
| 98 | +### MDX Files Not Generating |
| 99 | + |
| 100 | +1. Ensure the item is **published** (not just saved) |
| 101 | +2. Check the Strapi console for errors |
| 102 | +3. Verify the `MDX_OUTPUT_PATH` in `.env` is correct |
| 103 | +4. Check file permissions on `src/content/press/` |
| 104 | + |
| 105 | +### Can't Access Admin Panel |
| 106 | + |
| 107 | +1. Make sure the CMS is running (`npm run develop`) |
| 108 | +2. Check that nothing else is using port 1337 |
| 109 | +3. Try accessing http://127.0.0.1:1337/admin instead |
| 110 | + |
| 111 | +## Next Steps |
| 112 | + |
| 113 | +- Customize the press item schema in `src/api/press-item/content-types/press-item/schema.json` |
| 114 | +- Modify the MDX generation logic in `src/api/press-item/content-types/press-item/lifecycles.ts` |
| 115 | +- Update the press page styling in `../src/pages/press.astro` |
| 116 | +- Configure additional content types for other sections |
0 commit comments