A modern, full-featured Content Management System built with SvelteKit, TypeScript, and PostgreSQL.
git clone <your-repo-url>
cd rx-cms-demo
npm install
Start PostgreSQL with Docker:
docker-compose up -d
Run database migrations:
npx prisma migrate dev
Seed the database with sample data:
npm run db:seed
Create a .env
file in the root directory:
# Database
DATABASE_URL="postgresql://postgres:password@localhost:5433/rx_cms_demo?schema=public"
# Auth
AUTH_SECRET="your-secret-key-here-change-in-production"
npm run dev
Visit http://localhost:5173
to see the application.
After seeding, you can log in with:
[email protected]
admin123
src/
āāā lib/
ā āāā auth/ # Authentication setup
ā āāā components/ # Reusable components
ā āāā validations/ # Zod validation schemas
āāā routes/
ā āāā admin/ # Admin panel routes
ā ā āāā login/ # Login page
ā ā āāā posts/ # Post management
ā ā āāā media/ # Media management
ā āāā blog/ # Public blog routes
āāā app.html # HTML template
āāā hooks.server.ts # Server-side hooks
prisma/
āāā schema.prisma # Database schema
āāā migrations/ # Database migrations
āāā seed.ts # Database seeding script
static/
āāā uploads/ # Media uploads directory
static/uploads/
Database: Set up a PostgreSQL database (e.g., Neon, Supabase, or Railway)
Environment Variables: Add to Vercel:
DATABASE_URL=your-production-database-url
AUTH_SECRET=your-production-secret-key
Build Command: npm run build
Deploy: Connect your repository to Vercel
npm run build
npm run preview
# Development server
npm run dev
# Database operations
npm run db:seed # Seed database
npm run db:reset # Reset and reseed database
npx prisma studio # Open Prisma Studio
npx prisma migrate dev # Create new migration
# Type checking
npm run check
npm run check:watch
# Build for production
npm run build
npm run preview
POST /admin/login
- User loginPOST /admin/logout
- User logoutGET /admin
- DashboardGET /admin/posts
- List postsPOST /admin/posts/new
- Create postGET /admin/posts/[id]/edit
- Edit postPOST /admin/posts/[id]/edit
- Update postDELETE /admin/posts/[id]
- Delete postGET /admin/media
- Media libraryPOST /admin/media
- Upload mediaGET /
- Home pageGET /blog
- Blog listingGET /blog/[slug]
- Individual postRole
enum in prisma/schema.prisma
npx prisma migrate dev
src/lib/auth/
tailwind.config.js
for custom themessrc/app.css
prisma/schema.prisma
npx prisma migrate dev
to create migrationdocker-compose ps
.env
fileAUTH_SECRET
in environment variablesnode_modules
and reinstall: rm -rf node_modules && npm install
This project is open source and available under the MIT License.
For questions or issues, please open an issue on GitHub or contact the development team.
Built with ā¤ļø using SvelteKit, TypeScript, and modern web technologies.