Strapi Quick Start — Create Your First Project and Content Type
In this tutorial, you will create your first Strapi project using npx create-strapi-app, complete the admin setup wizard, and build a content type for a recipe sharing platform using the visual Content-Type Builder.
What You'll Learn
- How to create a new Strapi project with the quickstart and manual methods
- How to complete the admin user registration process
- How to navigate the basic Strapi admin panel
- How to create your first collection type using the Content-Type Builder
- How to add entries using the Content Manager
- How to fetch your content through the REST API
Why It Matters
The fastest way to learn Strapi is to use it. By the end of this lesson, you will have a running Strapi instance with a content type, some sample data, and a working API endpoint. This hands-on experience gives you the foundation you need for all the lessons that follow.
Real-World Use
A food blogger wants to launch a recipe website and a mobile app simultaneously. Instead of building two separate backends, they create a Strapi project with a "Recipe" content type. The website (built with Next.js) and the mobile app (built with React Native) both fetch from the same API. The blogger updates recipes once in the Strapi admin, and both platforms are updated immediately.
Learning Path
flowchart LR A["What is Strapi?"] --> B["Strapi Architecture"] B --> C["Quick Start
-- You are here"]:::current C --> D["Strapi Admin"] D --> E["Content Types"] E --> F["Fields"] F --> G["Relations"] classDef current fill:#4945ff,color:#fff,stroke-width:2px
Prerequisites
Before starting, ensure you have:
# Check Node.js version (v18 or later required)
node --version
# Output: v18.0.0 or higher
# Check npm version
npm --version
# Output: v9.0.0 or higher
If you do not have Node.js installed, download it from nodejs.org or use a version manager like nvm.
# Using nvm to install Node.js 18
nvm install 18
nvm use 18
Creating a Project
Strapi provides two creation methods. The quickstart method uses SQLite and starts immediately. The manual method lets you choose the database and options.
# Method 1: Quickstart (recommended for learning)
npx create-strapi-app@latest recipe-api --quickstart
# Output:
# Creating project...
# Installing dependencies...
# Starting server...
# Strapi is running at http://localhost:1337/admin
While the quickstart method runs, Strapi installs dependencies, creates a SQLite database, and starts the development server. This takes about 2-5 minutes depending on your internet connection.
# Method 2: Manual setup with PostgreSQL
npx create-strapi-app@latest recipe-api --dbclient postgres
# Follow the prompts to configure your database connection
For this tutorial, use the quickstart method. It requires zero configuration and lets you focus on learning Strapi's features.
Admin User Registration
Once Strapi starts, open http://localhost:1337/admin in your browser. You will see the registration form.
First Name: [Alice]
Last Name: [Developer]
Email: [alice@example.com]
Password: [........]
Confirm Password: [........]
Strapi requires a strong password with at least one uppercase letter, one lowercase letter, one number, and one special character. This is designed for production security but can be adjusted in development.
After submitting the form, Strapi creates the admin user and logs you in. You are now in the Strapi admin dashboard.
The Content-Type Builder
The Content-Type Builder is the visual tool for defining data models. You access it from the left sidebar under "Content-Type Builder."
Click the "Create your first Content Type" button. A modal appears asking for a display name.
Display Name: Recipe
Strapi automatically generates the singular name (recipe) and plural name (recipes). These become the API endpoint names.
Now add fields to your Recipe:
| Field Name | Type | Settings |
|---|---|---|
| title | Text (short) | Required, max length: 200 |
| description | Rich Text | Required |
| prep_time | Number (integer) | Not required |
| cook_time | Number (integer) | Not required |
| servings | Number (integer) | Default: 2 |
| difficulty | Enumeration | Values: easy, medium, hard |
After adding all fields, click "Save." Strapi restarts automatically to apply the schema changes.
// Behind the scenes, Strapi creates this schema
// src/api/recipe/content-types/recipe/schema.json
{
"kind": "collectionType",
"collectionName": "recipes",
"info": {
"singularName": "recipe",
"pluralName": "recipes",
"displayName": "Recipe"
},
"options": {
"draftAndPublish": true
},
"attributes": {
"title": {
"type": "string",
"required": true,
"maxLength": 200
},
"description": {
"type": "richtext",
"required": true
},
"prep_time": {
"type": "integer"
},
"cook_time": {
"type": "integer"
},
"servings": {
"type": "integer",
"default": 2
},
"difficulty": {
"type": "enumeration",
"enum": ["easy", "medium", "hard"]
}
}
}
Adding Content
Now go to "Content Manager" in the left sidebar and click on "Recipes." You will see an empty list with a "Create an entry" button.
Click it to open the entry editor. Fill in the fields:
Title: Classic Margherita Pizza
Description: A traditional Italian pizza with fresh mozzarella, tomatoes, and basil...
Prep Time: 20
Cook Time: 15
Servings: 4
Difficulty: easy
Click "Save" and then "Publish." Strapi's draft/publish system requires an explicit publish step before content appears in the public API. Unpublished entries return a 404 error for public requests.
Add two more recipes to have data to work with:
Recipe 2: Chicken Tikka Masala
Prep Time: 30, Cook Time: 40, Servings: 6, Difficulty: medium
Recipe 3: Chocolate Lava Cake
Prep Time: 15, Cook Time: 12, Servings: 2, Difficulty: hard
Fetching via REST API
Your new recipes are now available at the REST API. Strapi automatically generates CRUD endpoints for every content type.
# List all recipes
curl http://localhost:1337/api/recipes
# Output:
# {
# "data": [
# {
# "id": 1,
# "attributes": {
# "title": "Classic Margherita Pizza",
# "description": "A traditional Italian pizza...",
# "prep_time": 20,
# "cook_time": 15,
# "servings": 4,
# "difficulty": "easy",
# "createdAt": "2026-06-28T...",
# "updatedAt": "2026-06-28T..."
# }
# },
# // ... more recipes
# ],
# "meta": {
# "pagination": {
# "page": 1,
# "pageSize": 25,
# "pageCount": 1,
# "total": 3
# }
# }
# }
# Get a single recipe by ID
curl http://localhost:1337/api/recipes/1
# Output includes the single item wrapped in a data object
Only published entries appear in the API. Draft entries are excluded from the public response. This is controlled by the draftAndPublish option on your content type.
Common Mistakes
Forgetting to publish. Beginners create entries but do not publish them, then wonder why the API returns empty results or 404 errors. Check that entries have a green "Published" badge in the Content Manager.
Missing required fields when creating content types. If you mark a field as required, Strapi enforces this at the API level too. Trying to create an entry without a required field returns a validation error. Plan your fields carefully before saving.
Using wrong field types. Choosing the wrong field type early means rebuilding content types later. Text (short) is for titles. Rich Text is for formatted content. JSON is for structured data. Media is for images and files.
Using the quickstart method for production. SQLite works for development but fails under concurrent writes in production. Always switch to PostgreSQL before deploying.
Not waiting for Strapi to restart after saving content types. Strapi restarts automatically when you save a content type. If you make another change before the restart completes, you may lose changes. Wait for the "Restarting..." message to disappear.
Practice Questions
What command creates a new Strapi project with SQLite? Answer:
npx create-strapi-app@latest my-project --quickstartWhy do you need to publish an entry after saving it? Answer: Strapi uses draft/publish workflow by default. Published entries appear in the API for public users. Draft entries are only visible to authenticated admin users.
What is the URL to fetch all recipes after creating a Recipe content type? Answer:
GET http://localhost:1337/api/recipesChallenge: Create a second content type called "Author" with fields for name (string), bio (richtext), and avatar (media, single image). Add two authors. Then create a "author" field on the Recipe type using a relation. We will cover relations in depth later.
FAQ
Mini Project
Your task: Create a complete startup project with sample data.
- Create a new Strapi project called
recipe-apiusing--quickstart. - Create a "Recipe" collection type with fields: title (string, required), description (richtext, required), ingredients (json), prep_time (integer), cook_time (integer), servings (integer, default 4), difficulty (enumeration: easy/medium/hard).
- Add 5 sample recipes with realistic data. Publish all of them.
- Test the API by fetching
http://localhost:1337/api/recipesin your browser or with curl. - Note the response structure. Identify the
data,attributes, andmetaobjects. Try fetching a single recipe by ID.
What's Next
Congratulations on creating your first Strapi project! Now proceed to Strapi Admin to explore the dashboard, Content Manager, Media Library, and Settings in depth. After that, dive deeper into Content Types to understand collection types, single types, and components.
Related lessons:
- Node.js Fundamentals — Prerequisites for Strapi
- REST API Design — Understanding the endpoints
- GraphQL Basics — Alternative API approach
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro