-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to server components and actions
- Loading branch information
1 parent
4fbb0ce
commit 9335c11
Showing
8 changed files
with
620 additions
and
946 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,15 @@ Setting up your environment | |
|
||
.. edb:split-section:: | ||
We will use our project starter CLI to scaffold our Next.js application with everything we need to get started with Gel. This will create a new directory called ``flashcards`` with a fully configured Next.js project and a local Gel database with an empty schema. You should see the test suite pass, indicating that the database instance was created successfully, and we're ready to start building our application. | ||
|
||
.. note:: | ||
|
||
If you run into any issues at this point, look back at the output of the ``npm create @gel`` command for any error messages. Feel free to ask for help in the `Gel Discord <https://discord.gg/gel>`_. | ||
We will clone our Next.js starter template into a new directory called ``flashcards``. This will create a fully configured Next.js project and a local Gel instance with an empty schema. You should see the test suite pass, indicating that the database instance was created successfully, and we're ready to start building our application. | ||
|
||
.. code-block:: sh | ||
$ npm create @gel \ | ||
--environment=nextjs \ | ||
--project-name=flashcards --yes | ||
$ git clone \ | ||
[email protected]:geldata/quickstart-nextjs.git \ | ||
flashcards | ||
$ cd flashcards | ||
$ npm install | ||
$ npm run test | ||
|
@@ -40,16 +37,16 @@ Setting up your environment | |
db> select sum({1, 2, 3}); | ||
{6} | ||
db> with cards := { | ||
( | ||
front := "What is the highest mountain in the world?", | ||
back := "Mount Everest", | ||
), | ||
( | ||
front := "Which ocean contains the deepest trench on Earth?", | ||
back := "The Pacific Ocean", | ||
), | ||
} | ||
select cards order by random() limit 1; | ||
... ( | ||
... front := "What is the highest mountain in the world?", | ||
... back := "Mount Everest", | ||
... ), | ||
... ( | ||
... front := "Which ocean contains the deepest trench on Earth?", | ||
... back := "The Pacific Ocean", | ||
... ), | ||
... } | ||
... select cards order by random() limit 1; | ||
{ | ||
( | ||
front := "What is the highest mountain in the world?", | ||
|
@@ -59,9 +56,9 @@ Setting up your environment | |
.. edb:split-section:: | ||
Fun! We'll create a proper data model for this in the next step, but for now, let's take a look around the project we've just created. Most of the generated files will be familiar to you if you've worked with Next.js before. So let's focus on the new files that were created to integrate Gel. | ||
Fun! We'll create a proper data model for our application in the next step, but for now, let's take a look around the project we've just created. Most of the project files will be familiar to you if you've worked with Next.js before. So let's focus on the new files that integrate Gel. | ||
|
||
- ``gel.toml``: This is the configuration file for the Gel database. It contains the configuration for the local database instance, so that if another developer on your team wants to run the project, they can easily do so and have a compatible database version. | ||
- ``gel.toml``: This is the configuration file for the Gel project instance. | ||
- ``dbschema/``: This directory contains the schema for the database, and later supporting files like migrations, and generated code. | ||
- ``dbschema/default.gel``: This is the default schema file that we'll use to define our data model. It is empty for now, but we'll add our data model to this file in the next step. | ||
- ``lib/gel.ts``: This file contains the Gel client, which we'll use to interact with the database. | ||
|
Oops, something went wrong.