diff --git a/README.md b/README.md index 5826704..99fe5b4 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,94 @@ -# Welcome to your Convex + Next.js + Convex Auth app +

+
+ Next Template +
+ Tech Tracker +
+

-This is a [Convex](https://convex.dev/) project created with [`npm create convex`](https://www.npmjs.com/package/create-convex). +
+ +

How to run:

+
-After the initial setup (<2 minutes) you'll have a working full-stack app using: +### Clone the Repository & Install Dependencies -- Convex as your backend (database, server logic) -- [React](https://react.dev/) as your frontend (web page interactivity) -- [Next.js](https://nextjs.org/) for optimized web hosting and page routing -- [Tailwind](https://tailwindcss.com/) for building great looking accessible UI -- [Convex Auth](https://labs.convex.dev/auth) for authentication - -## Get started - -If you just cloned this codebase and didn't use `npm create convex`, run: - -``` -npm install -npm run dev +```bash +git clone https://git.gbrown.org/gib/techtracker.git ``` -If you're reading this README on GitHub and want to use this template, run: - -``` -npm create convex@latest -- -t nextjs-convexauth +```bash +cd techtracker ``` -## Learn more +I would recommend using [bun](https://bun.sh/) to install dependencies. -To learn more about developing your project with Convex, check out: +```bash +bun i +``` -- The [Tour of Convex](https://docs.convex.dev/get-started) for a thorough introduction to Convex principles. -- The rest of [Convex docs](https://docs.convex.dev/) to learn about all Convex features. -- [Stack](https://stack.convex.dev/) for in-depth articles on advanced topics. -- [Convex Auth docs](https://labs.convex.dev/auth) for documentation on the Convex Auth library. +You will also need docker installed on whatever host you plan to run the Supabase instance from, whether locally, or on a home server or a VPS or whatever. Or you can just use the Supabase SaaS if you want to have a much easier time, probably. I wouldn't know! -## Configuring other authentication methods +### Add your environment variables -To configure different authentication methods, see [Configuration](https://labs.convex.dev/auth/config) in the Convex Auth docs. +Copy the example environment variable files and paste them in the same directory named `.env`. -## Join the community +```bash +cp ./env.example ./.env +``` -Join thousands of developers building full-stack apps with Convex: +```bash +cp ./host/convex/docker/env.example ./host/convex/docker/.env +``` -- Join the [Convex Discord community](https://convex.dev/community) to get help in real-time. -- Follow [Convex on GitHub](https://github.com/get-convex/), star and contribute to the open-source implementation of Convex. +### Start self hosted convex by running + +```bash +cd ./host/convex/docker +sudo docker compose up -d +sudo docker compose exec convex-backend ./generate_admin_key.sh +``` + +### Start your development environment. + +Run + + ```bash +bun dev + ``` + +to start your development environment with turbopack + +You can also run + +```bash +bun dev:slow +``` + +to start your development environment with webpack + +### Start your Production Environment. + +There are Dockerfiles & docker compose files that can be found in the `./scripts/docker` folder for the Next.js website. There is also a script called `reload_container` located in the `./scripts/` folder which was created to quickly update the container, but this will give you a better idea of what you need to do. First, build the image with + +```bash +sudo docker compose -f ./host/next/docker/compose.yml build +``` + +then you can run the container with + +```bash +sudo docker compose -f ./host/next/docker/compose up -d +``` + +Now, you may end up with some build errors. The `reload_containers` script swaps out the next config before it runs the docker build to skip any build errors, so you may want to do this as well, though you are welcome to fix the build errors as well, of course! + +### Fin + +I am sure I am missing a lot of stuff so feel free to open an issue if you have any questions or if you feel that I should add something here! + +
diff --git a/env.example b/env.example new file mode 100644 index 0000000..4721e8a --- /dev/null +++ b/env.example @@ -0,0 +1,18 @@ +### Server Variables ### +# Convex +CONVEX_SELF_HOSTED_URL= +CONVEX_SELF_HOSTED_ADMIN_KEY= +NEXT_PUBLIC_CONVEX_URL= +SETUP_SCRIPT_RAN= +# Sentry +SENTRY_AUTH_TOKEN= + +### Client Variables ### +# Next # Default Values: +NEXT_PUBLIC_SITE_URL='http://localhost:3000' +# Sentry # Default Values +NEXT_PUBLIC_SENTRY_DSN= +NEXT_PUBLIC_SENTRY_URL= +NEXT_PUBLIC_SENTRY_ORG= +NEXT_PUBLIC_SENTRY_PROJECT_NAME= + diff --git a/host/convex/docker/env.example b/host/convex/docker/env.example new file mode 100644 index 0000000..d0114e4 --- /dev/null +++ b/host/convex/docker/env.example @@ -0,0 +1,17 @@ +BACKEND_CONTAINER_NAME= +DASHBOARD_CONTAINER_NAME= +INSTANCE_NAME= +CONVEX_CLOUD_ORIGIN= +CONVEX_SITE_ORIGIN= +DISABLE_BEACON= +REDACT_LOGS_TO_CLIENT= +DO_NOT_REQUIRE_SSL= +NEXT_PUBLIC_DEPLOYMENT_URL= +#POSTGRES_URL= +#DATABASE_URL= +#INSTANCE_SECRET= +#CONVEX_RELEASE_VERSION_DEV= +#ACTIONS_USER_TIMEOUT_SECS= +#MYSQL_URL= +#RUST_LOG= +#RUST_BACKTRACE=