Installation & Setup
Install FastCMS and get your server running in minutes.
Installation & Setup
Installation
# Install dependencies
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
# Run database migrations
alembic upgrade head
# Start the server
uvicorn app.main:app --host 0.0.0.0 --port 8000Access the Admin Dashboard
Navigate to http://localhost:8000/admin in your browser. On first run, you will be prompted to create an admin account.
FastCMS Admin
Sign in to your dashboard
After signing in, you land on the main dashboard:
Dashboard
System overview and statistics
Total Users
142
New Users (7d)
18
Collections
9
Backups
12
Files
384
Quick Actions
Manage Users
View, edit, and manage user accounts
Manage Collections
View and manage collections
API Documentation
View API docs and test endpoints
Environment Variables
Create a .env file in the project root:
# Application
ENV=development
DEBUG=true
# Database
DATABASE_URL=sqlite:///./data/app.db
# Security
SECRET_KEY=your-secret-key-here-change-in-production
ACCESS_TOKEN_EXPIRE_MINUTES=1440
REFRESH_TOKEN_EXPIRE_DAYS=7
# CORS
CORS_ORIGINS=http://localhost:3000,http://localhost:8000Database
FastCMS uses SQLite with WAL (Write-Ahead Logging) mode for better concurrency.
Database Location: data/app.db
Important Notes:
- All collections are stored as dynamic tables
- The
collectionstable stores metadata and schemas - The
userstable is for admin authentication only - Auth collections create their own tables with authentication fields
Interactive API Documentation
FastCMS provides interactive API documentation powered by Swagger UI.
Access it at: http://localhost:8000/docs
This interface allows you to:
- Browse all available endpoints
- Test API calls directly from the browser
- View request/response schemas
- Authenticate and test protected endpoints
Best Practices
Security
- Always use strong
SECRET_KEYin production - Use HTTPS in production
- Set appropriate access control rules on collections
- Validate user input on the client side
- Use refresh tokens for long-lived sessions
Performance
- Add indexes to frequently queried fields
- Use pagination for large datasets
- Set appropriate cache TTL for view collections
- Use view collections for complex queries instead of client-side joins
Data Modeling
- Use auth collections for any user type requiring authentication
- Use base collections for standard data
- Use view collections for reports and aggregations
- Use relation fields to link collections
- Set
cascade_deleteappropriately on relations
Troubleshooting
Collection Creation Fails
Issue: "An invalid form control with name='' is not focusable"
Solution: This occurs when hidden required fields (relation/view fields) are present. Ensure you're creating the correct collection type and all visible required fields are filled.
Authentication Fails
Issue: 401 Unauthorized
Solution:
- Ensure access token is included in Authorization header
- Check if token has expired (access tokens expire in 15 minutes by default)
- Use refresh token to get a new access token
Access Denied to Records
Issue: Cannot view/edit records despite being authenticated
Solution:
- Check the access control rules on the collection
- Ensure your user meets the rule criteria
- Verify the record data matches the rules (e.g.,
user_idfield)