1000x-developer 此代码库展示了我在《成为 1000x 开发者》博客系列中定义的原则。是什么使得这个项目如此出色?
1000x-developer 此代码库展示了我在《成为 1000x 开发者》博客系列中定义的原则。是什么使得这个项目如此出色?
This codebase is a demonstration of the principles defined in my Becoming a 1000x Developer blog series.
What makes this codebase special?
When you try to use AI to iterate on this codebase, you're going to find that the AI is just so good at implementing features. This is because of the structure.
For the best results, you should:
This project is a bun monorepo with the following core components:
packages/api: The API with services defined using the repository pattern.apps/http-server: The HTTP server with tRPC endpoints. Deployable to Cloudflare Workers.apps/expo-app: The Expo app.apps/next-app: The Next.js application.packages/db: The database schema and migrations.packages/db-migrations: Migrations for the database, with tooling to apply them using Drizzle.packages/models: Data models for the app.packages/tooling: The shared tooling for the project.utils/seed-data: Tooling to seed the database.To run the project, you need to have:
docker (download here) installed and runningtask (instructions here)bun (download here)Once you have those dependencies installed, you can initialize the .env files with:
task initialize-env-filesThis will copy the .env.example files to the correct locations (.env, utils/seed-data/.env, packages/db/.env, apps/next-app/.env, apps/http-server/.env).
You can start the dependencies with:
Note (convenience): you can also use this command to destroy and start the docker containers, and apply migrations (all in one)
task docker:reset
Or, you can start the dependencies with:
task docker:start # start the docker containers
task db:migrate # apply the migrationsThen, you can start the project (api, db, and next-app) with:
task startYou can access all services at the following URLs:
You might be wondering "why is there a SwaggerUI and an OpenAPI server?"
This is for convenience, and to demonstrate two different transport layers. You can call all of the services through plain-old HTTP client, or through tRPC (which is how the Next.js app calls the API).
This flexibility demonstrates the power of the tRPC library and provides a useful GUI (through SwaggerUI) for the API.
You can login to the app by visiting http://localhost:3000/login and using the following credentials:
[email protected] / password[email protected] / passwordYou can seed the database with:
task seed-dbWhen you run task docker:reset, the seeding is automatically run.
The utils/seed-data/index.ts file contains the script which performs the seeding.
The Expo app is a mobile app built with React Native and Expo.
You can run the app with:
cd apps/expo-app
bun run startThis will start the app in the Expo Go app.
You can lint all the code with:
task lint:fix:type-checkYou can follow the instructions in the DEPLOYMENT.md file.
暂无开放 Issues,或尚未同步最近议题。