Quick Guide for Setting Up a New Project
Before you start, make sure you meet the requirements needed.
Setting up a brand new project
Are you working with an existing project, check over here instead
Click here to generate a new Forge project in DatoCMS
Make sure that the project is added to a playground organization. This is because playground is a free plan. When the project is ready for production, it will be moved to another organization.
Creating a New Project in GitHub
- Visit the Fully Studios GitHub.
- Scroll down to the repositories section and click on
New. - Select
fullystudios/forgeas your repositorytemplate. - Enter a name for your new repository.
- Click
Createto set up the repository.
Cloning Your New Project
- Click the
<> Codebutton in your repository. - Select the
SSHoption - Copy the SSH link.
- Open your terminal and navigate to the directory where you want to store your new project.
- Run the command:
git clone **Paste the SSH link here**.It should look something like this:
git clone git@github.com:fullystudios/your-project.git
Now you have set up the base project, you can start setting up the Forge template.
Updating Forge Variables
Now that you have cloned the repository, you need to set up the Forge template.
- Open the cloned project in your preferred code editor.
- Update the
name,description, andportfields inpackage.json. - Update the
portin bothsrc/app/api/preview-links/route.tsandsrc/lib/constants.ts. - Access the DatoCMS project settings.
- Go to
Project Settings>API Tokens.
- Go to
- Copy
.env.local.exampleand name it.env.local. - Copy the
Full-access API tokenand paste it into theDATOCMS_API_TOKENvariable in.env.local. - Copy the
Read-only API tokenand paste it into theDATOCMS_PREVIEW_TOKENvariable in.env.local.
Starting the Project
-
npm install -
npm run dev -
Visit
http://localhost:YOUR_CHOSEN_PORTin your browser to see the project.
Connecting Vercel to Your Project
- Navigate to your project directory:
cd your-project. - Run the command:
vercel link. - Follow the setup instructions, ensuring you select the
Fully Studiosscope. - Visit Vercel Dashboard.
- Click on
Connect Git Repository. - Log in with your GitHub account.
- Select your project and click
Connect. - Copy the contents of your
.env.localfile. - In Vercel, go to
Settings>Environment Variables. - Paste the contents into the
Key Valuefields (Vercel will format them automatically). - Click on the
Storagetab. - Click in the button
Connect Database. - Find
forge-cache-tagsin the list of databases. - Click on the
Connectbutton. - Now there should be a lot more environment variables under
Settings-Environment Variablesin Vercel. - Now a deployment can be made by either; - Push a commit to GitHub and a deployment will be triggered automatically - Trigger a manual deployment in the Vercel project under “Deployments”, under a three-dot-menu in the top right