- TypeScript
- ESLint
- NextJS
- AuthJS
- TailwindCSS
- Prisma (ORM)
- PostgreSQL
- Docker
- Traefik (reverse proxy)
- GitHub Actions (CI/CD)
- Let's Encrypt (SSL certificates)
You must have Docker installed locally with a default PostgreSQL container.
For the local development copy .env.local.example
to .env.local
and set the following variables.
AUTH_SECRET
it's a secret for AuthJS that can be generated vianpx auth secret
oropenssl rand -base64 33
AUTH_GOOGLE_ID
andAUTH_GOOGLE_SECRET
is for Google OAuth credentials that you can configure and obtain in Google Cloud ConsoleAUTH_URL
is a URL of the application that will be used by AuthJS for redirecting the user after loginDATABASE_URL
is a connection string for the PostgreSQL database. You can use the following example:
postgresql://postgres:postgres@localhost:5432/stackly?schema=public
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Inter, a custom Google Font.
You must have a Linux server with Docker installed that is accessible via SSH with key-based authentication.
Setup variables in the repository settings:
HOST_PROD_IP
- IP address of the target serverHOST_PROD_USER
- A server user with appropriate access to copy files and launch docker containersHOST_PROD_SERVICE_PATH
- Path to directory for docker compose file. The app will be launched from this path viadocker compose
DOMAIN
- App domain nameAPP_PORT
- An internal port that will be used by TraefikALIAS
- App alias for container name and other internal use (database name, etc.)LE_EMAIL
- An email address for the Let's Encrypt SSL certificate that will be used by Traefik
For deployment, you should put all the contents of the .env
file into the ENV_FILE
secret variable for GitHub Actions.
Next, add the SSH key of your server as a secret variable DEPLOY_SSH_SECRET_KEY
as well.
For GitHub Packages you need to add your GitHub token with read and write access for packages to the GITHUB_TOKEN
secret variable.
Also add your PostgreSQL password to the POSTGRES_PASSWORD
secret variable.
To run the build and deploy process, you need to create a release with a git tag named with a v
prefix.
build-deploy.yml
- Build and deploy the application to the production server./github/actions/docker-compose-config
- Action for uploading the docker compose file to the production server./github/actions/ssh
- Action for SSH connection to the production server
.env.local.example
- Template for local development environment variables.env.local
- Local development configuration (not committed to repository).env
- Production environment configuration (stored as GitHub secret)
schema.prisma
- Prisma schema for the applicationprisma/schema.prisma
- Prisma schema for the applicationprisma/migrations
- Prisma migrations for the applicationprisma/seed.ts
- Prisma seed for the application
docker-compose.yml
- Main production configuration for application servicesdocker-compose-dev.yml
- Development-specific Docker configuration with hot-reloadingdocker-compose-traefik.yml
- Traefik reverse proxy configuration for SSL and routing